[Lldb-commits] [lldb] aa4b37b - Convert the ThreadPlanCommands test to use a scripted plan

2020-04-10 Thread Jim Ingham via lldb-commits

Author: Jim Ingham
Date: 2020-04-10T18:15:03-07:00
New Revision: aa4b37b2acda8f0879ed5507e1a732c37e6ec5aa

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

LOG: Convert the ThreadPlanCommands test to use a scripted plan
that pushes a step over plan.  Relax the listing checker
so it will look past any entries after the ones listed in
the input patterns.  Then for the internal plans just check
for the StepOver plan that our scripted plan pushes, and look past
any others.

This should make the test more robust on systems that don't use the
step-in then push a step-out plan to step over a function.

Added: 
lldb/test/API/functionalities/thread_plan/wrap_step_over.py

Modified: 
lldb/test/API/functionalities/thread_plan/TestThreadPlanCommands.py

Removed: 




diff  --git 
a/lldb/test/API/functionalities/thread_plan/TestThreadPlanCommands.py 
b/lldb/test/API/functionalities/thread_plan/TestThreadPlanCommands.py
index ddc88cce75f1..ff3b04d49e55 100644
--- a/lldb/test/API/functionalities/thread_plan/TestThreadPlanCommands.py
+++ b/lldb/test/API/functionalities/thread_plan/TestThreadPlanCommands.py
@@ -46,24 +46,7 @@ def check_list_output(self, command, active_plans = [], 
completed_plans = [], di
 self.assertTrue(result.Succeeded(), "command: '%s' failed: 
'%s'"%(command, result.GetError()))
 result_arr = result.GetOutput().splitlines()
 num_results = len(result_arr)
-
-# Match the expected number of elements.
-# Adjust the count for the number of header lines we aren't matching:
-fudge = 0
 
-if num_completed == 0 and num_discarded == 0:
-# The fudge is 3: Thread header, Active Plan header and base plan
-fudge = 3
-elif num_completed == 0 or num_discarded == 0:
-# The fudge is 4: The above plus either the Completed or Discarded 
Plan header:
-fudge = 4
-else:
-# The fudge is 5 since we have both headers:
-fudge = 5
-
-self.assertEqual(num_results, num_active + num_completed + 
num_discarded + fudge,
- "Too many elements in match arrays for: 
\n%s\n"%result.GetOutput())
-
 # Now iterate through the results array and pick out the results.
 result_idx = 0
 self.assertIn("thread #", result_arr[result_idx], "Found thread 
header") ; result_idx += 1
@@ -71,29 +54,47 @@ def check_list_output(self, command, active_plans = [], 
completed_plans = [], di
 self.assertIn("Element 0: Base thread plan", result_arr[result_idx], 
"Found base plan") ; result_idx += 1
 
 for text in active_plans:
-self.assertFalse("Completed plan stack" in result_arr[result_idx], 
"Found Completed header too early.")
 self.assertIn(text, result_arr[result_idx], "Didn't find active 
plan: %s"%(text)) ; result_idx += 1
+
 
 if len(completed_plans) > 0:
-self.assertIn("Completed plan stack:", result_arr[result_idx], 
"Found completed plan stack header") ; result_idx += 1
+# First consume any remaining active plans:
+while not "Completed plan stack:" in result_arr[result_idx]:
+result_idx += 1
+if result_idx == num_results:
+self.fail("There should have been completed plans, but I 
never saw the completed stack header")
+# We are at the Completed header, skip it:
+result_idx += 1
 for text in completed_plans:
 self.assertIn(text, result_arr[result_idx], "Didn't find 
completed plan: %s"%(text)) ; result_idx += 1
 
 if len(discarded_plans) > 0:
-self.assertIn("Discarded plan stack:", result_arr[result_idx], 
"Found discarded plan stack header") ; result_idx += 1
+# First consume any remaining completed plans:
+while not "Discarded plan stack:" in result_arr[result_idx]:
+result_idx += 1
+if result_idx == num_results:
+self.fail("There should have been discarded plans, but I 
never saw the discarded stack header")
+
+# We are at the Discarded header, skip it:
+result_idx += 1
 for text in discarded_plans:
-self.assertIn(text, result_arr[result_idx], "Didn't find 
completed plan: %s"%(text)) ; result_idx += 1
+self.assertIn(text, result_arr[result_idx], "Didn't find 
discarded plan: %s"%(text)) ; result_idx += 1
 
 
 def thread_plan_test(self):
 (target, process, thread, bkpt) = 
lldbutil.run_to_source_breakpoint(self,
"Set a breakpoint here", 
self.main_source_file)
 
-# Now set a breakpoint 

[Lldb-commits] [lldb] f7de4b5 - Thread Plans pushed by a scripted plan should be private plans.

2020-04-10 Thread Jim Ingham via lldb-commits

Author: Jim Ingham
Date: 2020-04-10T18:15:03-07:00
New Revision: f7de4b5d6bce8c33ac3e18a41abcf5268a29f461

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

LOG: Thread Plans pushed by a scripted plan should be private plans.

If a plan is not private, "thread plan discard" can discard it.  It would
not be hard to write reliable scripted plan if its subplans could get
removed out from under it.

Added: 


Modified: 
lldb/source/API/SBThreadPlan.cpp

Removed: 




diff  --git a/lldb/source/API/SBThreadPlan.cpp 
b/lldb/source/API/SBThreadPlan.cpp
index b93c31763e59..1a947bbc2608 100644
--- a/lldb/source/API/SBThreadPlan.cpp
+++ b/lldb/source/API/SBThreadPlan.cpp
@@ -237,7 +237,9 @@ SBThreadPlan SBThreadPlan::QueueThreadPlanForStepOverRange(
 
 if (plan_status.Fail())
   error.SetErrorString(plan_status.AsCString());
-
+else
+  plan.m_opaque_sp->SetPrivate(true);
+
 return LLDB_RECORD_RESULT(plan);
   } else {
 return LLDB_RECORD_RESULT(SBThreadPlan());
@@ -281,6 +283,8 @@ SBThreadPlan::QueueThreadPlanForStepInRange(SBAddress 
_start_address,
 
 if (plan_status.Fail())
   error.SetErrorString(plan_status.AsCString());
+else
+  plan.m_opaque_sp->SetPrivate(true);
 
 return LLDB_RECORD_RESULT(plan);
   } else {
@@ -321,6 +325,8 @@ SBThreadPlan::QueueThreadPlanForStepOut(uint32_t 
frame_idx_to_step_to,
 
 if (plan_status.Fail())
   error.SetErrorString(plan_status.AsCString());
+else
+  plan.m_opaque_sp->SetPrivate(true);
 
 return LLDB_RECORD_RESULT(plan);
   } else {
@@ -356,6 +362,8 @@ SBThreadPlan 
SBThreadPlan::QueueThreadPlanForRunToAddress(SBAddress sb_address,
 
 if (plan_status.Fail())
   error.SetErrorString(plan_status.AsCString());
+else
+  plan.m_opaque_sp->SetPrivate(true);
 
 return LLDB_RECORD_RESULT(plan);
   } else {
@@ -390,6 +398,8 @@ SBThreadPlan::QueueThreadPlanForStepScripted(const char 
*script_class_name,
 
 if (plan_status.Fail())
   error.SetErrorString(plan_status.AsCString());
+else
+  plan.m_opaque_sp->SetPrivate(true);
 
 return LLDB_RECORD_RESULT(plan);
   } else {
@@ -415,6 +425,8 @@ SBThreadPlan::QueueThreadPlanForStepScripted(const char 
*script_class_name,
 
 if (plan_status.Fail())
   error.SetErrorString(plan_status.AsCString());
+else
+  plan.m_opaque_sp->SetPrivate(true);
 
 return LLDB_RECORD_RESULT(plan);
   } else {



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


[Lldb-commits] [PATCH] D77452: [intel-pt] Improve the way the test determines whether to run

2020-04-10 Thread walter erquinigo via Phabricator via lldb-commits
wallace updated this revision to Diff 256715.
wallace edited the summary of this revision.
wallace removed a reviewer: JDevlieghere.
wallace removed a subscriber: JDevlieghere.
wallace added a comment.
Herald added a subscriber: mgorny.

Addressed comments. The diff description now reflects the latest changes.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77452

Files:
  lldb/packages/Python/lldbsuite/test/configuration.py
  lldb/packages/Python/lldbsuite/test/dotest.py
  lldb/packages/Python/lldbsuite/test/dotest_args.py
  lldb/packages/Python/lldbsuite/test/lldbtest.py
  lldb/test/API/lit.cfg.py
  lldb/test/API/lit.site.cfg.py.in
  lldb/test/API/tools/intel-features/intel-pt/test/TestIntelPTSimpleBinary.py
  lldb/test/CMakeLists.txt
  lldb/utils/lldb-dotest/CMakeLists.txt
  lldb/utils/lldb-dotest/lldb-dotest.in

Index: lldb/utils/lldb-dotest/lldb-dotest.in
===
--- lldb/utils/lldb-dotest/lldb-dotest.in
+++ lldb/utils/lldb-dotest/lldb-dotest.in
@@ -11,6 +11,7 @@
 dsymutil = '@LLDB_TEST_DSYMUTIL_CONFIGURED@'
 filecheck = '@LLDB_TEST_FILECHECK_CONFIGURED@'
 lldb_libs_dir = "@LLDB_LIBS_DIR_CONFIGURED@"
+lldb_build_intel_pt = "@LLDB_BUILD_INTEL_PT@"
 
 if __name__ == '__main__':
 wrapper_args = sys.argv[1:]
@@ -25,7 +26,11 @@
 cmd.extend(['--dsymutil', dsymutil])
 cmd.extend(['--filecheck', filecheck])
 cmd.extend(['--lldb-libs-dir', lldb_libs_dir])
+if lldb_build_intel_pt == "1":
+cmd.extend(['--enable-plugin', 'intel-pt'])
+
 cmd.extend(wrapper_args)
+
 # Invoke dotest.py and return exit code.
 print(' '.join(cmd))
 sys.exit(subprocess.call(cmd))
Index: lldb/utils/lldb-dotest/CMakeLists.txt
===
--- lldb/utils/lldb-dotest/CMakeLists.txt
+++ lldb/utils/lldb-dotest/CMakeLists.txt
@@ -6,6 +6,10 @@
 get_property(LLDB_DOTEST_ARGS GLOBAL PROPERTY LLDB_DOTEST_ARGS_PROPERTY)
 set(LLDB_LIBS_DIR "${LLVM_LIBRARY_OUTPUT_INTDIR}")
 
+llvm_canonicalize_cmake_booleans(
+  LLDB_BUILD_INTEL_PT
+)
+
 # Generate lldb-dotest Python driver script for each build mode.
 if(LLDB_BUILT_STANDALONE)
   set(config_types ".")
Index: lldb/test/CMakeLists.txt
===
--- lldb/test/CMakeLists.txt
+++ lldb/test/CMakeLists.txt
@@ -158,6 +158,7 @@
 
 # These values are not canonicalized within LLVM.
 llvm_canonicalize_cmake_booleans(
+  LLDB_BUILD_INTEL_PT
   LLDB_ENABLE_PYTHON
   LLDB_ENABLE_LUA
   LLDB_ENABLE_LZMA
Index: lldb/test/API/tools/intel-features/intel-pt/test/TestIntelPTSimpleBinary.py
===
--- lldb/test/API/tools/intel-features/intel-pt/test/TestIntelPTSimpleBinary.py
+++ lldb/test/API/tools/intel-features/intel-pt/test/TestIntelPTSimpleBinary.py
@@ -12,24 +12,22 @@
 class TestIntelPTSimpleBinary(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
+plugin = 'intel-pt'
 NO_DEBUG_INFO_TESTCASE = True
 
+def setUp(self):
+TestBase.setUp(self)
+
+plugin_path = os.path.join(os.environ["LLDB_IMPLIB_DIR"], "liblldbIntelFeatures.so")
+self.runCmd("plugin load " + plugin_path)
+
 @skipIf(oslist=no_match(['linux']))
 @skipIf(archs=no_match(['i386', 'x86_64']))
 @skipIfRemote
 def test_basic_flow(self):
 """Test collection, decoding, and dumping instructions"""
-if os.environ.get('TEST_INTEL_PT') != '1':
-self.skipTest("The environment variable TEST_INTEL_PT=1 is needed to run this test.")
-
-lldb_exec_dir = os.environ["LLDB_IMPLIB_DIR"]
-lldb_lib_dir = os.path.join(lldb_exec_dir, os.pardir, "lib")
-plugin_file = os.path.join(lldb_lib_dir, "liblldbIntelFeatures.so")
 
 self.build()
-
-self.runCmd("plugin load " + plugin_file)
-
 exe = self.getBuildArtifact("a.out")
 lldbutil.run_to_name_breakpoint(self, "main", exe_name=exe)
 # We start tracing from main
@@ -52,9 +50,9 @@
 self.expect("processor-trace show-instr-log -c 100",
 patterns=[
 # We expect to have seen the first instruction of 'fun'
-hex(fun_start_adddress),  
+hex(fun_start_adddress),
 # We expect to see the exit condition of the for loop
-"at main.cpp:" + str(line_number('main.cpp', '// Break for loop')) 
+"at main.cpp:" + str(line_number('main.cpp', '// Break for loop'))
 ])
 
 self.runCmd("processor-trace stop")
Index: lldb/test/API/lit.site.cfg.py.in
===
--- lldb/test/API/lit.site.cfg.py.in
+++ lldb/test/API/lit.site.cfg.py.in
@@ -32,6 +32,11 @@
 config.lldb_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_LLDB@", "lldb-api")
 config.clang_module_cache 

[Lldb-commits] [PATCH] D77452: [intel-pt] Improve the way the test determines whether to run

2020-04-10 Thread walter erquinigo via Phabricator via lldb-commits
wallace updated this revision to Diff 256716.
wallace added a comment.

remove blank line


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77452

Files:
  lldb/packages/Python/lldbsuite/test/configuration.py
  lldb/packages/Python/lldbsuite/test/dotest.py
  lldb/packages/Python/lldbsuite/test/dotest_args.py
  lldb/packages/Python/lldbsuite/test/lldbtest.py
  lldb/test/API/lit.cfg.py
  lldb/test/API/lit.site.cfg.py.in
  lldb/test/API/tools/intel-features/intel-pt/test/TestIntelPTSimpleBinary.py
  lldb/test/CMakeLists.txt
  lldb/utils/lldb-dotest/CMakeLists.txt
  lldb/utils/lldb-dotest/lldb-dotest.in

Index: lldb/utils/lldb-dotest/lldb-dotest.in
===
--- lldb/utils/lldb-dotest/lldb-dotest.in
+++ lldb/utils/lldb-dotest/lldb-dotest.in
@@ -11,6 +11,7 @@
 dsymutil = '@LLDB_TEST_DSYMUTIL_CONFIGURED@'
 filecheck = '@LLDB_TEST_FILECHECK_CONFIGURED@'
 lldb_libs_dir = "@LLDB_LIBS_DIR_CONFIGURED@"
+lldb_build_intel_pt = "@LLDB_BUILD_INTEL_PT@"
 
 if __name__ == '__main__':
 wrapper_args = sys.argv[1:]
@@ -25,6 +26,8 @@
 cmd.extend(['--dsymutil', dsymutil])
 cmd.extend(['--filecheck', filecheck])
 cmd.extend(['--lldb-libs-dir', lldb_libs_dir])
+if lldb_build_intel_pt == "1":
+cmd.extend(['--enable-plugin', 'intel-pt'])
 cmd.extend(wrapper_args)
 # Invoke dotest.py and return exit code.
 print(' '.join(cmd))
Index: lldb/utils/lldb-dotest/CMakeLists.txt
===
--- lldb/utils/lldb-dotest/CMakeLists.txt
+++ lldb/utils/lldb-dotest/CMakeLists.txt
@@ -6,6 +6,10 @@
 get_property(LLDB_DOTEST_ARGS GLOBAL PROPERTY LLDB_DOTEST_ARGS_PROPERTY)
 set(LLDB_LIBS_DIR "${LLVM_LIBRARY_OUTPUT_INTDIR}")
 
+llvm_canonicalize_cmake_booleans(
+  LLDB_BUILD_INTEL_PT
+)
+
 # Generate lldb-dotest Python driver script for each build mode.
 if(LLDB_BUILT_STANDALONE)
   set(config_types ".")
Index: lldb/test/CMakeLists.txt
===
--- lldb/test/CMakeLists.txt
+++ lldb/test/CMakeLists.txt
@@ -158,6 +158,7 @@
 
 # These values are not canonicalized within LLVM.
 llvm_canonicalize_cmake_booleans(
+  LLDB_BUILD_INTEL_PT
   LLDB_ENABLE_PYTHON
   LLDB_ENABLE_LUA
   LLDB_ENABLE_LZMA
Index: lldb/test/API/tools/intel-features/intel-pt/test/TestIntelPTSimpleBinary.py
===
--- lldb/test/API/tools/intel-features/intel-pt/test/TestIntelPTSimpleBinary.py
+++ lldb/test/API/tools/intel-features/intel-pt/test/TestIntelPTSimpleBinary.py
@@ -12,24 +12,22 @@
 class TestIntelPTSimpleBinary(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
+plugin = 'intel-pt'
 NO_DEBUG_INFO_TESTCASE = True
 
+def setUp(self):
+TestBase.setUp(self)
+
+plugin_path = os.path.join(os.environ["LLDB_IMPLIB_DIR"], "liblldbIntelFeatures.so")
+self.runCmd("plugin load " + plugin_path)
+
 @skipIf(oslist=no_match(['linux']))
 @skipIf(archs=no_match(['i386', 'x86_64']))
 @skipIfRemote
 def test_basic_flow(self):
 """Test collection, decoding, and dumping instructions"""
-if os.environ.get('TEST_INTEL_PT') != '1':
-self.skipTest("The environment variable TEST_INTEL_PT=1 is needed to run this test.")
-
-lldb_exec_dir = os.environ["LLDB_IMPLIB_DIR"]
-lldb_lib_dir = os.path.join(lldb_exec_dir, os.pardir, "lib")
-plugin_file = os.path.join(lldb_lib_dir, "liblldbIntelFeatures.so")
 
 self.build()
-
-self.runCmd("plugin load " + plugin_file)
-
 exe = self.getBuildArtifact("a.out")
 lldbutil.run_to_name_breakpoint(self, "main", exe_name=exe)
 # We start tracing from main
@@ -52,9 +50,9 @@
 self.expect("processor-trace show-instr-log -c 100",
 patterns=[
 # We expect to have seen the first instruction of 'fun'
-hex(fun_start_adddress),  
+hex(fun_start_adddress),
 # We expect to see the exit condition of the for loop
-"at main.cpp:" + str(line_number('main.cpp', '// Break for loop')) 
+"at main.cpp:" + str(line_number('main.cpp', '// Break for loop'))
 ])
 
 self.runCmd("processor-trace stop")
Index: lldb/test/API/lit.site.cfg.py.in
===
--- lldb/test/API/lit.site.cfg.py.in
+++ lldb/test/API/lit.site.cfg.py.in
@@ -32,6 +32,11 @@
 config.lldb_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_LLDB@", "lldb-api")
 config.clang_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_CLANG@", "lldb-api")
 
+# Plugins
+lldb_build_intel_pt = '@LLDB_BUILD_INTEL_PT@'
+if lldb_build_intel_pt == '1':
+config.enabled_plugins = ['intel-pt']
+
 # Additional dotest arguments can be passed to lit by providing 

[Lldb-commits] [lldb] f78fcd6 - [lldb/Test] Rewrite ReproducerInstrumentationTest

2020-04-10 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2020-04-10T16:50:44-07:00
New Revision: f78fcd6906a032bf5feb0e60c9e8991bf31e990e

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

LOG: [lldb/Test] Rewrite ReproducerInstrumentationTest

The instrumentation unit tests' current implementation uses global
variables to track constructor calls for the instrumented classes during
replay. This is suboptimal because it indirectly relies on how the
reproducer instrumentation is implemented. I found out when adding
support for passive replay and the test broke because we made an extra
(temporary) copy of the instrumented objects.

Additionally, the old approach wasn't very self-explanatory. It took me
a bit of time to understand why we were expecting the number of objects
in the test.

This patch rewrites the test and uses the index-to-object-mapping to
verify the objects created during replay. You can now specify the
expected objects, in order, and whether they should be valid or not. I
find that it makes the tests much easier to understand. More
importantly, this approach is resilient to implementation detail changes
in the instrumentation.

Added: 


Modified: 
lldb/include/lldb/Utility/ReproducerInstrumentation.h
lldb/source/Utility/ReproducerInstrumentation.cpp
lldb/unittests/Utility/ReproducerInstrumentationTest.cpp

Removed: 




diff  --git a/lldb/include/lldb/Utility/ReproducerInstrumentation.h 
b/lldb/include/lldb/Utility/ReproducerInstrumentation.h
index 2246267b62f0..1eae930da5ce 100644
--- a/lldb/include/lldb/Utility/ReproducerInstrumentation.h
+++ b/lldb/include/lldb/Utility/ReproducerInstrumentation.h
@@ -255,6 +255,9 @@ class IndexToObject {
  const_cast::type *>()));
   }
 
+  /// Get all objects sorted by their index.
+  std::vector GetAllObjects() const;
+
 private:
   /// Helper method that does the actual lookup. The void* result is later cast
   /// by the caller.
@@ -345,6 +348,10 @@ class Deserializer {
 (void)result;
   }
 
+  std::vector GetAllObjects() const {
+return m_index_to_object.GetAllObjects();
+  }
+
 private:
   template  T Read(ValueTag) {
 assert(HasData(sizeof(T)));
@@ -512,6 +519,9 @@ class Registry {
   /// Replay functions from a buffer.
   bool Replay(llvm::StringRef buffer);
 
+  /// Replay functions from a deserializer.
+  bool Replay(Deserializer );
+
   /// Returns the ID for a given function address.
   unsigned GetID(uintptr_t addr);
 

diff  --git a/lldb/source/Utility/ReproducerInstrumentation.cpp 
b/lldb/source/Utility/ReproducerInstrumentation.cpp
index 3bf81286bbe9..ec66da9973ae 100644
--- a/lldb/source/Utility/ReproducerInstrumentation.cpp
+++ b/lldb/source/Utility/ReproducerInstrumentation.cpp
@@ -24,6 +24,25 @@ void IndexToObject::AddObjectForIndexImpl(unsigned idx, void 
*object) {
   m_mapping[idx] = object;
 }
 
+std::vector IndexToObject::GetAllObjects() const {
+  std::vector> pairs;
+  for (auto  : m_mapping) {
+pairs.emplace_back(e.first, e.second);
+  }
+
+  // Sort based on index.
+  std::sort(pairs.begin(), pairs.end(),
+[](auto , auto ) { return lhs.first < rhs.first; });
+
+  std::vector objects;
+  objects.reserve(pairs.size());
+  for (auto  : pairs) {
+objects.push_back(p.second);
+  }
+
+  return objects;
+}
+
 template <> const uint8_t *Deserializer::Deserialize() {
   return Deserialize();
 }
@@ -74,6 +93,11 @@ bool Registry::Replay(const FileSpec ) {
 }
 
 bool Registry::Replay(llvm::StringRef buffer) {
+  Deserializer deserializer(buffer);
+  return Replay(deserializer);
+}
+
+bool Registry::Replay(Deserializer ) {
 #ifndef LLDB_REPRO_INSTR_TRACE
   Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_API);
 #endif
@@ -82,7 +106,6 @@ bool Registry::Replay(llvm::StringRef buffer) {
   // during an interactive session.
   setvbuf(stdout, nullptr, _IONBF, 0);
 
-  Deserializer deserializer(buffer);
   while (deserializer.HasData(1)) {
 unsigned id = deserializer.Deserialize();
 

diff  --git a/lldb/unittests/Utility/ReproducerInstrumentationTest.cpp 
b/lldb/unittests/Utility/ReproducerInstrumentationTest.cpp
index 490d188c83b7..d4b41d55967f 100644
--- a/lldb/unittests/Utility/ReproducerInstrumentationTest.cpp
+++ b/lldb/unittests/Utility/ReproducerInstrumentationTest.cpp
@@ -54,9 +54,22 @@ static llvm::Optional g_serializer;
 static llvm::Optional g_registry;
 
 #define LLDB_GET_INSTRUMENTATION_DATA()
\
-  g_serializer ? InstrumentationData(*g_serializer, *g_registry) : 
InstrumentationData()
+  g_serializer ? InstrumentationData(*g_serializer, *g_registry)   
\
+   : InstrumentationData()
 
-class InstrumentedFoo {
+enum class Class {
+  Foo,
+  Bar,
+};
+
+class Instrumented {
+public:
+  virtual ~Instrumented() 

[Lldb-commits] [PATCH] D77790: [NFC] Add a test for the inferior memory cache (mainly L1)

2020-04-10 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment.

In D77790#1974047 , @jarin wrote:

> Regarding the callback idea, I have bad experience with callbacks because 
> they break if the code is not crafted for re-entrancy and they are much 
> harder to understand. That change feels out of scope for just adding a test 
> and fixing an unrelated bug.


The code is already there and working. Not sure what the worry about 
re-entrancy is from?

> Adding the SetCacheLineSize method sounds good, but if we want to keep this 
> patch making NFC (which is what I would prefer), it would have to be called 
> at exactly the same places as Clear. How about Pavel's idea to rename Clear 
> -> Reset, and leave the refactoring to SetCacheLineSize for later?

We are changing the code so that just to make it NFC we have to check it in 
some half baked state? I don't agree with this. Clear() didn't take a parameter 
before, nor should it have to now.

> It appears it is really hard to reach agreement about this, so another 
> alternative is I submit a bug report about the L1 
>  invalidation problem and leave it to you to 
> figure this out. In the mean time, we will fix the bug only in our private 
> fork of lldb. Greg, perhaps you would prefer that?

I don't see this as really that hard to fix correctly. Feel free to do what you 
need to if this is too much.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77790



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


[Lldb-commits] [PATCH] D76471: Remap the target SDK directory to the host SDK directory

2020-04-10 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl marked an inline comment as done.
aprantl added inline comments.



Comment at: lldb/source/Utility/XcodeSDK.cpp:72
+  llvm::VersionTuple version = ParseSDKVersion(input);
+  return {sdk, version};
+}

sylvestre.ledru wrote:
> With older version of the libcstdc++ (some Ubuntu LTS), it fails with:
> 
> ```
>  error: chosen constructor is explicit in copy-initialization
>   return {sdk, version};
>  ^~
> /usr/lib/gcc/i686-linux-gnu/5.3.1/../../../../include/c++/5.3.1/tuple:612:19: 
> note: explicit constructor declared here
> constexpr tuple(_U1&& __a1, _U2&& __a2)
> ```
> 
> @aprantl  Could you please have a look ? 
I have made an attempt in f5be71b4450, but if that doesn't work, I'll need some 
help since I don't really know what works and doesn't work on that particular 
platform.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76471



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


[Lldb-commits] [PATCH] D77662: [lldb/test] Make TestLoadUnload compatible with windows

2020-04-10 Thread Saleem Abdulrasool via Phabricator via lldb-commits
compnerd added a comment.

@labath - can this get merged so that I can rebase and get D77287 
 merged?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77662



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


[Lldb-commits] [lldb] f5be71b - Attempt to fix a compile error reported with older compilers and libstdc++

2020-04-10 Thread Adrian Prantl via lldb-commits

Author: Adrian Prantl
Date: 2020-04-10T10:34:44-07:00
New Revision: f5be71b44500b18d636b1f540422dda4012ac192

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

LOG: Attempt to fix a compile error reported with older compilers and libstdc++

Added: 


Modified: 
lldb/source/Utility/XcodeSDK.cpp

Removed: 




diff  --git a/lldb/source/Utility/XcodeSDK.cpp 
b/lldb/source/Utility/XcodeSDK.cpp
index f2403f10de55..7ad0090f85e2 100644
--- a/lldb/source/Utility/XcodeSDK.cpp
+++ b/lldb/source/Utility/XcodeSDK.cpp
@@ -69,7 +69,8 @@ std::tuple 
XcodeSDK::Parse() const {
   llvm::StringRef input(m_name);
   XcodeSDK::Type sdk = ParseSDKName(input);
   llvm::VersionTuple version = ParseSDKVersion(input);
-  return {sdk, version};
+  return std::make_tuple(
+  std::move(sdk), std::move(version));
 }
 
 llvm::VersionTuple XcodeSDK::GetVersion() const {



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


[Lldb-commits] [lldb] 02d152b - [lldb] Make some asserts in TestFixIts more expressive

2020-04-10 Thread Raphael Isemann via lldb-commits

Author: Raphael Isemann
Date: 2020-04-10T19:16:33+02:00
New Revision: 02d152bb1b63e1f5ebdf502a8b8c8c99103a5e75

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

LOG: [lldb] Make some asserts in TestFixIts more expressive

Added: 


Modified: 
lldb/test/API/commands/expression/fixits/TestFixIts.py

Removed: 




diff  --git a/lldb/test/API/commands/expression/fixits/TestFixIts.py 
b/lldb/test/API/commands/expression/fixits/TestFixIts.py
index 4f1d974c753b..9ce5415b732e 100644
--- a/lldb/test/API/commands/expression/fixits/TestFixIts.py
+++ b/lldb/test/API/commands/expression/fixits/TestFixIts.py
@@ -20,8 +20,8 @@ def test_with_dummy_target(self):
 
 ret_val = lldb.SBCommandReturnObject()
 result = self.dbg.GetCommandInterpreter().HandleCommand("expression 
((1 << 16) - 1))", ret_val)
-self.assertEqual(result, lldb.eReturnStatusSuccessFinishResult, "The 
expression was successful.")
-self.assertTrue("Fix-it applied" in ret_val.GetError(), "Found the 
applied FixIt.")
+self.assertEqual(result, lldb.eReturnStatusSuccessFinishResult, 
ret_val.GetError())
+self.assertIn("Fix-it applied", ret_val.GetError())
 
 def test_with_target(self):
 """Test calling expressions with errors that can be fixed by the 
FixIts."""



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


[Lldb-commits] [PATCH] D77878: [lldb] Fix a typo in a test name

2020-04-10 Thread walter erquinigo via Phabricator via lldb-commits
wallace created this revision.
wallace added reviewers: labath, clayborg.
Herald added subscribers: lldb-commits, mgorny.
Herald added a project: LLDB.

Removing the Test prefix from the file name and its usages. The standard is 
using only Test as a suffix.
This was correctly pointed out in https://reviews.llvm.org/D77444.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D77878

Files:
  lldb/unittests/API/CMakeLists.txt
  lldb/unittests/API/SBCommandInterpreterTest.cpp
  lldb/unittests/API/TestSBCommandInterpreterTest.cpp


Index: lldb/unittests/API/SBCommandInterpreterTest.cpp
===
--- lldb/unittests/API/SBCommandInterpreterTest.cpp
+++ lldb/unittests/API/SBCommandInterpreterTest.cpp
@@ -1,4 +1,4 @@
-//===-- TestSBCommandInterpreterTest.cpp 
--===//
+//===-- SBCommandInterpreterTest.cpp ===--===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -17,7 +17,7 @@
 
 using namespace lldb;
 
-class TestSBCommandInterpreterTest : public testing::Test {
+class SBCommandInterpreterTest : public testing::Test {
 protected:
   void SetUp() override {
 SBDebugger::Initialize();
@@ -44,7 +44,7 @@
   std::string m_message;
 };
 
-TEST_F(TestSBCommandInterpreterTest, SingleWordCommand) {
+TEST_F(SBCommandInterpreterTest, SingleWordCommand) {
   // We first test a command without autorepeat
   DummyCommand dummy("It worked");
   m_interp.AddCommand("dummy", , /*help=*/nullptr);
@@ -79,7 +79,7 @@
   }
 }
 
-TEST_F(TestSBCommandInterpreterTest, MultiWordCommand) {
+TEST_F(SBCommandInterpreterTest, MultiWordCommand) {
   auto command = m_interp.AddMultiwordCommand("multicommand", 
/*help=*/nullptr);
   // We first test a subcommand without autorepeat
   DummyCommand subcommand("It worked again");
Index: lldb/unittests/API/CMakeLists.txt
===
--- lldb/unittests/API/CMakeLists.txt
+++ lldb/unittests/API/CMakeLists.txt
@@ -1,5 +1,5 @@
 add_lldb_unittest(APITests
-  TestSBCommandInterpreterTest.cpp
+  SBCommandInterpreterTest.cpp
 
   LINK_LIBS
 liblldb


Index: lldb/unittests/API/SBCommandInterpreterTest.cpp
===
--- lldb/unittests/API/SBCommandInterpreterTest.cpp
+++ lldb/unittests/API/SBCommandInterpreterTest.cpp
@@ -1,4 +1,4 @@
-//===-- TestSBCommandInterpreterTest.cpp --===//
+//===-- SBCommandInterpreterTest.cpp ===--===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -17,7 +17,7 @@
 
 using namespace lldb;
 
-class TestSBCommandInterpreterTest : public testing::Test {
+class SBCommandInterpreterTest : public testing::Test {
 protected:
   void SetUp() override {
 SBDebugger::Initialize();
@@ -44,7 +44,7 @@
   std::string m_message;
 };
 
-TEST_F(TestSBCommandInterpreterTest, SingleWordCommand) {
+TEST_F(SBCommandInterpreterTest, SingleWordCommand) {
   // We first test a command without autorepeat
   DummyCommand dummy("It worked");
   m_interp.AddCommand("dummy", , /*help=*/nullptr);
@@ -79,7 +79,7 @@
   }
 }
 
-TEST_F(TestSBCommandInterpreterTest, MultiWordCommand) {
+TEST_F(SBCommandInterpreterTest, MultiWordCommand) {
   auto command = m_interp.AddMultiwordCommand("multicommand", /*help=*/nullptr);
   // We first test a subcommand without autorepeat
   DummyCommand subcommand("It worked again");
Index: lldb/unittests/API/CMakeLists.txt
===
--- lldb/unittests/API/CMakeLists.txt
+++ lldb/unittests/API/CMakeLists.txt
@@ -1,5 +1,5 @@
 add_lldb_unittest(APITests
-  TestSBCommandInterpreterTest.cpp
+  SBCommandInterpreterTest.cpp
 
   LINK_LIBS
 liblldb
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] a0c6ebd - [lldb] Refactor TestFixIts so that most of it can run on aarch64-linux

2020-04-10 Thread Raphael Isemann via lldb-commits

Author: Raphael Isemann
Date: 2020-04-10T13:38:45+02:00
New Revision: a0c6ebd58fabd4d42fce2233ee4c28e7febfe62f

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

LOG: [lldb] Refactor TestFixIts so that most of it can run on aarch64-linux

The final function call to `test_X` is failing on aarch64-linux with SIGILL.
Function calls to previous expressions seem to just not work on aarch64-linux
but I don't see another way to test the multiple-run Fix-Its.

This patch refactors the test that the skipIf for aarch64 Linux only covers
the part of the test that was added D77214.

Added: 


Modified: 
lldb/test/API/commands/expression/fixits/TestFixIts.py

Removed: 




diff  --git a/lldb/test/API/commands/expression/fixits/TestFixIts.py 
b/lldb/test/API/commands/expression/fixits/TestFixIts.py
index b348e2dca2cc..4f1d974c753b 100644
--- a/lldb/test/API/commands/expression/fixits/TestFixIts.py
+++ b/lldb/test/API/commands/expression/fixits/TestFixIts.py
@@ -23,7 +23,6 @@ def test_with_dummy_target(self):
 self.assertEqual(result, lldb.eReturnStatusSuccessFinishResult, "The 
expression was successful.")
 self.assertTrue("Fix-it applied" in ret_val.GetError(), "Found the 
applied FixIt.")
 
-@expectedFailureAll(archs=["aarch64"], oslist=["linux"])
 def test_with_target(self):
 """Test calling expressions with errors that can be fixed by the 
FixIts."""
 self.build()
@@ -83,12 +82,22 @@ def test_with_target(self):
 error_string.find("my_pointer->second.a") != -1,
 "Fix was right")
 
+# The final function call runs into SIGILL on aarch64-linux.
+@expectedFailureAll(archs=["aarch64"], oslist=["linux"])
+def test_with_multiple_retries(self):
+"""Test calling expressions with errors that can be fixed by the 
FixIts."""
+self.build()
+(target, process, self.thread, bkpt) = 
lldbutil.run_to_source_breakpoint(self,
+'Stop here to evaluate expressions',
+ lldb.SBFileSpec("main.cpp"))
 
 # Test repeatedly applying Fix-Its to expressions and reparsing them.
 multiple_runs_options = lldb.SBExpressionOptions()
 multiple_runs_options.SetAutoApplyFixIts(True)
 multiple_runs_options.SetTopLevel(True)
 
+frame = self.thread.GetFrameAtIndex(0)
+
 # An expression that needs two parse attempts with one Fix-It each
 # to be successfully parsed.
 two_runs_expr = """



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


[Lldb-commits] [PATCH] D77790: [NFC] Add a test for the inferior memory cache (mainly L1)

2020-04-10 Thread Jaroslav Sevcik via Phabricator via lldb-commits
jarin added a comment.

Regarding the callback idea, I have bad experience with callbacks because they 
break if the code is not crafted for re-entrancy and they are much harder to 
understand. That change feels out of scope for just adding a test and fixing an 
unrelated bug.

Adding the SetCacheLineSize method sounds good, but if we want to keep this 
patch making NFC (which is what I would prefer), it would have to be called at 
exactly the same places as Clear. How about Pavel's idea to rename Clear -> 
Reset, and leave the refactoring to SetCacheLineSize for later?

It appears it is really hard to reach agreement about this, so another 
alternative is I submit a bug report about the L1  
invalidation problem and leave it to you to figure this out. In the mean time, 
we will fix the bug only in our private fork of lldb. Greg, perhaps you would 
prefer that?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77790



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


[Lldb-commits] [PATCH] D77842: Fix setting Python3_ROOT_DIR on Windows

2020-04-10 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor accepted this revision.
teemperor added a comment.
This revision is now accepted and ready to land.

LGTM, PYTHON_HOME is apparently the Windows way we allow people to specify the 
python root when finding the package.

Please update the review description though with why this change was done that 
this isn't just documented in the comments here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77842



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


[Lldb-commits] [PATCH] D76471: Remap the target SDK directory to the host SDK directory

2020-04-10 Thread Sylvestre Ledru via Phabricator via lldb-commits
sylvestre.ledru added inline comments.



Comment at: lldb/source/Utility/XcodeSDK.cpp:72
+  llvm::VersionTuple version = ParseSDKVersion(input);
+  return {sdk, version};
+}

With older version of the libcstdc++ (some Ubuntu LTS), it fails with:

```
 error: chosen constructor is explicit in copy-initialization
  return {sdk, version};
 ^~
/usr/lib/gcc/i686-linux-gnu/5.3.1/../../../../include/c++/5.3.1/tuple:612:19: 
note: explicit constructor declared here
constexpr tuple(_U1&& __a1, _U2&& __a2)
```

@aprantl  Could you please have a look ? 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76471



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


[Lldb-commits] [PATCH] D77587: [SVE] Add new VectorType subclasses

2020-04-10 Thread Christopher Tetreault via Phabricator via lldb-commits
ctetreau marked 2 inline comments as done.
ctetreau added inline comments.



Comment at: llvm/include/llvm/IR/DerivedTypes.h:436
+
+  static VectorType *get(Type *ElementType, const VectorType *Other) {
+return VectorType::get(ElementType, Other->getElementCount());

sdesmalen wrote:
> Do you need the method on line 432 if you have this one (that takes a `const 
> VectorType *Other`) ?
It shouldn't be needed, I'll remove it.



Comment at: llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1109
   for (unsigned i = 0; i < numElems; ++i)
 Result.AggregateVal[i].FloatVal = *((float*)Ptr+i);
 }

sdesmalen wrote:
> This code doesn't really work for scalable vectors. Assuming you don't want 
> to change that in this patch, Is it worth putting a FIXME here?
This will have to be changed when getNumElements() moves into FixedVectorType. 
I'll get it then.

Likely, the plan will be to just have the scalable vector branch assert. My 
overall strategy is to just assume all calls to getNumElements are correct, 
cast to FixedVectorType instead of VectorType, and just fix enough to make the 
tests pass.

There's a lot of code that calls getNumElements, and the overall goal is to 
force everybody to clean their own houses.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77587



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


[Lldb-commits] [PATCH] D77587: [SVE] Add new VectorType subclasses

2020-04-10 Thread Sander de Smalen via Phabricator via lldb-commits
sdesmalen added a comment.

Thanks for this patch @ctetreau! Overall looks great to me, just two little 
nits.




Comment at: llvm/include/llvm/IR/DerivedTypes.h:436
+
+  static VectorType *get(Type *ElementType, const VectorType *Other) {
+return VectorType::get(ElementType, Other->getElementCount());

Do you need the method on line 432 if you have this one (that takes a `const 
VectorType *Other`) ?



Comment at: llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1109
   for (unsigned i = 0; i < numElems; ++i)
 Result.AggregateVal[i].FloatVal = *((float*)Ptr+i);
 }

This code doesn't really work for scalable vectors. Assuming you don't want to 
change that in this patch, Is it worth putting a FIXME here?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77587



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


[Lldb-commits] [PATCH] D77587: [SVE] Add new VectorType subclasses

2020-04-10 Thread Christopher Tetreault via Phabricator via lldb-commits
ctetreau updated this revision to Diff 256435.
ctetreau added a comment.

address code review issues


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77587

Files:
  lldb/source/Expression/IRInterpreter.cpp
  llvm/include/llvm-c/Core.h
  llvm/include/llvm/IR/DataLayout.h
  llvm/include/llvm/IR/DerivedTypes.h
  llvm/include/llvm/IR/Type.h
  llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
  llvm/lib/CodeGen/ValueTypes.cpp
  llvm/lib/ExecutionEngine/ExecutionEngine.cpp
  llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
  llvm/lib/IR/AsmWriter.cpp
  llvm/lib/IR/Constants.cpp
  llvm/lib/IR/Core.cpp
  llvm/lib/IR/DataLayout.cpp
  llvm/lib/IR/Type.cpp
  llvm/lib/Linker/IRMover.cpp
  llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.cpp
  llvm/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp
  llvm/lib/Target/Hexagon/HexagonTargetObjectFile.cpp
  llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
  llvm/lib/Transforms/IPO/GlobalOpt.cpp
  llvm/lib/Transforms/Utils/FunctionComparator.cpp
  mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp

Index: mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp
===
--- mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp
+++ mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp
@@ -168,12 +168,12 @@
   return nullptr;
 return LLVMType::getArrayTy(elementType, type->getArrayNumElements());
   }
-  case llvm::Type::VectorTyID: {
-auto *typeVTy = llvm::cast(type);
-if (typeVTy->isScalable()) {
-  emitError(unknownLoc) << "scalable vector types not supported";
-  return nullptr;
-}
+  case llvm::Type::ScalableVectorTyID: {
+emitError(unknownLoc) << "scalable vector types not supported";
+return nullptr;
+  }
+  case llvm::Type::FixedVectorTyID: {
+auto *typeVTy = llvm::cast(type);
 LLVMType elementType = processType(typeVTy->getElementType());
 if (!elementType)
   return nullptr;
Index: llvm/lib/Transforms/Utils/FunctionComparator.cpp
===
--- llvm/lib/Transforms/Utils/FunctionComparator.cpp
+++ llvm/lib/Transforms/Utils/FunctionComparator.cpp
@@ -483,7 +483,8 @@
   return cmpNumbers(STyL->getNumElements(), STyR->getNumElements());
 return cmpTypes(STyL->getElementType(), STyR->getElementType());
   }
-  case Type::VectorTyID: {
+  case Type::FixedVectorTyID:
+  case Type::ScalableVectorTyID: {
 auto *STyL = cast(TyL);
 auto *STyR = cast(TyR);
 if (STyL->getElementCount().Scalable != STyR->getElementCount().Scalable)
Index: llvm/lib/Transforms/IPO/GlobalOpt.cpp
===
--- llvm/lib/Transforms/IPO/GlobalOpt.cpp
+++ llvm/lib/Transforms/IPO/GlobalOpt.cpp
@@ -130,7 +130,8 @@
   default: break;
   case Type::PointerTyID:
 return true;
-  case Type::VectorTyID:
+  case Type::FixedVectorTyID:
+  case Type::ScalableVectorTyID:
 if (cast(Ty)->getElementType()->isPointerTy())
   return true;
 break;
Index: llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
===
--- llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
+++ llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
@@ -1184,7 +1184,7 @@
 case Type::IntegerTyID: // Integers larger than 64 bits
 case Type::StructTyID:
 case Type::ArrayTyID:
-case Type::VectorTyID:
+case Type::FixedVectorTyID:
   ElementSize = DL.getTypeStoreSize(ETy);
   // Ptx allows variable initilization only for constant and
   // global state spaces.
@@ -1358,7 +1358,7 @@
   switch (ETy->getTypeID()) {
   case Type::StructTyID:
   case Type::ArrayTyID:
-  case Type::VectorTyID:
+  case Type::FixedVectorTyID:
 ElementSize = DL.getTypeStoreSize(ETy);
 O << " .b8 ";
 getSymbol(GVar)->print(O, MAI);
@@ -1892,7 +1892,7 @@
   }
 
   case Type::ArrayTyID:
-  case Type::VectorTyID:
+  case Type::FixedVectorTyID:
   case Type::StructTyID: {
 if (isa(CPV) || isa(CPV)) {
   int ElementSize = DL.getTypeAllocSize(CPV->getType());
Index: llvm/lib/Target/Hexagon/HexagonTargetObjectFile.cpp
===
--- llvm/lib/Target/Hexagon/HexagonTargetObjectFile.cpp
+++ llvm/lib/Target/Hexagon/HexagonTargetObjectFile.cpp
@@ -307,7 +307,7 @@
 const ArrayType *ATy = cast(Ty);
 return getSmallestAddressableSize(ATy->getElementType(), GV, TM);
   }
-  case Type::VectorTyID: {
+  case Type::FixedVectorTyID: {
 const VectorType *PTy = cast(Ty);
 return getSmallestAddressableSize(PTy->getElementType(), GV, TM);
   }
Index: llvm/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp
===
--- llvm/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp
+++ llvm/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp
@@ -408,8 +408,7 @@
 Value *Arg = 

[Lldb-commits] [PATCH] D77587: [SVE] Add new VectorType subclasses

2020-04-10 Thread Christopher Tetreault via Phabricator via lldb-commits
ctetreau marked an inline comment as done.
ctetreau added inline comments.



Comment at: llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1011
 llvm_unreachable("Unknown constant pointer type!");
-  }
-  break;
+  } break;
 

efriedma wrote:
> ?
clang-format-diff must have done this.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77587



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


[Lldb-commits] [lldb] a4da4e3 - [lldb/Reproducers] Fix typo introduced when disabling register failing tests

2020-04-10 Thread Med Ismail Bennani via lldb-commits

Author: Med Ismail Bennani
Date: 2020-04-10T08:37:06+02:00
New Revision: a4da4e3292834b5f93f54440f825dd90876d6615

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

LOG: [lldb/Reproducers] Fix typo introduced when disabling register failing 
tests

Added: 


Modified: 
lldb/test/Shell/Register/x86-64-read.test
lldb/test/Shell/Register/x86-64-ymm-read.test

Removed: 




diff  --git a/lldb/test/Shell/Register/x86-64-read.test 
b/lldb/test/Shell/Register/x86-64-read.test
index 99937071add8..ac3d4d1e2724 100644
--- a/lldb/test/Shell/Register/x86-64-read.test
+++ b/lldb/test/Shell/Register/x86-64-read.test
@@ -1,4 +1,5 @@
-# XFAIL: system-window, lldb-repro
+# UNSUPPORTED: lldb-repro
+# XFAIL: system-windows
 # REQUIRES: native && target-x86_64
 # RUN: %clangxx_host %p/Inputs/x86-64-read.cpp -o %t
 # RUN: %lldb -b -s %s %t | FileCheck %s

diff  --git a/lldb/test/Shell/Register/x86-64-ymm-read.test 
b/lldb/test/Shell/Register/x86-64-ymm-read.test
index 155a00ee6856..be9133b77d42 100644
--- a/lldb/test/Shell/Register/x86-64-ymm-read.test
+++ b/lldb/test/Shell/Register/x86-64-ymm-read.test
@@ -1,4 +1,5 @@
-# XFAIL: system-windows, lldb-repro
+# UNSUPPORTED: lldb-repro
+# XFAIL: system-windows
 # REQUIRES: native && target-x86_64 && native-cpu-avx
 # RUN: %clangxx_host %p/Inputs/x86-ymm-read.cpp -o %t
 # RUN: %lldb -b -s %s %t | FileCheck %s



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