[Lldb-commits] [PATCH] D139252: [lldb/Plugins] Introduce Scripted Platform Plugin

2022-12-03 Thread Med Ismail Bennani via Phabricator via lldb-commits
mib created this revision.
mib added reviewers: JDevlieghere, jingham.
mib added a project: LLDB.
Herald added a project: All.
mib requested review of this revision.
Herald added a subscriber: lldb-commits.

This patch introduces Scripted Platform, a new platform plugin that can
be customized with a python script.

For now this can list processes described in the python script file but
eventually, it will be used to spawn scripted processes and act as an
interface between them.

Signed-off-by: Med Ismail Bennani 


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D139252

Files:
  lldb/source/Plugins/Platform/CMakeLists.txt
  lldb/source/Plugins/Platform/scripted/CMakeLists.txt
  lldb/source/Plugins/Platform/scripted/ScriptedPlatform.cpp
  lldb/source/Plugins/Platform/scripted/ScriptedPlatform.h

Index: lldb/source/Plugins/Platform/scripted/ScriptedPlatform.h
===
--- /dev/null
+++ lldb/source/Plugins/Platform/scripted/ScriptedPlatform.h
@@ -0,0 +1,83 @@
+//===-- PlatformPOSIX.h -*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#ifndef LLDB_SOURCE_PLUGINS_SCRIPTED_PLATFORM_H
+#define LLDB_SOURCE_PLUGINS_SCRIPTED_PLATFORM_H
+
+#include "lldb/Target/Platform.h"
+#include "lldb/Utility/ScriptedMetadata.h"
+
+namespace lldb_private {
+
+class ScriptedPlatform : public Platform {
+public:
+  ScriptedPlatform(Debugger *debugger,
+   const ScriptedMetadata *scripted_metadata, Status &error);
+
+  ~ScriptedPlatform() override;
+
+  static lldb::PlatformSP CreateInstance(bool force, const ArchSpec *arch,
+ const Debugger *debugger,
+ const ScriptedMetadata *metadata);
+
+  static void Initialize();
+
+  static void Terminate();
+
+  static llvm::StringRef GetPluginNameStatic() { return "scripted-platform"; }
+
+  static llvm::StringRef GetDescriptionStatic() {
+return "Scripted Platform plug-in.";
+  }
+
+  llvm::StringRef GetDescription() override { return GetDescriptionStatic(); }
+
+  llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
+
+  std::vector
+  GetSupportedArchitectures(const ArchSpec &process_host_arch) override;
+
+  bool IsConnected() const override { return true; }
+
+  lldb::ProcessSP Attach(lldb_private::ProcessAttachInfo &attach_info,
+ lldb_private::Debugger &debugger,
+ lldb_private::Target *target, // Can be nullptr, if
+ // nullptr create a new
+ // target, else use
+ // existing one
+ lldb_private::Status &error) override;
+
+  uint32_t FindProcesses(const ProcessInstanceInfoMatch &match_info,
+ ProcessInstanceInfoList &proc_infos) override;
+
+  bool GetProcessInfo(lldb::pid_t pid, ProcessInstanceInfo &proc_info) override;
+
+  Status LaunchProcess(ProcessLaunchInfo &launch_info) override;
+
+  Status KillProcess(const lldb::pid_t pid) override;
+
+  void CalculateTrapHandlerSymbolNames() override {}
+
+private:
+  ScriptedPlatform(const ScriptedPlatform &) = delete;
+  const ScriptedPlatform &operator=(const ScriptedPlatform &) = delete;
+
+  void CheckInterpreterAndScriptObject() const;
+  ScriptedPlatformInterface &GetInterface() const;
+  static bool IsScriptLanguageSupported(lldb::ScriptLanguage language);
+
+  // Member variables.
+  const ScriptedMetadata *m_scripted_metadata = nullptr;
+  lldb_private::ScriptInterpreter *m_interpreter = nullptr;
+  lldb_private::StructuredData::ObjectSP m_script_object_sp = nullptr;
+  //@}
+};
+
+} // namespace lldb_private
+
+#endif // LLDB_SOURCE_PLUGINS_SCRIPTED_PLATFORM_H
Index: lldb/source/Plugins/Platform/scripted/ScriptedPlatform.cpp
===
--- /dev/null
+++ lldb/source/Plugins/Platform/scripted/ScriptedPlatform.cpp
@@ -0,0 +1,300 @@
+#include "ScriptedPlatform.h"
+
+#include "lldb/Core/Debugger.h"
+#include "lldb/Core/PluginManager.h"
+#include "lldb/Host/HostInfo.h"
+#include "lldb/Interpreter/ScriptInterpreter.h"
+#include "lldb/Target/ExecutionContext.h"
+#include "lldb/Utility/LLDBLog.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+LLDB_PLUGIN_DEFINE(ScriptedPlatform)
+
+static uint32_t g_initialize_count = 0;
+
+static constexpr lldb::ScriptLanguage g_supported_script_languages[] = {
+ScriptLanguage::eScriptLanguagePython,
+};
+
+bool ScriptedPlatform::IsScriptLanguageSupported(
+lldb::ScriptLanguage language) {
+  llvm::ArrayRef supported_languages =
+  llvm::makeArrayRef(g_supported_scr

[Lldb-commits] [PATCH] D139158: [LLDB][LoongArch] Make software single stepping work

2022-12-03 Thread Lu Weining via Phabricator via lldb-commits
SixWeining added a comment.

I'm not sure whether lldb should follow llvm coding standard.




Comment at: lldb/source/Plugins/Instruction/LoongArch/CMakeLists.txt:7-8
+lldbInterpreter
+lldbSymbol
+lldbPluginProcessUtility
+  LINK_COMPONENTS

It's better to sort alphabetically.



Comment at: 
lldb/source/Plugins/Instruction/LoongArch/EmulateInstructionLoongArch.cpp:37
+  static EmulateInstructionLoongArch::Opcode g_opcodes[] = {
+  {0x, 0x, &EmulateInstructionLoongArch::EmulateNonJMP,
+   "NonJMP"}};

Will the mask be changed in future? If so, better to leave a `FIXME` or `TODO`. 
If not, the following `for` loop always return the `NonJMP` opcode?



Comment at: 
lldb/source/Plugins/Instruction/LoongArch/EmulateInstructionLoongArch.cpp:39
+   "NonJMP"}};
+  static const size_t num_ppc_opcodes = std::size(g_opcodes);
+

loongarch?



Comment at: 
lldb/source/Plugins/Instruction/LoongArch/EmulateInstructionLoongArch.cpp:41
+
+  for (size_t i = 0; i < num_ppc_opcodes; ++i) {
+if ((g_opcodes[i].mask & inst) == g_opcodes[i].value)

useless `{`



Comment at: 
lldb/source/Plugins/Instruction/LoongArch/EmulateInstructionLoongArch.cpp:44
+  return &g_opcodes[i];
+  }
+  return nullptr;

Ditto.



Comment at: 
lldb/source/Plugins/Instruction/LoongArch/EmulateInstructionLoongArch.cpp:49
+bool EmulateInstructionLoongArch::EvaluateInstruction(uint32_t options) {
+  uint32_t inst_size = m_opcode.GetByteSize();
+  uint32_t inst = m_opcode.GetOpcode32();

Could it be `InstSize`? 
https://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly



Comment at: 
lldb/source/Plugins/Instruction/LoongArch/EmulateInstructionLoongArch.cpp:66-68
+  success = (this->*opcode_data->callback)(inst);
+  if (!success)
+return false;

  if (!(this->*opcode_data->callback)(inst))
return false;



Comment at: 
lldb/source/Plugins/Instruction/LoongArch/EmulateInstructionLoongArch.cpp:75-78
+if (new_pc == old_pc) {
+  if (!WritePC(old_pc + inst_size))
+return false;
+}

```
if (new_pc == old_pc && !WritePC(old_pc + inst_size)
return false;
```



Comment at: 
lldb/source/Plugins/Instruction/LoongArch/EmulateInstructionLoongArch.cpp:84
+bool EmulateInstructionLoongArch::ReadInstruction() {
+
+  bool success = false;

Remove useless blank line.



Comment at: 
lldb/source/Plugins/Instruction/LoongArch/EmulateInstructionLoongArch.cpp:174
+  if (EmulateInstructionLoongArch::SupportsThisInstructionType(inst_type) &&
+  SupportsThisArch(arch)) {
+return new EmulateInstructionLoongArch(arch);

useless `{`



Comment at: 
lldb/source/Plugins/Instruction/LoongArch/EmulateInstructionLoongArch.cpp:176
+return new EmulateInstructionLoongArch(arch);
+  }
+

Ditto



Comment at: 
lldb/source/Plugins/Instruction/LoongArch/EmulateInstructionLoongArch.h:28-36
+switch (inst_type) {
+case eInstructionTypePCModifying:
+  return true;
+case eInstructionTypeAny:
+case eInstructionTypePrologueEpilogue:
+case eInstructionTypeAll:
+  return false;

Do you plan to support `eInstructionTypeAny` `eInstructionTypePrologueEpilogue` 
`eInstructionTypeAll` in future? If so, had better leave a `TODO` here. 
Otherwise this function can be simplied to:
```
  return inst_type == eInstructionTypePCModifying;
```



Comment at: 
lldb/source/Plugins/Instruction/LoongArch/EmulateInstructionLoongArch.h:66
+   uint32_t reg_num) override;
+  lldb::addr_t ReadPC(bool *success);
+  bool WritePC(lldb::addr_t pc);

Could it be a private function?



Comment at: 
lldb/source/Plugins/Instruction/LoongArch/EmulateInstructionLoongArch.h:79
+
+  bool EmulateNonJMP(uint32_t inst);
+};

Is it a override function?



Comment at: lldb/tools/lldb-server/SystemInitializerLLGS.cpp:51
+#define LLDB_TARGET_LoongArch
+#include "Plugins/Instruction/LoongArch/EmulateInstructionLoongArch.h"
+#endif

Sort alphabetically?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139158/new/

https://reviews.llvm.org/D139158

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D138724: [lldb][Target] Flush the scratch TypeSystem when process gets deleted

2022-12-03 Thread Michael Buch via Phabricator via lldb-commits
Michael137 reopened this revision.
Michael137 added a comment.
This revision is now accepted and ready to land.

Linux issue was just about dlopening the correct library name. Fixing that 
makes the test pass on my Ubuntu machine.

Skipping for now on Windows because I don't have access to a machine at the 
moment


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138724/new/

https://reviews.llvm.org/D138724

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D138724: [lldb][Target] Flush the scratch TypeSystem when process gets deleted

2022-12-03 Thread Michael Buch via Phabricator via lldb-commits
Michael137 updated this revision to Diff 479841.
Michael137 added a comment.

- Fix Linux tests: pass solib into source
- Only flush modified files (including shared libraries)
- Skip on Windows for now
- Relaunch process using SBAPI


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138724/new/

https://reviews.llvm.org/D138724

Files:
  lldb/source/Target/Target.cpp
  lldb/test/API/functionalities/rerun_and_expr/Makefile
  lldb/test/API/functionalities/rerun_and_expr/TestRerunAndExpr.py
  lldb/test/API/functionalities/rerun_and_expr/main.cpp
  lldb/test/API/functionalities/rerun_and_expr/rebuild.cpp
  lldb/test/API/functionalities/rerun_and_expr_dylib/Makefile
  lldb/test/API/functionalities/rerun_and_expr_dylib/TestRerunAndExprDylib.py
  lldb/test/API/functionalities/rerun_and_expr_dylib/lib.cpp
  lldb/test/API/functionalities/rerun_and_expr_dylib/main.cpp
  lldb/test/API/functionalities/rerun_and_expr_dylib/rebuild.cpp

Index: lldb/test/API/functionalities/rerun_and_expr_dylib/rebuild.cpp
===
--- /dev/null
+++ lldb/test/API/functionalities/rerun_and_expr_dylib/rebuild.cpp
@@ -0,0 +1,7 @@
+struct Base {
+  int m_base_val = 42;
+};
+
+LLDB_DYLIB_EXPORT struct Foo : public Base {
+  int m_derived_val = 137;
+} global_foo;
Index: lldb/test/API/functionalities/rerun_and_expr_dylib/main.cpp
===
--- /dev/null
+++ lldb/test/API/functionalities/rerun_and_expr_dylib/main.cpp
@@ -0,0 +1,17 @@
+#include 
+#include 
+#include 
+
+extern struct Foo imported;
+
+int main() {
+  // LIB_NAME defined on commandline
+  std::string libname{"./"};
+  libname += LIB_NAME;
+
+  void *handle = dlopen(libname.c_str(), RTLD_NOW);
+  struct Foo *foo = (struct Foo *)dlsym(handle, "global_foo");
+  assert(foo != nullptr);
+
+  return 0;
+}
Index: lldb/test/API/functionalities/rerun_and_expr_dylib/lib.cpp
===
--- /dev/null
+++ lldb/test/API/functionalities/rerun_and_expr_dylib/lib.cpp
@@ -0,0 +1 @@
+LLDB_DYLIB_EXPORT struct Foo { int m_val = 42; } global_foo;
Index: lldb/test/API/functionalities/rerun_and_expr_dylib/TestRerunAndExprDylib.py
===
--- /dev/null
+++ lldb/test/API/functionalities/rerun_and_expr_dylib/TestRerunAndExprDylib.py
@@ -0,0 +1,84 @@
+"""
+Test that re-running a process from within the same target
+after rebuilding the a dynamic library flushes the scratch
+TypeSystems tied to that process.
+"""
+
+import lldb
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+from lldbsuite.test.decorators import *
+
+class TestRerunExprDylib(TestBase):
+@skipIfWindows
+def test(self):
+"""
+Tests whether re-launching a process without destroying
+the owning target keeps invalid ASTContexts in the
+scratch AST's importer.
+
+We test this by:
+1. Evaluating an expression to import 'struct Foo' into
+   the scratch AST
+2. Change the definition of 'struct Foo' and rebuild the dylib
+3. Re-launch the process
+4. Evaluate the same expression in (1). We expect to have only
+   the latest definition of 'struct Foo' in the scratch AST.
+"""
+
+DYLIB_NAME = 'foo'
+FULL_DYLIB_NAME = 'libfoo.dylib' if self.platformIsDarwin() else 'libfoo.so'
+
+# Build libfoo.dylib
+self.build(dictionary={'DYLIB_CXX_SOURCES':'lib.cpp',
+   'DYLIB_ONLY':'YES',
+   'DYLIB_NAME':DYLIB_NAME,
+   'USE_LIBDL':'1',
+   'LD_EXTRAS':'-L.'})
+
+# Build a.out
+self.build(dictionary={'EXE':'a.out',
+   'CXX_SOURCES':'main.cpp',
+   'USE_LIBDL':'1',
+   'CXXFLAGS_EXTRAS':f'-DLIB_NAME=\\"{FULL_DYLIB_NAME}\\"',
+   'LD_EXTRAS':'-L.'})
+
+exe = self.getBuildArtifact("a.out")
+target = self.dbg.CreateTarget(exe) 
+breakpoint = target.BreakpointCreateBySourceRegex('return', lldb.SBFileSpec('main.cpp'))
+process = target.LaunchSimple(None, None, self.get_process_working_directory())  
+
+self.expect_expr('*foo', result_type='Foo', result_children=[
+ValueCheck(name='m_val', value='42')
+])
+
+# Re-build libfoo.dylib
+self.build(dictionary={'DYLIB_CXX_SOURCES':'rebuild.cpp',
+   'DYLIB_ONLY':'YES',
+   'DYLIB_NAME':DYLIB_NAME,
+   'USE_LIBDL':'1',
+   'LD_EXTRAS':'-L.'})
+
+# Rerun program within the same target
+process.Destroy()
+process = target.LaunchSimple(None, No

[Lldb-commits] [PATCH] D138834: [lldb] Fix simple template names interaction with debug info declarations

2022-12-03 Thread Michael Buch via Phabricator via lldb-commits
Michael137 added inline comments.



Comment at: lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp:765
+m_ast.CreateClassTemplateSpecializationType(class_specialization_decl);
+return clang_type.GetTypeName(/*BaseOnly*/ true);
+  }

aeubanks wrote:
> Michael137 wrote:
> > Michael137 wrote:
> > > Ok so what we're doing is:
> > > 1. Create a `ClassTemplateSpecializationDecl` with an empty basename
> > > 2. Return the type-name and since the basename is empty we end up with 
> > > just the template arguments
> > > 
> > > Why can't we just call `GetTemplateParametersString(die)` instead of 
> > > creating this function?
> > Can confirm that this works locally. Though required moving that function 
> > out of the DWARFASTParserClang, which seems OK
> `GetTemplateParametersString` is specifically only used for 
> `GetCPlusPlusQualifiedName`, which is used below
> ```
>   // For C++, we rely solely upon the one definition rule that says
>   // only one thing can exist at a given decl context. We ignore the
>   // file and line that things are declared on.
>   std::string qualified_name = GetCPlusPlusQualifiedName(die);
> ```
> so it doesn't have to match clang's printing. but for the simple template 
> name stuff, we are comparing clang-generated names, so everything needs to go 
> through clang.
> 
> I've replaced `GetTemplateParametersString` with this code that goes through 
> clang as well
But didn't `GetTemplateParametersString` go through Clang's type printer too? 
Probably missing something.
What would be an example of the difference in output that could arise between 
the new vs. old method?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138834/new/

https://reviews.llvm.org/D138834

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D138724: [lldb][Target] Flush the scratch TypeSystem when process gets deleted

2022-12-03 Thread Michael Buch via Phabricator via lldb-commits
Michael137 updated this revision to Diff 479844.
Michael137 added a comment.

- Rebase
- Reword commit


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138724/new/

https://reviews.llvm.org/D138724

Files:
  lldb/source/Target/Target.cpp
  lldb/test/API/functionalities/rerun_and_expr/Makefile
  lldb/test/API/functionalities/rerun_and_expr/TestRerunAndExpr.py
  lldb/test/API/functionalities/rerun_and_expr/main.cpp
  lldb/test/API/functionalities/rerun_and_expr/rebuild.cpp
  lldb/test/API/functionalities/rerun_and_expr_dylib/Makefile
  lldb/test/API/functionalities/rerun_and_expr_dylib/TestRerunAndExprDylib.py
  lldb/test/API/functionalities/rerun_and_expr_dylib/lib.cpp
  lldb/test/API/functionalities/rerun_and_expr_dylib/main.cpp
  lldb/test/API/functionalities/rerun_and_expr_dylib/rebuild.cpp

Index: lldb/test/API/functionalities/rerun_and_expr_dylib/rebuild.cpp
===
--- /dev/null
+++ lldb/test/API/functionalities/rerun_and_expr_dylib/rebuild.cpp
@@ -0,0 +1,7 @@
+struct Base {
+  int m_base_val = 42;
+};
+
+LLDB_DYLIB_EXPORT struct Foo : public Base {
+  int m_derived_val = 137;
+} global_foo;
Index: lldb/test/API/functionalities/rerun_and_expr_dylib/main.cpp
===
--- /dev/null
+++ lldb/test/API/functionalities/rerun_and_expr_dylib/main.cpp
@@ -0,0 +1,17 @@
+#include 
+#include 
+#include 
+
+extern struct Foo imported;
+
+int main() {
+  // LIB_NAME defined on commandline
+  std::string libname{"./"};
+  libname += LIB_NAME;
+
+  void *handle = dlopen(libname.c_str(), RTLD_NOW);
+  struct Foo *foo = (struct Foo *)dlsym(handle, "global_foo");
+  assert(foo != nullptr);
+
+  return 0;
+}
Index: lldb/test/API/functionalities/rerun_and_expr_dylib/lib.cpp
===
--- /dev/null
+++ lldb/test/API/functionalities/rerun_and_expr_dylib/lib.cpp
@@ -0,0 +1 @@
+LLDB_DYLIB_EXPORT struct Foo { int m_val = 42; } global_foo;
Index: lldb/test/API/functionalities/rerun_and_expr_dylib/TestRerunAndExprDylib.py
===
--- /dev/null
+++ lldb/test/API/functionalities/rerun_and_expr_dylib/TestRerunAndExprDylib.py
@@ -0,0 +1,84 @@
+"""
+Test that re-running a process from within the same target
+after rebuilding the a dynamic library flushes the scratch
+TypeSystems tied to that process.
+"""
+
+import lldb
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+from lldbsuite.test.decorators import *
+
+class TestRerunExprDylib(TestBase):
+@skipIfWindows
+def test(self):
+"""
+Tests whether re-launching a process without destroying
+the owning target keeps invalid ASTContexts in the
+scratch AST's importer.
+
+We test this by:
+1. Evaluating an expression to import 'struct Foo' into
+   the scratch AST
+2. Change the definition of 'struct Foo' and rebuild the dylib
+3. Re-launch the process
+4. Evaluate the same expression in (1). We expect to have only
+   the latest definition of 'struct Foo' in the scratch AST.
+"""
+
+DYLIB_NAME = 'foo'
+FULL_DYLIB_NAME = 'libfoo.dylib' if self.platformIsDarwin() else 'libfoo.so'
+
+# Build libfoo.dylib
+self.build(dictionary={'DYLIB_CXX_SOURCES':'lib.cpp',
+   'DYLIB_ONLY':'YES',
+   'DYLIB_NAME':DYLIB_NAME,
+   'USE_LIBDL':'1',
+   'LD_EXTRAS':'-L.'})
+
+# Build a.out
+self.build(dictionary={'EXE':'a.out',
+   'CXX_SOURCES':'main.cpp',
+   'USE_LIBDL':'1',
+   'CXXFLAGS_EXTRAS':f'-DLIB_NAME=\\"{FULL_DYLIB_NAME}\\"',
+   'LD_EXTRAS':'-L.'})
+
+exe = self.getBuildArtifact("a.out")
+target = self.dbg.CreateTarget(exe) 
+breakpoint = target.BreakpointCreateBySourceRegex('return', lldb.SBFileSpec('main.cpp'))
+process = target.LaunchSimple(None, None, self.get_process_working_directory())  
+
+self.expect_expr('*foo', result_type='Foo', result_children=[
+ValueCheck(name='m_val', value='42')
+])
+
+# Re-build libfoo.dylib
+self.build(dictionary={'DYLIB_CXX_SOURCES':'rebuild.cpp',
+   'DYLIB_ONLY':'YES',
+   'DYLIB_NAME':DYLIB_NAME,
+   'USE_LIBDL':'1',
+   'LD_EXTRAS':'-L.'})
+
+# Rerun program within the same target
+process.Destroy()
+process = target.LaunchSimple(None, None, self.get_process_working_directory())  
+
+self.expect_expr('*foo', result_type='Foo', result_children=[
+V

[Lldb-commits] [lldb] 61cb964 - [lldb] Convert Optional to std::optional

2022-12-03 Thread Fangrui Song via lldb-commits

Author: Fangrui Song
Date: 2022-12-03T18:49:51Z
New Revision: 61cb96404ed27a95df9296460d9920e8c13379e5

URL: 
https://github.com/llvm/llvm-project/commit/61cb96404ed27a95df9296460d9920e8c13379e5
DIFF: 
https://github.com/llvm/llvm-project/commit/61cb96404ed27a95df9296460d9920e8c13379e5.diff

LOG: [lldb] Convert Optional to std::optional

Added: 


Modified: 

lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp

Removed: 




diff  --git 
a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp
 
b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp
index 21a434e650582..d8c6fced0c6ad 100644
--- 
a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp
+++ 
b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp
@@ -92,7 +92,7 @@ bool RenderScriptRuntimeModulePass::runOnModule(llvm::Module 
&module) {
 return false;
   }
 
-  llvm::Optional reloc_model;
+  std::optional reloc_model;
   assert(m_process_ptr && "no available lldb process");
   switch (m_process_ptr->GetTarget().GetArchitecture().GetMachine()) {
   case llvm::Triple::ArchType::x86:



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D114111: Remove a useless temporary of a base class type.

2022-12-03 Thread Alexander Kornienko via Phabricator via lldb-commits
alexfh updated this revision to Diff 479873.
alexfh added a comment.
Herald added a subscriber: Michael137.
Herald added a project: All.

Rebased.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114111/new/

https://reviews.llvm.org/D114111

Files:
  
lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp


Index: 
lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp
===
--- 
lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp
+++ 
lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp
@@ -175,7 +175,6 @@
 namespace lldb_renderscript {
 
 RSIRPasses::RSIRPasses(Process *process) {
-  IRPasses();
   assert(process);
 
   EarlyPasses = std::make_shared();


Index: lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp
===
--- lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp
+++ lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp
@@ -175,7 +175,6 @@
 namespace lldb_renderscript {
 
 RSIRPasses::RSIRPasses(Process *process) {
-  IRPasses();
   assert(process);
 
   EarlyPasses = std::make_shared();
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] c95922c - Remove a useless temporary of a base class type.

2022-12-03 Thread Alexander Kornienko via lldb-commits

Author: Alexander Kornienko
Date: 2022-12-04T00:01:22+01:00
New Revision: c95922c717973889ee669066abfc2e8be07050bf

URL: 
https://github.com/llvm/llvm-project/commit/c95922c717973889ee669066abfc2e8be07050bf
DIFF: 
https://github.com/llvm/llvm-project/commit/c95922c717973889ee669066abfc2e8be07050bf.diff

LOG: Remove a useless temporary of a base class type.

This was found by clang-tidy bugprone-undelegated-constructor check.
Was there since the very first commit back in 2016.

Reviewed By: clayborg, labath, srhines

Differential Revision: https://reviews.llvm.org/D114111

Added: 


Modified: 

lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp

Removed: 




diff  --git 
a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp
 
b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp
index d8c6fced0c6a..39adb42b645c 100644
--- 
a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp
+++ 
b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp
@@ -175,7 +175,6 @@ bool 
RenderScriptRuntime::GetIRPasses(LLVMUserExpression::IRPasses &passes) {
 namespace lldb_renderscript {
 
 RSIRPasses::RSIRPasses(Process *process) {
-  IRPasses();
   assert(process);
 
   EarlyPasses = std::make_shared();



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D114111: Remove a useless temporary of a base class type.

2022-12-03 Thread Alexander Kornienko via Phabricator via lldb-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGc95922c71797: Remove a useless temporary of a base class 
type. (authored by alexfh).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114111/new/

https://reviews.llvm.org/D114111

Files:
  
lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp


Index: 
lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp
===
--- 
lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp
+++ 
lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp
@@ -175,7 +175,6 @@
 namespace lldb_renderscript {
 
 RSIRPasses::RSIRPasses(Process *process) {
-  IRPasses();
   assert(process);
 
   EarlyPasses = std::make_shared();


Index: lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp
===
--- lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp
+++ lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp
@@ -175,7 +175,6 @@
 namespace lldb_renderscript {
 
 RSIRPasses::RSIRPasses(Process *process) {
-  IRPasses();
   assert(process);
 
   EarlyPasses = std::make_shared();
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits