[Lldb-commits] [flang] [lldb] [clang-tools-extra] [clang] [mlir] [llvm] [compiler-rt] [Profile] Add binary profile correlation for code coverage. (PR #69493)

2023-12-13 Thread Petr Hosek via lldb-commits

https://github.com/petrhosek approved this pull request.


https://github.com/llvm/llvm-project/pull/69493
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Fix buildbots after PR 74786 (PR #75272)

2023-12-13 Thread Michael Buch via lldb-commits

https://github.com/Michael137 approved this pull request.

Nice! lgtm

https://github.com/llvm/llvm-project/pull/75272
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Fix buildbots after PR 74786 (PR #75272)

2023-12-13 Thread David Spickett via lldb-commits

DavidSpickett wrote:

Going to merge this to fix the bots.

Our Windows bot does have the DIA SDK installed, but I don't know if it's being 
used. We'll see, if it breaks, I'll deal with it.

https://github.com/llvm/llvm-project/pull/75272
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] dcbf1e4 - [lldb] Fix buildbots after PR 74786 (#75272)

2023-12-13 Thread via lldb-commits

Author: Greg Clayton
Date: 2023-12-13T09:12:30Z
New Revision: dcbf1e4e49f3253c8633edeb4e91694631d61b81

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

LOG: [lldb] Fix buildbots after PR 74786 (#75272)

Fix unexpected pass after
https://github.com/llvm/llvm-project/pull/74786.

Added: 


Modified: 

lldb/test/API/lang/cpp/union-static-data-members/TestCppUnionStaticMembers.py
lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp

Removed: 




diff  --git 
a/lldb/test/API/lang/cpp/union-static-data-members/TestCppUnionStaticMembers.py 
b/lldb/test/API/lang/cpp/union-static-data-members/TestCppUnionStaticMembers.py
index 1988e997499b22..dff23da8662a04 100644
--- 
a/lldb/test/API/lang/cpp/union-static-data-members/TestCppUnionStaticMembers.py
+++ 
b/lldb/test/API/lang/cpp/union-static-data-members/TestCppUnionStaticMembers.py
@@ -42,7 +42,7 @@ def test_expr_union_static_members(self):
 name="val", value="42"
 )])
 
-@expectedFailureAll
+@expectedFailureWindows
 def test_union_in_anon_namespace(self):
 """Tests that frame variable and expr work
for union static data members in anonymous

diff  --git a/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp 
b/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
index acd381ccad13d2..afa600a89cbc0f 100644
--- a/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
+++ b/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
@@ -362,10 +362,9 @@ TEST_F(SymbolFilePDBTests, TestSimpleClassTypes) {
   SymbolFilePDB *symfile =
   static_cast(module->GetSymbolFile());
   llvm::pdb::IPDBSession &session = symfile->GetPDBSession();
-  llvm::DenseSet searched_files;
-  TypeMap results;
-  symfile->FindTypes(ConstString("Class"), CompilerDeclContext(), 0,
- searched_files, results);
+  TypeResults query_results;
+  symfile->FindTypes(TypeQuery("Class"), query_results);
+  TypeMap &results = query_results.GetTypeMap();
   EXPECT_EQ(1u, results.GetSize());
   lldb::TypeSP udt_type = results.GetTypeAtIndex(0);
   EXPECT_EQ(ConstString("Class"), udt_type->GetName());
@@ -383,7 +382,6 @@ TEST_F(SymbolFilePDBTests, TestNestedClassTypes) {
   SymbolFilePDB *symfile =
   static_cast(module->GetSymbolFile());
   llvm::pdb::IPDBSession &session = symfile->GetPDBSession();
-  llvm::DenseSet searched_files;
   TypeMap results;
 
   auto clang_ast_ctx_or_err =
@@ -394,8 +392,10 @@ TEST_F(SymbolFilePDBTests, TestNestedClassTypes) {
   llvm::dyn_cast_or_null(clang_ast_ctx_or_err->get());
   EXPECT_NE(nullptr, clang_ast_ctx);
 
-  symfile->FindTypes(ConstString("Class"), CompilerDeclContext(), 0,
- searched_files, results);
+  TypeResults query_results;
+  symfile->FindTypes(TypeQuery("Class"), query_results);
+  TypeMap &results = query_results.GetTypeMap();
+
   EXPECT_EQ(1u, results.GetSize());
 
   auto Class = results.GetTypeAtIndex(0);
@@ -413,10 +413,11 @@ TEST_F(SymbolFilePDBTests, TestNestedClassTypes) {
   // compiler type for both, but `FindTypes` may return more than one type
   // (with the same compiler type) because the symbols have 
diff erent IDs.
 
-  TypeMap more_results;
   auto ClassCompilerDeclCtx = CompilerDeclContext(clang_ast_ctx, ClassDeclCtx);
-  symfile->FindTypes(ConstString("NestedClass"), ClassCompilerDeclCtx, 0,
- searched_files, more_results);
+  TypeResults query_results;
+  symfile->FindTypes(TypeQuery(ClassCompilerDeclCtx, "NestedClass"),
+ query_results);
+  TypeMap &more_results = query_results.GetTypeMap();
   EXPECT_LE(1u, more_results.GetSize());
 
   lldb::TypeSP udt_type = more_results.GetTypeAtIndex(0);
@@ -437,9 +438,6 @@ TEST_F(SymbolFilePDBTests, TestClassInNamespace) {
   SymbolFilePDB *symfile =
   static_cast(module->GetSymbolFile());
   llvm::pdb::IPDBSession &session = symfile->GetPDBSession();
-  llvm::DenseSet searched_files;
-  TypeMap results;
-
   auto clang_ast_ctx_or_err =
   symfile->GetTypeSystemForLanguage(lldb::eLanguageTypeC_plus_plus);
   ASSERT_THAT_EXPECTED(clang_ast_ctx_or_err, llvm::Succeeded());
@@ -456,12 +454,14 @@ TEST_F(SymbolFilePDBTests, TestClassInNamespace) {
   symfile->ParseDeclsForContext(CompilerDeclContext(
   clang_ast_ctx, static_cast(tu)));
 
-  auto ns_namespace =
+  auto ns_namespace_decl_ctx =
   symfile->FindNamespace(ConstString("NS"), CompilerDeclContext(), true);
-  EXPECT_TRUE(ns_namespace.IsValid());
+  EXPECT_TRUE(ns_namespace_decl_ctx.IsValid());
 
-  symfile->FindTypes(ConstString("NSClass"), ns_namespace, 0, searched_files,
- results);
+  TypeResults query_results;
+  symfile->FindTypes(TypeQuery(ns_namespace_decl_ctx, "NSClass"),
+ query_results);
+  TypeMa

[Lldb-commits] [lldb] [lldb] Fix buildbots after PR 74786 (PR #75272)

2023-12-13 Thread David Spickett via lldb-commits

https://github.com/DavidSpickett closed 
https://github.com/llvm/llvm-project/pull/75272
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [llvm] [lld] [mlir] [libcxx] [compiler-rt] [lldb] [libc] [clang-tools-extra] [MLIR][LLVM] Add Continuous Loop Peeling transform to SCF (PR #71555)

2023-12-13 Thread via lldb-commits

https://github.com/muneebkhan85 updated 
https://github.com/llvm/llvm-project/pull/71555

>From 7bb2f9793b2a2cccbaa401f6e2ac850b587f2b59 Mon Sep 17 00:00:00 2001
From: Muneeb Khan 
Date: Tue, 7 Nov 2023 23:52:17 +0800
Subject: [PATCH 1/7] [MLIR][LLVM] Add Continuous Loop Peeling transform to SCF

This patch adds continuous loop peeling to scf loop transforms
in the MLIR backend. This transforms the target loop into a
chain of loops, with step sizes that are powers of two and
decrease exponetially across subsequent loops. Originally
authored by Litu Zhou litu.z...@huawei.com.
---
 .../SCF/TransformOps/SCFTransformOps.td   |  36 +
 .../SCF/TransformOps/SCFTransformOps.cpp  | 147 ++
 .../Dialect/SCF/loop-continuous-peel.mlir |  98 
 3 files changed, 281 insertions(+)
 create mode 100644 mlir/test/Dialect/SCF/loop-continuous-peel.mlir

diff --git a/mlir/include/mlir/Dialect/SCF/TransformOps/SCFTransformOps.td 
b/mlir/include/mlir/Dialect/SCF/TransformOps/SCFTransformOps.td
index 14df7e23a430f..e3d79a7f0ae40 100644
--- a/mlir/include/mlir/Dialect/SCF/TransformOps/SCFTransformOps.td
+++ b/mlir/include/mlir/Dialect/SCF/TransformOps/SCFTransformOps.td
@@ -147,6 +147,42 @@ def LoopPeelOp : Op {
+  let description = [{
+Transforms the loop into a chain of loops, with step sizes that are
+powers of two and decrease exponetially across subsequent loops.
+The transform is similar to loop.peel in the effect that it creates a loop
+with a step (that is power of 2) to divide the range evenly, with the
+difference that the remaining iterations are spread across similar loops
+with exponentially decreasing step sizes, with the last loop with step size
+of 2^0 = 1.
+
+ Return modes
+
+This operation consumes the `target` handles and produces the
+continuously-peeled loop.
+  }];
+
+  let arguments =
+  (ins TransformHandleTypeInterface:$target,
+   DefaultValuedAttr:$single_iter_opt);
+  // TODO: Return both the peeled loop and the remainder loop.
+  let results = (outs TransformHandleTypeInterface:$transformed);
+
+  let assemblyFormat =
+"$target attr-dict `:` functional-type(operands, results)";
+
+  let extraClassDeclaration = [{
+::mlir::DiagnosedSilenceableFailure applyToOne(
+::mlir::transform::TransformRewriter &rewriter,
+::mlir::Operation *target,
+::mlir::transform::ApplyToEachResultList &results,
+::mlir::transform::TransformState &state);
+  }];
+}
+
 def LoopPipelineOp : Op {
diff --git a/mlir/lib/Dialect/SCF/TransformOps/SCFTransformOps.cpp 
b/mlir/lib/Dialect/SCF/TransformOps/SCFTransformOps.cpp
index 62370604142cd..dcba6a8b406b2 100644
--- a/mlir/lib/Dialect/SCF/TransformOps/SCFTransformOps.cpp
+++ b/mlir/lib/Dialect/SCF/TransformOps/SCFTransformOps.cpp
@@ -206,6 +206,153 @@ 
transform::LoopPeelOp::applyToOne(transform::TransformRewriter &rewriter,
   return DiagnosedSilenceableFailure::success();
 }
 
+//===-===//
+// LoopContinuousPeelOp
+//===-===//
+
+static LogicalResult splitLoopHelper(RewriterBase &b, scf::ForOp &forOp,
+ scf::ForOp &partialIteration,
+ Value &splitBound) {
+  RewriterBase::InsertionGuard guard(b);
+  auto lbInt = getConstantIntValue(forOp.getLowerBound());
+  auto ubInt = getConstantIntValue(forOp.getUpperBound());
+  auto stepInt = getConstantIntValue(forOp.getStep());
+
+  // No specialization necessary if step already divides upper bound evenly.
+  if (lbInt && ubInt && stepInt && (*ubInt - *lbInt) % *stepInt == 0)
+return failure();
+  // No specialization necessary if step size is 1.
+  if (stepInt == static_cast(1))
+return failure();
+
+  // Create ForOp for partial iteration.
+  b.setInsertionPointAfter(forOp);
+  partialIteration = cast(b.clone(*forOp.getOperation()));
+  partialIteration.getLowerBoundMutable().assign(splitBound);
+  forOp.replaceAllUsesWith(partialIteration->getResults());
+  partialIteration.getInitArgsMutable().assign(forOp->getResults());
+
+  // Set new upper loop bound.
+  b.updateRootInPlace(
+  forOp, [&]() { forOp.getUpperBoundMutable().assign(splitBound); });
+
+  return success();
+}
+
+static scf::IfOp convertSingleIterFor(RewriterBase &b, scf::ForOp &forOp) {
+  Location loc = forOp->getLoc();
+  IRMapping mapping;
+  mapping.map(forOp.getInductionVar(), forOp.getLowerBound());
+  for (auto [arg, operand] :
+   llvm::zip(forOp.getRegionIterArgs(), forOp.getInitsMutable())) {
+mapping.map(arg, operand.get());
+  }
+  b.setInsertionPoint(forOp);
+  auto cond =
+  b.create(loc, arith::CmpIPredicate::slt,
+  forOp.getLowerBound(), forOp.getUpperBound());
+  auto ifOp = b.create(loc, forOp->getResultTypes(), cond, true);
+  // then branch
+  b.setInsertionP

[Lldb-commits] [lld] [clang-tools-extra] [lldb] [libcxx] [mlir] [openmp] [flang] [libcxxabi] [clang] [llvm] [libc] [compiler-rt] [libc++] Fix `take_view::__sentinel`'s `operator==` (PR #74655)

2023-12-13 Thread via lldb-commits

huixie90 wrote:

Hi, could you please apply clang-format to the lines you changed and I am going 
to merge it after that

https://github.com/llvm/llvm-project/pull/74655
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 887f211 - [lldb][PDB] Attempt to fix tests on Windows

2023-12-13 Thread David Spickett via lldb-commits

Author: David Spickett
Date: 2023-12-13T11:15:46Z
New Revision: 887f2110280fd9a37003fd2bb811c6c1dcf4370d

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

LOG: [lldb][PDB] Attempt to fix tests on Windows

Added: 


Modified: 
lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp

Removed: 




diff  --git a/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp 
b/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
index afa600a89cbc0..09b36631a8154 100644
--- a/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
+++ b/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
@@ -382,7 +382,6 @@ TEST_F(SymbolFilePDBTests, TestNestedClassTypes) {
   SymbolFilePDB *symfile =
   static_cast(module->GetSymbolFile());
   llvm::pdb::IPDBSession &session = symfile->GetPDBSession();
-  TypeMap results;
 
   auto clang_ast_ctx_or_err =
   symfile->GetTypeSystemForLanguage(lldb::eLanguageTypeC_plus_plus);



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


[Lldb-commits] [lldb] Add a test for evicting unreachable modules from the global module cache (PR #74894)

2023-12-13 Thread David Spickett via lldb-commits

DavidSpickett wrote:

This test crashes on Arm and AArch64:
```
 TEST 'lldb-api :: 
python_api/global_module_cache/TestGlobalModuleCache.py' FAILED 

Script:
--
/usr/bin/python3.8 
/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/API/dotest.py
 -u CXXFLAGS -u CFLAGS --env ARCHIVER=/usr/local/bin/llvm-ar --env 
OBJCOPY=/usr/bin/llvm-objcopy --env 
LLVM_LIBS_DIR=/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./lib --env 
LLVM_INCLUDE_DIR=/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/include 
--env LLVM_TOOLS_DIR=/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./bin 
--arch aarch64 --build-dir 
/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lldb-test-build.noindex 
--lldb-module-cache-dir 
/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lldb-test-build.noindex/module-cache-lldb/lldb-api
 --clang-module-cache-dir 
/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lldb-test-build.noindex/module-cache-clang/lldb-api
 --executable /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./bin/lldb 
--compiler /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./bin/clang 
--dsymutil /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./bin/dsymutil 
--llvm-tools-dir /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./bin 
--lldb-libs-dir /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./lib 
/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/API/python_api/global_module_cache
 -p TestGlobalModuleCache.py
--
Exit Code: -6

Command Output (stdout):
--
lldb version 18.0.0git (https://github.com/llvm/llvm-project.git revision 
bb18611e3630d956b74fe33209321cb8ba9272a8)
  clang revision bb18611e3630d956b74fe33209321cb8ba9272a8
  llvm revision bb18611e3630d956b74fe33209321cb8ba9272a8

--
Command Output (stderr):
--
python3.8: ../llvm-project/lldb/source/Target/ThreadPlanStack.cpp:151: 
lldb::ThreadPlanSP lldb_private::ThreadPlanStack::PopPlan(): Assertion 
`m_plans.size() > 1 && "Can't pop the base thread plan"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and 
include the crash backtrace.
 #0 0x7f3d8d60 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) 
(/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lib/python3.8/site-packages/lldb/_lldb.cpython-38-aarch64-linux-gnu.so+0x51d7d60)
 #1 0x7f3d6d1c llvm::sys::RunSignalHandlers() 
(/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lib/python3.8/site-packages/lldb/_lldb.cpython-38-aarch64-linux-gnu.so+0x51d5d1c)
 #2 0x7f3d9494 SignalHandler(int) 
(/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lib/python3.8/site-packages/lldb/_lldb.cpython-38-aarch64-linux-gnu.so+0x51d8494)
 #3 0x85fee7dc (linux-vdso.so.1+0x7dc)
 #4 0x85e7cd78 raise 
/build/glibc-RIFKjK/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #5 0x85e69aac abort /build/glibc-RIFKjK/glibc-2.31/stdlib/abort.c:81:7
 #6 0x85e76490 __assert_fail_base 
/build/glibc-RIFKjK/glibc-2.31/assert/assert.c:89:7
 #7 0x85e764f4 (/lib/aarch64-linux-gnu/libc.so.6+0x2d4f4)
 #8 0x7ef6f744 lldb_private::ThreadPlanStack::PopPlan() 
(/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lib/python3.8/site-packages/lldb/_lldb.cpython-38-aarch64-linux-gnu.so+0x4d6e744)
 #9 0x7ef482f8 lldb_private::Thread::PopPlan() 
(/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lib/python3.8/site-packages/lldb/_lldb.cpython-38-aarch64-linux-gnu.so+0x4d472f8)
#10 0x7ef47ca8 lldb_private::Thread::ShouldStop(lldb_private::Event*) 
(/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lib/python3.8/site-packages/lldb/_lldb.cpython-38-aarch64-linux-gnu.so+0x4d46ca8)
#11 0x7ef544c8 
lldb_private::ThreadList::ShouldStop(lldb_private::Event*) 
(/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lib/python3.8/site-packages/lldb/_lldb.cpython-38-aarch64-linux-gnu.so+0x4d534c8)
#12 0x7eed3c30 
lldb_private::Process::ShouldBroadcastEvent(lldb_private::Event*) 
(/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lib/python3.8/site-packages/lldb/_lldb.cpython-38-aarch64-linux-gnu.so+0x4cd2c30)
#13 0x7eecd220 
lldb_private::Process::HandlePrivateEvent(std::shared_ptr&)
 
(/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lib/python3.8/site-packages/lldb/_lldb.cpython-38-aarch64-linux-gnu.so+0x4ccc220)
#14 0x7eed4eb4 lldb_private::Process::RunPrivateStateThread(bool) 
(/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lib/python3.8/site-packages/lldb/_lldb.cpython-38-aarch64-linux-gnu.so+0x4cd3eb4)
#15 0x7eee06f0 std::_Function_handler::_M_invoke(std::_Any_data
 const&) 
(/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lib/python3.8/site-packages/lldb/_lldb.cpython-38-aarch64-linux-gnu.so+0x4cdf6f0)
#16 0x7edd3f80 
lldb_private::HostNativeThreadBase::ThreadCreateTrampoline(void*) 
(/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/l

[Lldb-commits] [lldb] 35dacf2 - Revert "Add a test for evicting unreachable modules from the global module cache (#74894)"

2023-12-13 Thread David Spickett via lldb-commits

Author: David Spickett
Date: 2023-12-13T11:34:43Z
New Revision: 35dacf2f51af251a74ac98ed29e7c454a619fcf1

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

LOG: Revert "Add a test for evicting unreachable modules from the global module 
cache (#74894)"

This reverts commit 2684281d208612a746b05c891f346bd7b95318d5.

Due to being flaky on Arm and AArch64 buildbots.

Added: 


Modified: 


Removed: 
lldb/test/API/python_api/global_module_cache/Makefile
lldb/test/API/python_api/global_module_cache/TestGlobalModuleCache.py
lldb/test/API/python_api/global_module_cache/one-print.c
lldb/test/API/python_api/global_module_cache/two-print.c



diff  --git a/lldb/test/API/python_api/global_module_cache/Makefile 
b/lldb/test/API/python_api/global_module_cache/Makefile
deleted file mode 100644
index 22f1051530f871..00
--- a/lldb/test/API/python_api/global_module_cache/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-include Makefile.rules

diff  --git 
a/lldb/test/API/python_api/global_module_cache/TestGlobalModuleCache.py 
b/lldb/test/API/python_api/global_module_cache/TestGlobalModuleCache.py
deleted file mode 100644
index 98ebdec0404eb4..00
--- a/lldb/test/API/python_api/global_module_cache/TestGlobalModuleCache.py
+++ /dev/null
@@ -1,169 +0,0 @@
-"""
-Test the use of the global module cache in lldb
-"""
-
-import lldb
-
-from lldbsuite.test.decorators import *
-from lldbsuite.test.lldbtest import *
-from lldbsuite.test import lldbutil
-import os
-import shutil
-from pathlib import Path
-import time
-
-class GlobalModuleCacheTestCase(TestBase):
-# NO_DEBUG_INFO_TESTCASE = True
-
-def check_counter_var(self, thread, value):
-frame = thread.frames[0]
-var = frame.FindVariable("counter")
-self.assertTrue(var.GetError().Success(), "Got counter variable")
-self.assertEqual(var.GetValueAsUnsigned(), value, "This was one-print")
-
-def copy_to_main(self, src, dst):
-# We are relying on the source file being newer than the .o file from
-# a previous build, so sleep a bit here to ensure that the touch is 
later.
-time.sleep(2)
-try:
-shutil.copy(src, dst)
-except:
-self.fail(f"Could not copy {src} to {dst}")
-Path(dst).touch()
-
-# The rerun tests indicate rerunning on Windows doesn't really work, so
-# this one won't either.
-@skipIfWindows
-def test_OneTargetOneDebugger(self):
-self.do_test(True, True)
-
-# This behaves as implemented but that behavior is not desirable.
-# This test tests for the desired behavior as an expected fail.
-@skipIfWindows
-@expectedFailureAll
-def test_TwoTargetsOneDebugger(self):
-self.do_test(False, True)
-
-@skipIfWindows
-@expectedFailureAll
-def test_OneTargetTwoDebuggers(self):
-self.do_test(True, False)
-
-def do_test(self, one_target, one_debugger):
-# Make sure that if we have one target, and we run, then
-# change the binary and rerun, the binary (and any .o files
-# if using dwarf in .o file debugging) get removed from the
-# shared module cache.  They are no longer reachable.
-debug_style = self.getDebugInfo()
-
-# Before we do anything, clear the global module cache so we don't
-# see objects from other runs:
-lldb.SBDebugger.MemoryPressureDetected()
-
-# Set up the paths for our two versions of main.c:
-main_c_path = os.path.join(self.getBuildDir(), "main.c")
-one_print_path = os.path.join(self.getSourceDir(), "one-print.c")
-two_print_path = os.path.join(self.getSourceDir(), "two-print.c")
-main_filespec = lldb.SBFileSpec(main_c_path)
-
-# First copy the one-print.c to main.c in the build folder and
-# build our a.out from there:
-self.copy_to_main(one_print_path, main_c_path)
-self.build(dictionary={"C_SOURCES": main_c_path, "EXE": "a.out"})
-
-(target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(
-self, "return counter;", main_filespec
-)
-
-# Make sure we ran the version we intended here:
-self.check_counter_var(thread, 1)
-process.Kill()
-
-# Now copy two-print.c over main.c, rebuild, and rerun:
-# os.unlink(target.GetExecutable().fullpath)
-self.copy_to_main(two_print_path, main_c_path)
-
-self.build(dictionary={"C_SOURCES": main_c_path, "EXE": "a.out"})
-error = lldb.SBError()
-if one_debugger:
-if one_target:
-(_, process, thread, _) = lldbutil.run_to_breakpoint_do_run(
-self, target, bkpt
-)
-else:
- 

[Lldb-commits] [lldb] e34c35a - [lldb][PDB] Fix more issues with PDB tests

2023-12-13 Thread David Spickett via lldb-commits

Author: David Spickett
Date: 2023-12-13T11:49:24Z
New Revision: e34c35a21ccc215ce507a1e19b4ff2a1ce9906f3

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

LOG: [lldb][PDB] Fix more issues with PDB tests

Added: 


Modified: 
lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp

Removed: 




diff  --git a/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp 
b/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
index 09b36631a81542..c09ed162c023d8 100644
--- a/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
+++ b/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
@@ -413,10 +413,10 @@ TEST_F(SymbolFilePDBTests, TestNestedClassTypes) {
   // (with the same compiler type) because the symbols have 
diff erent IDs.
 
   auto ClassCompilerDeclCtx = CompilerDeclContext(clang_ast_ctx, ClassDeclCtx);
-  TypeResults query_results;
+  TypeResults query_results_nested;
   symfile->FindTypes(TypeQuery(ClassCompilerDeclCtx, "NestedClass"),
- query_results);
-  TypeMap &more_results = query_results.GetTypeMap();
+ query_results_nested);
+  TypeMap &more_results = query_results_nested.GetTypeMap();
   EXPECT_LE(1u, more_results.GetSize());
 
   lldb::TypeSP udt_type = more_results.GetTypeAtIndex(0);



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


[Lldb-commits] [clang-tools-extra] [flang] [llvm] [libc] [libunwind] [lldb] [openmp] [libcxxabi] [libcxx] [mlir] [compiler-rt] [clang] [lld] [C23] Implement N3018: The constexpr specifier for object d

2023-12-13 Thread Mariya Podchishchaeva via lldb-commits

Fznamznon wrote:

Adding more reviewers since Aaron is on vacation...

https://github.com/llvm/llvm-project/pull/73099
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [openmp] [clang-tools-extra] [libcxx] [mlir] [clang] [compiler-rt] [lldb] [llvm] [libcxxabi] [flang] [MachineCopyPropagation] When the source of PreviousCopy is undef, we cannot replace

2023-12-13 Thread David Green via lldb-commits

davemgreen wrote:

Thanks. It sounds like there are not a lot of code changes, which is a good 
sign. I didn't expect the debug problems though.

I'll try and take a look at the patch. Perhaps you are right that we need a new 
method for the debug info to use.

https://github.com/llvm/llvm-project/pull/74682
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [libc] [flang] [openmp] [mlir] [libcxx] [llvm] [lld] [libcxxabi] [compiler-rt] [clang-tools-extra] [lldb] [libc++] Fix `take_view::__sentinel`'s `operator==` (PR #74655)

2023-12-13 Thread Jakub Mazurkiewicz via lldb-commits

https://github.com/JMazurkiewicz updated 
https://github.com/llvm/llvm-project/pull/74655

>From b3de573887cdd86fd6ce168bdcc6d729d73b13b2 Mon Sep 17 00:00:00 2001
From: Jakub Mazurkiewicz 
Date: Wed, 6 Dec 2023 14:03:51 +0100
Subject: [PATCH 01/12] [libc++] Fix `take_view::__sentinel`'s `operator==`

---
 libcxx/include/__ranges/take_view.h   |   2 +-
 .../base.pass.cpp |   5 +-
 .../ctor.pass.cpp |   0
 .../range.take.sentinel/eq.pass.cpp   | 192 ++
 .../range.take/sentinel/eq.pass.cpp   |  55 -
 5 files changed, 194 insertions(+), 60 deletions(-)
 rename libcxx/test/std/ranges/range.adaptors/range.take/{sentinel => 
range.take.sentinel}/base.pass.cpp (83%)
 rename libcxx/test/std/ranges/range.adaptors/range.take/{sentinel => 
range.take.sentinel}/ctor.pass.cpp (100%)
 create mode 100644 
libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/eq.pass.cpp
 delete mode 100644 
libcxx/test/std/ranges/range.adaptors/range.take/sentinel/eq.pass.cpp

diff --git a/libcxx/include/__ranges/take_view.h 
b/libcxx/include/__ranges/take_view.h
index 4204017d9249bc..811428e529f59a 100644
--- a/libcxx/include/__ranges/take_view.h
+++ b/libcxx/include/__ranges/take_view.h
@@ -183,7 +183,7 @@ class take_view<_View>::__sentinel {
   template
 requires sentinel_for, 
iterator_t<__maybe_const<_OtherConst, _View>>>
   _LIBCPP_HIDE_FROM_ABI
-  friend constexpr bool operator==(const _Iter<_Const>& __lhs, const 
__sentinel& __rhs) {
+  friend constexpr bool operator==(const _Iter<_OtherConst>& __lhs, const 
__sentinel& __rhs) {
 return __lhs.count() == 0 || __lhs.base() == __rhs.__end_;
   }
 };
diff --git 
a/libcxx/test/std/ranges/range.adaptors/range.take/sentinel/base.pass.cpp 
b/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/base.pass.cpp
similarity index 83%
rename from 
libcxx/test/std/ranges/range.adaptors/range.take/sentinel/base.pass.cpp
rename to 
libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/base.pass.cpp
index c949eb7cc08469..15b2b5476e86dd 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.take/sentinel/base.pass.cpp
+++ 
b/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/base.pass.cpp
@@ -8,10 +8,7 @@
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17
 
-// sentinel() = default;
-// constexpr explicit sentinel(sentinel_t end);
-// constexpr sentinel(sentinel s)
-//   requires Const && convertible_to, sentinel_t>;
+// constexpr sentinel_t base() const;
 
 #include 
 #include 
diff --git 
a/libcxx/test/std/ranges/range.adaptors/range.take/sentinel/ctor.pass.cpp 
b/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/ctor.pass.cpp
similarity index 100%
rename from 
libcxx/test/std/ranges/range.adaptors/range.take/sentinel/ctor.pass.cpp
rename to 
libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/ctor.pass.cpp
diff --git 
a/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/eq.pass.cpp
 
b/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/eq.pass.cpp
new file mode 100644
index 00..f20c29b4c64714
--- /dev/null
+++ 
b/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/eq.pass.cpp
@@ -0,0 +1,192 @@
+//===--===//
+//
+// 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
+//
+//===--===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+
+// friend constexpr bool operator==(const CI& y, const sentinel& x);
+// template
+//   requires sentinel_for, 
iterator_t>>
+// friend constexpr bool operator==(const CI& y, const sentinel& 
x);
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "test_iterators.h"
+
+template 
+class StrictIterator {
+  using Base = std::conditional_t;
+  Base base_;
+
+public:
+  using value_type  = int;
+  using difference_type = std::ptrdiff_t;
+
+  constexpr explicit StrictIterator(Base base) : base_(base) {}
+
+  StrictIterator(StrictIterator&&)= default;
+  StrictIterator& operator=(StrictIterator&&) = default;
+
+  constexpr StrictIterator& operator++() {
+++base_;
+return *this;
+  }
+
+  constexpr void operator++(int) { ++*this; }
+  constexpr decltype(auto) operator*() const { return *base_; }
+  constexpr Base base() const { return base_; }
+};
+
+static_assert(std::input_iterator>);
+static_assert(!std::copyable>);
+static_assert(!std::forward_iterator>);
+static_assert(std::input_iterator>);
+static_assert(!std::copyable>);
+static_assert(!std::forward_iterator>);
+
+template 
+class StrictSentinel {
+  using Base = std::conditional_t;
+  Base base_;
+
+public:
+  StrictSentinel() = def

[Lldb-commits] [lldb] f59fed2 - [lldb][PDB] TypeQuery parameter should be ConstString

2023-12-13 Thread David Spickett via lldb-commits

Author: David Spickett
Date: 2023-12-13T12:46:16Z
New Revision: f59fed261e30ddeecb6c6bfb53e47ecd4b124e7a

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

LOG: [lldb][PDB] TypeQuery parameter should be ConstString

Added: 


Modified: 
lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp

Removed: 




diff  --git a/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp 
b/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
index c09ed162c023d8..cdaa4fafa4c873 100644
--- a/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
+++ b/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
@@ -414,8 +414,9 @@ TEST_F(SymbolFilePDBTests, TestNestedClassTypes) {
 
   auto ClassCompilerDeclCtx = CompilerDeclContext(clang_ast_ctx, ClassDeclCtx);
   TypeResults query_results_nested;
-  symfile->FindTypes(TypeQuery(ClassCompilerDeclCtx, "NestedClass"),
- query_results_nested);
+  symfile->FindTypes(
+  TypeQuery(ClassCompilerDeclCtx, ConstString("NestedClass")),
+  query_results_nested);
   TypeMap &more_results = query_results_nested.GetTypeMap();
   EXPECT_LE(1u, more_results.GetSize());
 
@@ -458,7 +459,7 @@ TEST_F(SymbolFilePDBTests, TestClassInNamespace) {
   EXPECT_TRUE(ns_namespace_decl_ctx.IsValid());
 
   TypeResults query_results;
-  symfile->FindTypes(TypeQuery(ns_namespace_decl_ctx, "NSClass"),
+  symfile->FindTypes(TypeQuery(ns_namespace_decl_ctx, ConstString("NSClass")),
  query_results);
   TypeMap &results = query_results.GetTypeMap();
   EXPECT_EQ(1u, results.GetSize());



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


[Lldb-commits] [clang] [libcxx] [llvm] [lld] [compiler-rt] [flang] [libc] [lldb] [clang-tools-extra] [AMDGPU] Update IEEE and DX10_CLAMP for GFX12 (PR #75030)

2023-12-13 Thread Piotr Sobczak via lldb-commits

https://github.com/piotrAMD closed 
https://github.com/llvm/llvm-project/pull/75030
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [libcxx] [llvm] [openmp] [libcxxabi] [compiler-rt] [flang] [mlir] [lldb] [clang-tools-extra] [MachineCopyPropagation] When the source of PreviousCopy is undef, we cannot replace

2023-12-13 Thread via lldb-commits

DianQK wrote:

> I'll try and take a look at the patch. Perhaps you are right that we need a 
> new method for the debug info to use.

Based on 
https://github.com/llvm/llvm-project/blob/fd8fa31c55a3413f643443ecf3301441428ce513/llvm/docs/InstrRefDebugInfo.md?plain=1#L125-L127,
 perhaps we could add an `isCopyLikeInstr` method? This should be a good name 
while changing very little.I 'll give it a try later.

https://github.com/llvm/llvm-project/pull/74682
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lld] [libc] [clang] [llvm] [lldb] [mlir] [clang-tools-extra] [libcxx] [compiler-rt] [MLIR][LLVM] Add Continuous Loop Peeling transform to SCF (PR #71555)

2023-12-13 Thread via lldb-commits

https://github.com/muneebkhan85 edited 
https://github.com/llvm/llvm-project/pull/71555
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lld] [libc] [clang] [flang] [llvm] [lldb] [clang-tools-extra] [libcxx] [mlir] [compiler-rt] [AMDGPU] Min/max changes for GFX12 (PR #75214)

2023-12-13 Thread Piotr Sobczak via lldb-commits

https://github.com/piotrAMD closed 
https://github.com/llvm/llvm-project/pull/75214
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang-tools-extra] [mlir] [flang] [lld] [libc] [llvm] [compiler-rt] [libcxx] [lldb] [clang] [AMDGPU] GFX12: Add Split Workgroup Barrier (PR #74836)

2023-12-13 Thread Mariusz Sikora via lldb-commits

https://github.com/mariusz-sikora-at-amd closed 
https://github.com/llvm/llvm-project/pull/74836
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] Make only one function that needs to be implemented when searching for types (PR #74786)

2023-12-13 Thread David Spickett via lldb-commits

DavidSpickett wrote:

I merged your fix and a few follow ups to get it all to compile. Now we have 2 
failures on Windows:
https://lab.llvm.org/buildbot/#/builders/219/builds/7554/steps/6/logs/stdio

```
Failed Tests (2):
  lldb-api :: lang/cpp/unique-types4/TestUniqueTypes4.py
  lldb-unit :: 
SymbolFile/PDB/./SymbolFilePDBTests.exe/SymbolFilePDBTests/TestMaxMatches
```

Which I can look into but not today.

Is it expected that results would change here? Seems like a refactor but I 
don't have much context.

https://github.com/llvm/llvm-project/pull/74786
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] Fix lldb-dap pickProcess command for selecting process for debugger attachment (PR #75342)

2023-12-13 Thread via lldb-commits

https://github.com/Dodzey created 
https://github.com/llvm/llvm-project/pull/75342

Hi,

I see that the documentation for lldb-dap refers to a ${command.pickMyProcess} 
which can be used for interactive process selection within the VS Code IDE. It 
appears that this functionality no longer works, perhaps due to internal 
changes in VS Code.

I can get interactive process selection if I add the following snippet to the 
lldp-dap extension package.json:

```
"variables": {
"pickProcess": "extension.pickNativeProcess"
},
```

However, referencing extension.pickNativeProcess here is only valid if the 
Microsoft VSCode CPPTools extension is installed, as that is the extension that 
registers a native process picker under the name 'extension.pickNativeProcess' 
I'm not sure if it's desirable behaviour for the lldb-dap extension to be 
dependent on the presence of the Microsoft CPPTools extension?

It appears (although I am not familiar with VSCode extension development) that 
any solution to this that was fully integrated in the lldp-dap extension would 
require typescript source to be added to the extension in order to register a 
private native process picker under a custom name - something like 
`extension.lldb-dap.pickNativeProcess`. I would assume that this implementation 
would look very similar, if not identical to the command currently exposed by 
the Microsoft CPPTools extension.

In the PR I have included the minimal changes required to seemingly make the 
process picker work when the Microsoft VSCode CPPTools extension is also 
installed.

What are the recommendations on how we could proceed here?


Thanks!


>From fbfc8a6d17f3cb4a7e2b583cb985b27d2cc597f3 Mon Sep 17 00:00:00 2001
From: Dodzey 
Date: Wed, 13 Dec 2023 13:57:28 +
Subject: [PATCH 1/2] Add variable mapping for pickProcess command

---
 lldb/tools/lldb-dap/package.json | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lldb/tools/lldb-dap/package.json b/lldb/tools/lldb-dap/package.json
index ebb1103d695e17..7b77b32f890a6f 100644
--- a/lldb/tools/lldb-dap/package.json
+++ b/lldb/tools/lldb-dap/package.json
@@ -124,6 +124,9 @@
"swift"
]
},
+   "variables": {
+   "pickProcess": 
"extension.pickNativeProcess"
+   },
"program": "./bin/lldb-dap",
"windows": {
"program": "./bin/lldb-dap.exe"

>From 6b79c1937875f0171e259d6eea7c397e5cfd69f4 Mon Sep 17 00:00:00 2001
From: Dodzey 
Date: Wed, 13 Dec 2023 13:58:14 +
Subject: [PATCH 2/2] Update README.md

---
 lldb/tools/lldb-dap/README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lldb/tools/lldb-dap/README.md b/lldb/tools/lldb-dap/README.md
index 00ceb0bedc40a4..d341a136293a87 100644
--- a/lldb/tools/lldb-dap/README.md
+++ b/lldb/tools/lldb-dap/README.md
@@ -125,7 +125,7 @@ The JSON configuration file can contain the following 
`lldb-dap` specific launch
 |**type**   |string  |Y| Must be "lldb-dap".
 |**request**|string  |Y| Must be "attach".
 |**program**|string  | | Path to the executable to attach to. This 
value is optional but can help to resolve breakpoints prior the attaching to 
the program.
-|**pid**|number  | | The process id of the process you wish to 
attach to. If **pid** is omitted, the debugger will attempt to attach to the 
program by finding a process whose file name matches the file name from 
**porgram**. Setting this value to `${command:pickMyProcess}` will allow 
interactive process selection in the IDE.
+|**pid**|number  | | The process id of the process you wish to 
attach to. If **pid** is omitted, the debugger will attempt to attach to the 
program by finding a process whose file name matches the file name from 
**program**. Setting this value to `${command:pickProcess}` will allow 
interactive process selection in the IDE.
 |**stopOnEntry**|boolean| | Whether to stop program immediately after 
launching.
 |**waitFor**|boolean | | Wait for the process to launch.
 |**initCommands**   |[string]| | LLDB commands executed upon debugger startup 
prior to creating the LLDB target. Commands and command output will be sent to 
the debugger console when they are executed.

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


[Lldb-commits] [lldb] Fix lldb-dap pickProcess command for selecting process for debugger attachment (PR #75342)

2023-12-13 Thread via lldb-commits

github-actions[bot] wrote:

Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be
notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this 
page.

If this is not working for you, it is probably because you do not have write
permissions for the repository. In which case you can instead tag reviewers by
name in a comment by using `@` followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review
by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate
is once a week. Please remember that you are asking for valuable time from 
other developers.

If you have further questions, they may be answered by the [LLVM GitHub User 
Guide](https://llvm.org/docs/GitHub.html).

You can also ask questions in a comment on this PR, on the [LLVM 
Discord](https://discord.com/invite/xS7Z362) or on the 
[forums](https://discourse.llvm.org/).

https://github.com/llvm/llvm-project/pull/75342
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] Fix lldb-dap pickProcess command for selecting process for debugger attachment (PR #75342)

2023-12-13 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: None (Dodzey)


Changes

Hi,

I see that the documentation for lldb-dap refers to a ${command.pickMyProcess} 
which can be used for interactive process selection within the VS Code IDE. It 
appears that this functionality no longer works, perhaps due to internal 
changes in VS Code.

I can get interactive process selection if I add the following snippet to the 
lldp-dap extension package.json:

```
"variables": {
"pickProcess": "extension.pickNativeProcess"
},
```

However, referencing extension.pickNativeProcess here is only valid if the 
Microsoft VSCode CPPTools extension is installed, as that is the extension that 
registers a native process picker under the name 'extension.pickNativeProcess' 
I'm not sure if it's desirable behaviour for the lldb-dap extension to be 
dependent on the presence of the Microsoft CPPTools extension?

It appears (although I am not familiar with VSCode extension development) that 
any solution to this that was fully integrated in the lldp-dap extension would 
require typescript source to be added to the extension in order to register a 
private native process picker under a custom name - something like 
`extension.lldb-dap.pickNativeProcess`. I would assume that this implementation 
would look very similar, if not identical to the command currently exposed by 
the Microsoft CPPTools extension.

In the PR I have included the minimal changes required to seemingly make the 
process picker work when the Microsoft VSCode CPPTools extension is also 
installed.

What are the recommendations on how we could proceed here?


Thanks!


---
Full diff: https://github.com/llvm/llvm-project/pull/75342.diff


2 Files Affected:

- (modified) lldb/tools/lldb-dap/README.md (+1-1) 
- (modified) lldb/tools/lldb-dap/package.json (+3) 


``diff
diff --git a/lldb/tools/lldb-dap/README.md b/lldb/tools/lldb-dap/README.md
index 00ceb0bedc40a4..d341a136293a87 100644
--- a/lldb/tools/lldb-dap/README.md
+++ b/lldb/tools/lldb-dap/README.md
@@ -125,7 +125,7 @@ The JSON configuration file can contain the following 
`lldb-dap` specific launch
 |**type**   |string  |Y| Must be "lldb-dap".
 |**request**|string  |Y| Must be "attach".
 |**program**|string  | | Path to the executable to attach to. This 
value is optional but can help to resolve breakpoints prior the attaching to 
the program.
-|**pid**|number  | | The process id of the process you wish to 
attach to. If **pid** is omitted, the debugger will attempt to attach to the 
program by finding a process whose file name matches the file name from 
**porgram**. Setting this value to `${command:pickMyProcess}` will allow 
interactive process selection in the IDE.
+|**pid**|number  | | The process id of the process you wish to 
attach to. If **pid** is omitted, the debugger will attempt to attach to the 
program by finding a process whose file name matches the file name from 
**program**. Setting this value to `${command:pickProcess}` will allow 
interactive process selection in the IDE.
 |**stopOnEntry**|boolean| | Whether to stop program immediately after 
launching.
 |**waitFor**|boolean | | Wait for the process to launch.
 |**initCommands**   |[string]| | LLDB commands executed upon debugger startup 
prior to creating the LLDB target. Commands and command output will be sent to 
the debugger console when they are executed.
diff --git a/lldb/tools/lldb-dap/package.json b/lldb/tools/lldb-dap/package.json
index ebb1103d695e17..7b77b32f890a6f 100644
--- a/lldb/tools/lldb-dap/package.json
+++ b/lldb/tools/lldb-dap/package.json
@@ -124,6 +124,9 @@
"swift"
]
},
+   "variables": {
+   "pickProcess": 
"extension.pickNativeProcess"
+   },
"program": "./bin/lldb-dap",
"windows": {
"program": "./bin/lldb-dap.exe"

``




https://github.com/llvm/llvm-project/pull/75342
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] Fix lldb-dap pickProcess command for selecting process for debugger attachment (PR #75342)

2023-12-13 Thread via lldb-commits

https://github.com/Dodzey edited https://github.com/llvm/llvm-project/pull/75342
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] Fix lldb-dap pickProcess command for selecting process for debugger attachment (PR #75342)

2023-12-13 Thread via lldb-commits

https://github.com/Dodzey edited https://github.com/llvm/llvm-project/pull/75342
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] Fix lldb-dap pickProcess command for selecting process for debugger attachment (PR #75342)

2023-12-13 Thread via lldb-commits

https://github.com/Dodzey edited https://github.com/llvm/llvm-project/pull/75342
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] Fix lldb-dap pickProcess command for selecting process for debugger attachment (PR #75342)

2023-12-13 Thread via lldb-commits

https://github.com/Dodzey edited https://github.com/llvm/llvm-project/pull/75342
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] Fix lldb-dap pickProcess command for selecting process for debugger attachment (PR #75342)

2023-12-13 Thread David Spickett via lldb-commits

DavidSpickett wrote:

@clayborg and @walter-erquinigo are lldb-dap code owners and should be able to 
advise.

https://github.com/llvm/llvm-project/pull/75342
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] Fix lldb-dap pickProcess command for selecting process for debugger attachment (PR #75342)

2023-12-13 Thread via lldb-commits

https://github.com/Dodzey edited https://github.com/llvm/llvm-project/pull/75342
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang-tools-extra] [llvm] [openmp] [lldb] [libcxx] [compiler-rt] [libcxxabi] [flang] [clang] [mlir] [MachineCopyPropagation] When the source of PreviousCopy is undef, we cannot replace

2023-12-13 Thread via lldb-commits

https://github.com/DianQK converted_to_draft 
https://github.com/llvm/llvm-project/pull/74682
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang-tools-extra] [llvm] [openmp] [lldb] [libcxx] [compiler-rt] [libcxxabi] [flang] [clang] [mlir] [MachineCopyPropagation] When the source of PreviousCopy is undef, we cannot replace

2023-12-13 Thread via lldb-commits

DianQK wrote:

I tried adding `isCopyLikeInstr` to #75184. All known test cases have passed.

https://github.com/llvm/llvm-project/pull/74682
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang-tools-extra] [llvm] [lldb] [libcxx] [compiler-rt] [libc] [flang] [clang] [lld] [AMDGPU] Use alias info to relax waitcounts for LDS DMA (PR #74537)

2023-12-13 Thread Jay Foad via lldb-commits


@@ -0,0 +1,154 @@
+; RUN: llc -march=amdgcn -mcpu=gfx900 < %s | FileCheck %s 
--check-prefixeses=GCN,GFX9
+; RUN: llc -march=amdgcn -mcpu=gfx1030 < %s | FileCheck %s 
--check-prefixeses=GCN,GFX10

jayfoad wrote:

> --check-prefixeses

That's what happens when you enable `M-x gollum-mode` in Emacs.

https://github.com/llvm/llvm-project/pull/74537
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [LLDB] Add more helper functions to CompilerType class (second try). (PR #73472)

2023-12-13 Thread via lldb-commits

cmtice wrote:

Ping! Could somebody please either approve this PR or tell me what other 
changes they would like to see? Pretty please?

https://github.com/llvm/llvm-project/pull/73472
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [libc] [libcxx] [clang] [mlir] [lldb] [clang-tools-extra] [lld] [llvm] [SVE2.1][Clang][LLVM]Int/FP reduce builtin in Clang and LLVM intrinsic (PR #69926)

2023-12-13 Thread via lldb-commits

https://github.com/CarolineConcatto closed 
https://github.com/llvm/llvm-project/pull/69926
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] Fix lldb-dap pickProcess command for selecting process for debugger attachment (PR #75342)

2023-12-13 Thread Walter Erquinigo via lldb-commits

walter-erquinigo wrote:

@dodzey, thanks for submitting this PR. 
@clayborg  and I have recently been discussing the idea of implementing a 
minimal typescript extension for lldb-dap, which could host the kind of 
functionality that you are trying to fix.
I haven't had yet time to do it, but it's in my TODO list before the end of the 
year.
So, you could either wait for me do submit the minimal TS extension, or you 
could do it yourself if you want! Up to you :)

https://github.com/llvm/llvm-project/pull/75342
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb-dap] Emit more structured info along with variables (PR #75244)

2023-12-13 Thread Walter Erquinigo via lldb-commits


@@ -1103,28 +1116,52 @@ std::string 
CreateUniqueVariableNameForDisplay(lldb::SBValue v,
 //   can use this optional information to present the
 //   children in a paged UI and fetch them in chunks."
 // }
+//
+//
+// // Unofficial extensions to the protocol:
+//

walter-erquinigo wrote:

Good call!

https://github.com/llvm/llvm-project/pull/75244
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] Fix lldb-dap pickProcess command for selecting process for debugger attachment (PR #75342)

2023-12-13 Thread via lldb-commits

Dodzey wrote:

@walter-erquinigo 
Good to hear that I'm on the right track. Would you want the minimal typescript 
extension to be a separate extension from the main lldb-dap one?, or would it 
be okay to have the typescript in the lldb-dap project/extension?
It looks to me from my inspection of how debuggers are handled in the MS CPP 
and node extensions etc that it might be possible to expose the commands for 
the 'lldb-dap' debugger type but have them reside in an entirely separate 
extension if this is desirable. It does make the distribution/manual 
installation steps for the extension a little more complicated though.

Thanks!

https://github.com/llvm/llvm-project/pull/75342
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [llvm] [lldb] [compiler-rt] [libcxx] [clang] [mlir] [lld] [clang-tools-extra] [hwasan] Add `__hwasan_get_tag_from_pointer` (PR #75267)

2023-12-13 Thread Thurston Dang via lldb-commits


@@ -0,0 +1,24 @@
+// RUN: %clangxx_hwasan -O0 %s -o %t && %run %t
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+int main() {
+  auto p = std::make_unique();
+  std::set ptrs;
+  for (unsigned i = 0;; ++i) {
+void *ptr = __hwasan_tag_pointer(p.get(), i);
+if (!ptrs.insert(ptr).second)
+  break;
+fprintf(stderr, "%p, %u, %u\n", ptr, i, 
__hwasan_get_tag_from_pointer(ptr));
+assert(__hwasan_get_tag_from_pointer(ptr) == i);
+  }
+#ifdef __x86_64__
+  assert(ptrs.size() == 8);

thurstond wrote:

Is this assuming aliasing mode with 3-bit tags? If so, can the assumption be 
added to a `// REQUIRES` or similar?

https://github.com/llvm/llvm-project/pull/75267
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [libcxx] [lldb] [mlir] [clang] [compiler-rt] [lld] [llvm] [clang-tools-extra] [hwasan] Add `__hwasan_get_tag_from_pointer` (PR #75267)

2023-12-13 Thread Thurston Dang via lldb-commits

https://github.com/thurstond approved this pull request.


https://github.com/llvm/llvm-project/pull/75267
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lld] [llvm] [clang-tools-extra] [lldb] [mlir] [clang] [libcxx] [compiler-rt] [hwasan] Add `__hwasan_get_tag_from_pointer` (PR #75267)

2023-12-13 Thread Thurston Dang via lldb-commits

https://github.com/thurstond edited 
https://github.com/llvm/llvm-project/pull/75267
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [mlir] [lldb] [clang-tools-extra] [compiler-rt] [libcxx] [lld] [llvm] [libc] [flang] [openmp] [libcxxabi] [clang] [libc++] Fix `take_view::__sentinel`'s `operator==` (PR #74655)

2023-12-13 Thread Jakub Mazurkiewicz via lldb-commits

JMazurkiewicz wrote:

@huixie90 CI is *almost* green (Android failure is probably unrelated).

https://github.com/llvm/llvm-project/pull/74655
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [llvm] [DO NOT MERGE][DebugInfo] Implement debug_names's IDX_parent attribute (PR #75365)

2023-12-13 Thread Felipe de Azevedo Piovezan via lldb-commits

https://github.com/felipepiovezan created 
https://github.com/llvm/llvm-project/pull/75365

The commits are meant to be looked at one at a time

>From ece936d56a22dad7f604d6610d02a9a59bac0345 Mon Sep 17 00:00:00 2001
From: Felipe de Azevedo Piovezan 
Date: Mon, 11 Dec 2023 12:42:40 -0300
Subject: [PATCH 1/9] [DWARFDeclContext] Add helper function to extract
 qualified names as vector

squash_23540ceb4639
---
 lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.cpp | 6 ++
 lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h   | 5 +
 2 files changed, 11 insertions(+)

diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.cpp 
b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.cpp
index 44421c0eda3eec..3cdb47d50bbfc0 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.cpp
@@ -55,6 +55,12 @@ const char *DWARFDeclContext::GetQualifiedName() const {
   return m_qualified_name.c_str();
 }
 
+llvm::SmallVector
+DWARFDeclContext::GetQualifiedNameAsVector() const {
+  return llvm::to_vector_of(
+  llvm::map_range(m_entries, GetName));
+}
+
 bool DWARFDeclContext::operator==(const DWARFDeclContext &rhs) const {
   if (m_entries.size() != rhs.m_entries.size())
 return false;
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h 
b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h
index a20a862d340296..40ebb72c91d8f0 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h
@@ -68,6 +68,11 @@ class DWARFDeclContext {
 
   const char *GetQualifiedName() const;
 
+  /// Returns a vector of string, one string per entry in the fully qualified
+  /// name. For example, for the name `A::B::C`, this methods returns `{"A",
+  /// "B", "C"}`
+  llvm::SmallVector GetQualifiedNameAsVector() const;
+
   // Same as GetQualifiedName, but the life time of the returned string will
   // be that of the LLDB session.
   ConstString GetQualifiedNameAsConstString() const {

>From 81b7009a751430593a6e20aba5dd677ca5ffebe9 Mon Sep 17 00:00:00 2001
From: Felipe de Azevedo Piovezan 
Date: Wed, 6 Dec 2023 11:26:18 -0800
Subject: [PATCH 2/9] [DebugNames] Implement DW_IDX_parent entries

squash_81501dd8dcd1
---
 llvm/include/llvm/CodeGen/AccelTable.h| 24 --
 llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp| 46 +--
 llvm/lib/DWARFLinker/DWARFLinker.cpp  |  8 
 .../DWARFLinkerParallel/DWARFLinkerImpl.cpp   |  3 +-
 .../lib/DWARFLinkerParallel/DWARFLinkerUnit.h |  3 ++
 5 files changed, 74 insertions(+), 10 deletions(-)

diff --git a/llvm/include/llvm/CodeGen/AccelTable.h 
b/llvm/include/llvm/CodeGen/AccelTable.h
index 0f35fd3514fae7..b6662232ce5137 100644
--- a/llvm/include/llvm/CodeGen/AccelTable.h
+++ b/llvm/include/llvm/CodeGen/AccelTable.h
@@ -262,9 +262,12 @@ class DWARF5AccelTableData : public AccelTableData {
 
   DWARF5AccelTableData(const DIE &Die, const uint32_t UnitID,
const bool IsTU = false);
-  DWARF5AccelTableData(const uint64_t DieOffset, const unsigned DieTag,
-   const unsigned UnitID, const bool IsTU = false)
-  : OffsetVal(DieOffset), DieTag(DieTag), UnitID(UnitID), IsTU(IsTU) {}
+  DWARF5AccelTableData(const uint64_t DieOffset,
+   const std::optional ParentOffset,
+   const unsigned DieTag, const unsigned UnitID,
+   const bool IsTU = false)
+  : OffsetVal(DieOffset), ParentOffset(ParentOffset), DieTag(DieTag),
+UnitID(UnitID), IsTU(IsTU) {}
 
 #ifndef NDEBUG
   void print(raw_ostream &OS) const override;
@@ -281,14 +284,24 @@ class DWARF5AccelTableData : public AccelTableData {
   void normalizeDIEToOffset() {
 assert(std::holds_alternative(OffsetVal) &&
"Accessing offset after normalizing.");
-OffsetVal = std::get(OffsetVal)->getOffset();
+const DIE *Entry = std::get(OffsetVal);
+ParentOffset = Entry->getParent() ? Entry->getParent()->getOffset()
+  : std::optional();
+OffsetVal = Entry->getOffset();
   }
   bool isNormalized() const {
 return std::holds_alternative(OffsetVal);
   }
 
+  std::optional getParentDieOffset() const {
+assert(std::holds_alternative(OffsetVal) &&
+   "Accessing DIE Offset before normalizing.");
+return ParentOffset;
+  }
+
 protected:
   std::variant OffsetVal;
+  std::optional ParentOffset;
   uint32_t DieTag : 16;
   uint32_t UnitID : 15;
   uint32_t IsTU : 1;
@@ -337,7 +350,8 @@ class DWARF5AccelTable : public 
AccelTable {
 for (auto &Entry : Table.getEntries()) {
   for (AccelTableData *Value : Entry.second.Values) {
 DWARF5AccelTableData *Data = static_cast(Value);
-addName(Entry.second.Name, Data->getDieOffset(), Data->getDieTag(),
+addName(Entry.second.Name, Data->getDieOffset(),
+Data->

[Lldb-commits] [lldb] [llvm] [DO NOT MERGE][DebugInfo] Implement debug_names's IDX_parent attribute (PR #75365)

2023-12-13 Thread Felipe de Azevedo Piovezan via lldb-commits

https://github.com/felipepiovezan edited 
https://github.com/llvm/llvm-project/pull/75365
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [llvm] [DO NOT MERGE][DebugInfo] Implement debug_names's IDX_parent attribute (PR #75365)

2023-12-13 Thread via lldb-commits

github-actions[bot] wrote:




:warning: C/C++ code formatter, clang-format found issues in your code. 
:warning:



You can test this locally with the following command:


``bash
git-clang-format --diff 40e2bb5330840b56d452244f96e491b6530ce4bf 
4d3fa42597ae39f41dc338cec1489d885f34eec7 -- 
lldb/source/Commands/CommandObjectExpression.cpp 
lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp 
lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h 
lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.cpp 
lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h 
lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.cpp 
lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.h 
lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp 
lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h 
lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp 
lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h 
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp 
llvm/include/llvm/CodeGen/AccelTable.h 
llvm/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h 
llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp llvm/lib/DWARFLinker/DWARFLinker.cpp 
llvm/lib/DWARFLinkerParallel/DWARFLinkerImpl.cpp 
llvm/lib/DWARFLinkerParallel/DWARFLinkerUnit.h 
llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp
``





View the diff from clang-format here.


``diff
diff --git a/lldb/source/Commands/CommandObjectExpression.cpp 
b/lldb/source/Commands/CommandObjectExpression.cpp
index 59ea097fe8..0bff699be7 100644
--- a/lldb/source/Commands/CommandObjectExpression.cpp
+++ b/lldb/source/Commands/CommandObjectExpression.cpp
@@ -517,7 +517,8 @@ bool 
CommandObjectExpression::EvaluateExpression(llvm::StringRef expr,
   }
 
   auto end = std::chrono::steady_clock::now();
-  auto duration = std::chrono::duration_cast(end - 
start);
+  auto duration =
+  std::chrono::duration_cast(end - start);
   error_stream.Printf("Finished expr in: %" PRIu64, duration.count());
   return (success != eExpressionSetupError &&
   success != eExpressionParseError);
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp 
b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
index 775b7a2e73..340b9acf80 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
@@ -192,9 +192,8 @@ DWARFDebugInfo::GetDIE(const DIERef &die_ref) {
   return DWARFDIE(); // Not found
 }
 
-llvm::StringRef
-DWARFDebugInfo::PeekDIEName(const DIERef &die_ref) {
-  if(DWARFUnit *cu = GetUnit(die_ref))
+llvm::StringRef DWARFDebugInfo::PeekDIEName(const DIERef &die_ref) {
+  if (DWARFUnit *cu = GetUnit(die_ref))
 return cu->GetNonSkeletonUnit().PeekDIEName(die_ref.die_offset());
   return llvm::StringRef();
 }

``




https://github.com/llvm/llvm-project/pull/75365
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] Fix lldb-dap pickProcess command for selecting process for debugger attachment (PR #75342)

2023-12-13 Thread Greg Clayton via lldb-commits

https://github.com/clayborg approved this pull request.

This looks good to me for now. We can coordinate on adding a native TypeScript 
layer after this, but no need to hold this up if this work!

https://github.com/llvm/llvm-project/pull/75342
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [llvm] [clang] [compiler-rt] [lldb] [libcxx] [mlir] [clang-tools-extra] [lld] [hwasan] Add `__hwasan_get_tag_from_pointer` (PR #75267)

2023-12-13 Thread Vitaly Buka via lldb-commits


@@ -0,0 +1,24 @@
+// RUN: %clangxx_hwasan -O0 %s -o %t && %run %t
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+int main() {
+  auto p = std::make_unique();
+  std::set ptrs;
+  for (unsigned i = 0;; ++i) {
+void *ptr = __hwasan_tag_pointer(p.get(), i);
+if (!ptrs.insert(ptr).second)
+  break;
+fprintf(stderr, "%p, %u, %u\n", ptr, i, 
__hwasan_get_tag_from_pointer(ptr));
+assert(__hwasan_get_tag_from_pointer(ptr) == i);
+  }
+#ifdef __x86_64__
+  assert(ptrs.size() == 8);

vitalybuka wrote:

REQUIRES will disable the test completely. 
I guess we will update ifdef when we (or someone else) will have LAM

https://github.com/llvm/llvm-project/pull/75267
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] Fix lldb-dap pickProcess command for selecting process for debugger attachment (PR #75342)

2023-12-13 Thread Jonas Devlieghere via lldb-commits

https://github.com/JDevlieghere approved this pull request.

LGTM. Since @Dodzey is a first-time contributor one of us needs to click the 
merge button. I'll leave that to @clayborg or @walter-erquinigo as the owners. 

https://github.com/llvm/llvm-project/pull/75342
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] Make only one function that needs to be implemented when searching for types (PR #74786)

2023-12-13 Thread Greg Clayton via lldb-commits

clayborg wrote:

> I merged your fix and a few follow ups to get it all to compile. Now we have 
> 2 failures on Windows: 
> https://lab.llvm.org/buildbot/#/builders/219/builds/7554/steps/6/logs/stdio
> 
> ```
> Failed Tests (2):
>   lldb-api :: lang/cpp/unique-types4/TestUniqueTypes4.py
>   lldb-unit :: 
> SymbolFile/PDB/./SymbolFilePDBTests.exe/SymbolFilePDBTests/TestMaxMatches
> ```
For TestUniqueTypes4.py, it is failing with a expression error, probably 
because a type lookup failed where it used to succeed.

TestMaxMatches will need to be debugged a bit. It used to find all of the types 
first, and then try to find a max of 1 through 10 types after that. Now with 
type queries, you get only one or all types (no one was using a max value for 
types other than 1 or all before). I did my best to try and code it up, but I 
have no ability to run the test to verify it works or debug it. Any help here 
would be appreciated. I do two type queries in the test where I grab all types 
and we expect more than one match, and then one where we try to find just one 
and then verify we got only one from the type map.


> 
> Which I can look into but not today.
> 
> Is it expected that results would change here? Seems like a refactor but I 
> don't have much context.

Yeah, I don't have the ability yet to debug on windows. I am working on getting 
a VM based solution running now.

The new function `SymbolFilePDB::FindTypes(...)` that replaces the old one 
needs to be debugged. I took a guess at what would work, but not sure I got it 
right. Any help debugging this would be very much appreciated. This patch is a 
HUGE perf win, so it is worth making sure we can keep this in and making it 
work. If we need to expected fail the python test on window until we can look 
into it, I would vote to do this. And also fixing TextMaxMatches by commenting 
out this test for now until we can debug it would be a good option. With the 
supposition that we get this fixed within a week for both.

https://github.com/llvm/llvm-project/pull/74786
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] Make only one function that needs to be implemented when searching for types (PR #74786)

2023-12-13 Thread Greg Clayton via lldb-commits

clayborg wrote:

Debugging the SymbolFilePDBTests function would be the easiest way to reproduce 
and if the `TestMaxMatches` gets fixed, it might fix the other failing python 
test.

https://github.com/llvm/llvm-project/pull/74786
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [LLDB] Add more helper functions to CompilerType class (second try). (PR #73472)

2023-12-13 Thread Alex Langford via lldb-commits

https://github.com/bulbazord commented:

Seems okay to me... Quick question: Why do you need 
`CompilerType::GetTemplateArgumentType`? This seems pretty specific to C++. Is 
there a more general concept we could capture? Like something related to 
"Generics"?

https://github.com/llvm/llvm-project/pull/73472
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [mlir] [lld] [clang-tools-extra] [llvm] [lldb] [clang] [compiler-rt] [libcxx] [hwasan] Add `__hwasan_get_tag_from_pointer` (PR #75267)

2023-12-13 Thread Vitaly Buka via lldb-commits

https://github.com/vitalybuka updated 
https://github.com/llvm/llvm-project/pull/75267

>From 7fa7ea4786d3c8244aff575d3147d421c761e02a Mon Sep 17 00:00:00 2001
From: Vitaly Buka 
Date: Tue, 12 Dec 2023 17:01:54 -0800
Subject: [PATCH 1/3] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20ch?=
 =?UTF-8?q?anges=20to=20main=20this=20commit=20is=20based=20on?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Created using spr 1.3.4

[skip ci]
---
 .../TestCases/Posix/fork_threaded.cpp | 86 +++
 .../sanitizer_common/sanitizer_specific.h | 16 
 2 files changed, 102 insertions(+)
 create mode 100644 
compiler-rt/test/sanitizer_common/TestCases/Posix/fork_threaded.cpp

diff --git 
a/compiler-rt/test/sanitizer_common/TestCases/Posix/fork_threaded.cpp 
b/compiler-rt/test/sanitizer_common/TestCases/Posix/fork_threaded.cpp
new file mode 100644
index 00..72a2f78a5a3e77
--- /dev/null
+++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/fork_threaded.cpp
@@ -0,0 +1,86 @@
+// RUN: %clangxx -O0 %s -o %t && %env_tool_opts=die_after_fork=0 %run %t
+
+// UNSUPPORTED: asan, lsan, hwasan
+
+// Forking in multithread environment is unsupported. However we already have
+// some workarounds, and will add more, so this is the test.
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "sanitizer_common/sanitizer_specific.h"
+
+static const size_t kBufferSize = 1 << 20;
+
+static void *background(void *arg) { return nullptr; }
+
+pthread_barrier_t bar;
+
+void CanDeadLock() {
+  // Don't bother with leaks, we try to trigger allocator or lsan deadlock.
+  __lsan::ScopedDisabler disable;
+  char *volatile p = new char[10];
+  __lsan_do_recoverable_leak_check();
+  delete[] p;
+}
+
+// Prevent stack buffer cleanup by instrumentation.
+#define NOSAN __attribute__((no_sanitize("address", "hwaddress", "memory")))
+
+NOSAN static void *inparent(void *arg) {
+  fprintf(stderr, "inparent %d\n", gettid());
+
+  char t[kBufferSize];
+  make_mem_bad(t, sizeof(t));
+
+  pthread_barrier_wait(&bar);
+
+  for (;;)
+CanDeadLock();
+
+  return 0;
+}
+
+NOSAN static void *inchild(void *arg) {
+  char t[kBufferSize];
+  check_mem_is_good(t, sizeof(t));
+  CanDeadLock();
+  return 0;
+}
+
+int main(void) {
+  pid_t pid;
+
+  pthread_barrier_init(&bar, nullptr, 2);
+  pthread_t thread_id;
+  while (pthread_create(&thread_id, 0, &inparent, 0) != 0) {
+  }
+  pthread_barrier_wait(&bar);
+
+  pid = fork();
+  switch (pid) {
+  case -1:
+perror("fork");
+return -1;
+  case 0:
+while (pthread_create(&thread_id, 0, &inchild, 0) != 0) {
+}
+break;
+  default: {
+fprintf(stderr, "fork %d\n", pid);
+int status;
+while (waitpid(-1, &status, __WALL) != pid) {
+}
+assert(WIFEXITED(status) && WEXITSTATUS(status) == 0);
+break;
+  }
+  }
+
+  return 0;
+}
diff --git a/compiler-rt/test/sanitizer_common/sanitizer_specific.h 
b/compiler-rt/test/sanitizer_common/sanitizer_specific.h
index 1a802020cfd668..963d91cb305f60 100644
--- a/compiler-rt/test/sanitizer_common/sanitizer_specific.h
+++ b/compiler-rt/test/sanitizer_common/sanitizer_specific.h
@@ -1,6 +1,12 @@
 #ifndef __SANITIZER_COMMON_SANITIZER_SPECIFIC_H__
 #define __SANITIZER_COMMON_SANITIZER_SPECIFIC_H__
 
+#include 
+
+__attribute__((weak)) int __lsan_do_recoverable_leak_check() { return 0; }
+__attribute__((weak)) void __lsan_disable(void) {}
+__attribute__((weak)) void __lsan_enable(void) {}
+
 #ifndef __has_feature
 #  define __has_feature(x) 0
 #endif
@@ -10,6 +16,8 @@
 static void check_mem_is_good(void *p, size_t s) {
   __msan_check_mem_is_initialized(p, s);
 }
+static void make_mem_good(void *p, size_t s) { __msan_unpoison(p, s); }
+static void make_mem_bad(void *p, size_t s) { __msan_poison(p, s); }
 #elif __has_feature(address_sanitizer)
 #  include 
 #  include 
@@ -17,8 +25,16 @@ static void check_mem_is_good(void *p, size_t s) {
   if (__asan_region_is_poisoned(p, s))
 abort();
 }
+static void make_mem_good(void *p, size_t s) {
+  __asan_unpoison_memory_region(p, s);
+}
+static void make_mem_bad(void *p, size_t s) {
+  __asan_poison_memory_region(p, s);
+}
 #else
 static void check_mem_is_good(void *p, size_t s) {}
+static void make_mem_good(void *p, size_t s) {}
+static void make_mem_bad(void *p, size_t s) {}
 #endif
 
 #endif // __SANITIZER_COMMON_SANITIZER_SPECIFIC_H__
\ No newline at end of file

>From 6ed9198c136ead9c6726e5bfd83978e891522f5b Mon Sep 17 00:00:00 2001
From: Vitaly Buka 
Date: Tue, 12 Dec 2023 17:09:19 -0800
Subject: [PATCH 2/3] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20ch?=
 =?UTF-8?q?anges=20introduced=20through=20rebase?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Created using spr 1.3.4

[skip ci]
---
 compiler-rt/test/sanitizer_common/sanitizer_specific.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compiler-rt/

[Lldb-commits] [clang] [lld] [libcxxabi] [libunwind] [mlir] [clang-tools-extra] [compiler-rt] [lldb] [flang] [llvm] [libcxx] [libc] [libc++] Implement ranges::contains (PR #65148)

2023-12-13 Thread via lldb-commits

https://github.com/ZijunZhaoCCK updated 
https://github.com/llvm/llvm-project/pull/65148

>From 02e9afd761228f401df4d9f8dfaaca44ffae0c6e Mon Sep 17 00:00:00 2001
From: zijunzhao 
Date: Thu, 31 Aug 2023 20:08:32 +
Subject: [PATCH 01/22] [libc++] Implement ranges::contains

Differential Revision: https://reviews.llvm.org/D159232
---
 libcxx/include/CMakeLists.txt |   1 +
 libcxx/include/__algorithm/ranges_contains.h  |  60 ++
 libcxx/include/algorithm  |   9 +
 ...obust_against_copying_projections.pass.cpp |   4 +
 .../alg.contains/ranges.contains.pass.cpp | 190 ++
 .../niebloid.compile.pass.cpp |   1 +
 6 files changed, 265 insertions(+)
 create mode 100644 libcxx/include/__algorithm/ranges_contains.h
 create mode 100644 
libcxx/test/std/algorithms/alg.nonmodifying/alg.contains/ranges.contains.pass.cpp

diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt
index 77a7269121ec14..024aa8959fb720 100644
--- a/libcxx/include/CMakeLists.txt
+++ b/libcxx/include/CMakeLists.txt
@@ -104,6 +104,7 @@ set(files
   __algorithm/ranges_any_of.h
   __algorithm/ranges_binary_search.h
   __algorithm/ranges_clamp.h
+  __algorithm/ranges_contains.h
   __algorithm/ranges_copy.h
   __algorithm/ranges_copy_backward.h
   __algorithm/ranges_copy_if.h
diff --git a/libcxx/include/__algorithm/ranges_contains.h 
b/libcxx/include/__algorithm/ranges_contains.h
new file mode 100644
index 00..647b7ea34be342
--- /dev/null
+++ b/libcxx/include/__algorithm/ranges_contains.h
@@ -0,0 +1,60 @@
+//===--===//
+//
+// 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 _LIBCPP___ALGORITHM_RANGES_CONTAINS_H
+#define _LIBCPP___ALGORITHM_RANGES_CONTAINS_H
+
+#include <__algorithm/in_in_result.h>
+#include <__algorithm/ranges_find.h>
+#include <__config>
+#include <__functional/identity.h>
+#include <__functional/ranges_operations.h>
+#include <__functional/reference_wrapper.h>
+#include <__iterator/concepts.h>
+#include <__iterator/indirectly_comparable.h>
+#include <__iterator/projected.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.h>
+#include <__utility/move.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+#if _LIBCPP_STD_VER >= 23
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+namespace ranges {
+namespace __contains {
+struct __fn {
+  template  _Sent, class _Type, 
class _Proj = identity>
+requires indirect_binary_predicate, const _Type*>
+  _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool
+  operator()(_Iter __first, _Sent __last, const _Type& __value, _Proj __proj = 
{}) const {
+return ranges::find(std::move(__first), std::move(__last), __value, 
std::ref(__proj)) != __last;
+  }
+
+  template 
+requires indirect_binary_predicate, _Proj>, const _Type*>
+  _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool
+  operator()(_Range&& __range, const _Type& __value, _Proj __proj = {}) const {
+return ranges::find(ranges::begin(__range), ranges::end(__range), __value, 
std::ref(__proj)) != ranges::end(__range);
+  }
+};
+} // namespace __contains
+inline namespace __cpo {
+inline constexpr auto contains = __contains::__fn{};
+} // namespace __cpo
+} // namespace ranges
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_STD_VER >= 23
+
+#endif // _LIBCPP___ALGORITHM_RANGES_CONTAINS_H
diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm
index 76e0d22bf73ef8..003bf132b38b4d 100644
--- a/libcxx/include/algorithm
+++ b/libcxx/include/algorithm
@@ -226,6 +226,14 @@ namespace ranges {
   template
 using copy_backward_result = in_out_result;
 // since C++20
 
+  template S, class T, class Proj = identity>
+requires indirect_binary_predicate, 
const T*>
+constexpr bool ranges::contains(I first, S last, const T& value, Proj proj 
= {});   // since C++23
+
+  template
+requires indirect_binary_predicate, Proj>, const T*>
+constexpr bool ranges::contains(R&& r, const T& value, Proj proj = {});
 // since C++23
+
   template S, weakly_incrementable O>
 requires indirectly_copyable
 constexpr ranges::copy_result ranges::copy(I first, S last, O 
result);// since C++20
@@ -1827,6 +1835,7 @@ template 
 #include <__algorithm/ranges_any_of.h>
 #include <__algorithm/ranges_binary_search.h>
 #include <__algorithm/ranges_clamp.h>
+#include <__algorithm/ranges_contains.h>
 #include <__algorithm/ranges_copy.h>
 #include <__algorithm/ranges_copy_backward.h>
 #include <__algorithm/ranges_copy_if.h>
diff --git 
a/libcxx/test/libcxx/algorithms/ranges_robust_against_copying

[Lldb-commits] [lldb] Fix lldb-dap pickProcess command for selecting process for debugger attachment (PR #75342)

2023-12-13 Thread via lldb-commits

Dodzey wrote:

@clayborg  Yes, it appears to. For context my workflow is C++ development, 
using recent versions of Clang and GCC. In VS Code I use the Microsoft CPPTools 
extension to allow for GDB debugging of GCC builds, with intellisense disabled. 
I am using clangd for auto-completion, inlay hints, automatic compiler 
errors/warning squiggles etc. That combination means that I have the Microsoft 
CPPTools extension enabled, which is enough for the 'workaround' here to be 
functional. I've tested launching the debugger twice within VSCode and using 
the process selection dropdown picker attaching to two copies of the same 
executable running at the same time. Both debuggers seem to be working ok and 
operating concurrently as you would expect.

https://github.com/llvm/llvm-project/pull/75342
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lld] [openmp] [libcxx] [lldb] [libc] [llvm] [compiler-rt] [mlir] [clang-tools-extra] [clang] [flang] [libcxxabi] [libc++] Fix `take_view::__sentinel`'s `operator==` (PR #74655)

2023-12-13 Thread via lldb-commits

https://github.com/huixie90 closed 
https://github.com/llvm/llvm-project/pull/74655
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [lld] [clang-tools-extra] [compiler-rt] [lldb] [flang] [llvm] [libcxx] [libc] [AMDGPU] Use alias info to relax waitcounts for LDS DMA (PR #74537)

2023-12-13 Thread Stanislav Mekhanoshin via lldb-commits

https://github.com/rampitec updated 
https://github.com/llvm/llvm-project/pull/74537

>From 7e382620cdc5999c645ed0746f242595f0294c58 Mon Sep 17 00:00:00 2001
From: Stanislav Mekhanoshin 
Date: Mon, 4 Dec 2023 16:11:53 -0800
Subject: [PATCH 1/7] [AMDGPU] Use alias info to relax waitcounts for LDS DMA

LDA DMA loads increase VMCNT and a load from the LDS stored must
wait on this counter to only read memory after it is written.
Wait count insertion pass does not track memory dependencies, it
tracks register dependencies. To model the LDS dependency a
psuedo register is used in the scoreboard, acting like if LDS DMA
writes it and LDS load reads it.

This patch adds 8 more pseudo registers to use for independent LDS
locations if we can prove they are disjoint using alias analysis.

Fixes: SWDEV-433427
---
 llvm/lib/Target/AMDGPU/SIISelLowering.cpp   |  16 +-
 llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp |  73 +-
 llvm/lib/Target/AMDGPU/SIInstrInfo.cpp  |   4 +-
 llvm/lib/Target/AMDGPU/SIInstrInfo.h|   8 +
 llvm/lib/Target/AMDGPU/lds-dma-waits.ll | 154 
 llvm/test/CodeGen/AMDGPU/llc-pipeline.ll|   2 +
 6 files changed, 241 insertions(+), 16 deletions(-)
 create mode 100644 llvm/lib/Target/AMDGPU/lds-dma-waits.ll

diff --git a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp 
b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
index a7f4d63229b7ef..2e079404b087fa 100644
--- a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+++ b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
@@ -1128,11 +1128,10 @@ bool SITargetLowering::getTgtMemIntrinsic(IntrinsicInfo 
&Info,
 MachineMemOperand::MOStore |
 MachineMemOperand::MODereferenceable;
 
-  // XXX - Should this be volatile without known ordering?
-  Info.flags |= MachineMemOperand::MOVolatile;
-
   switch (IntrID) {
   default:
+// XXX - Should this be volatile without known ordering?
+Info.flags |= MachineMemOperand::MOVolatile;
 break;
   case Intrinsic::amdgcn_raw_buffer_load_lds:
   case Intrinsic::amdgcn_raw_ptr_buffer_load_lds:
@@ -1140,6 +1139,7 @@ bool SITargetLowering::getTgtMemIntrinsic(IntrinsicInfo 
&Info,
   case Intrinsic::amdgcn_struct_ptr_buffer_load_lds: {
 unsigned Width = 
cast(CI.getArgOperand(2))->getZExtValue();
 Info.memVT = EVT::getIntegerVT(CI.getContext(), Width * 8);
+Info.ptrVal = CI.getArgOperand(1);
 return true;
   }
   }
@@ -1268,8 +1268,8 @@ bool SITargetLowering::getTgtMemIntrinsic(IntrinsicInfo 
&Info,
 Info.opc = ISD::INTRINSIC_VOID;
 unsigned Width = cast(CI.getArgOperand(2))->getZExtValue();
 Info.memVT = EVT::getIntegerVT(CI.getContext(), Width * 8);
-Info.flags |= MachineMemOperand::MOLoad | MachineMemOperand::MOStore |
-  MachineMemOperand::MOVolatile;
+Info.ptrVal = CI.getArgOperand(1);
+Info.flags |= MachineMemOperand::MOLoad | MachineMemOperand::MOStore;
 return true;
   }
   case Intrinsic::amdgcn_ds_bvh_stack_rtn: {
@@ -9084,7 +9084,9 @@ SDValue SITargetLowering::LowerINTRINSIC_VOID(SDValue Op,
 MachinePointerInfo LoadPtrI = LoadMMO->getPointerInfo();
 
 MachinePointerInfo StorePtrI = LoadPtrI;
-StorePtrI.V = nullptr;
+LoadPtrI.V = UndefValue::get(
+PointerType::get(*DAG.getContext(), AMDGPUAS::GLOBAL_ADDRESS));
+LoadPtrI.AddrSpace = AMDGPUAS::GLOBAL_ADDRESS;
 StorePtrI.AddrSpace = AMDGPUAS::LOCAL_ADDRESS;
 
 auto F = LoadMMO->getFlags() &
@@ -9162,6 +9164,8 @@ SDValue SITargetLowering::LowerINTRINSIC_VOID(SDValue Op,
 MachinePointerInfo LoadPtrI = LoadMMO->getPointerInfo();
 LoadPtrI.Offset = Op->getConstantOperandVal(5);
 MachinePointerInfo StorePtrI = LoadPtrI;
+LoadPtrI.V = UndefValue::get(
+PointerType::get(*DAG.getContext(), AMDGPUAS::GLOBAL_ADDRESS));
 LoadPtrI.AddrSpace = AMDGPUAS::GLOBAL_ADDRESS;
 StorePtrI.AddrSpace = AMDGPUAS::LOCAL_ADDRESS;
 auto F = LoadMMO->getFlags() &
diff --git a/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp 
b/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
index ede4841b8a5fd7..50ad22130e939e 100644
--- a/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
+++ b/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
@@ -31,6 +31,7 @@
 #include "llvm/ADT/MapVector.h"
 #include "llvm/ADT/PostOrderIterator.h"
 #include "llvm/ADT/Sequence.h"
+#include "llvm/Analysis/AliasAnalysis.h"
 #include "llvm/CodeGen/MachineLoopInfo.h"
 #include "llvm/CodeGen/MachinePostDominators.h"
 #include "llvm/InitializePasses.h"
@@ -121,8 +122,13 @@ enum RegisterMapping {
   SQ_MAX_PGM_VGPRS = 512, // Maximum programmable VGPRs across all targets.
   AGPR_OFFSET = 256,  // Maximum programmable ArchVGPRs across all targets.
   SQ_MAX_PGM_SGPRS = 256, // Maximum programmable SGPRs across all targets.
-  NUM_EXTRA_VGPRS = 1,// A reserved slot for DS.
-  EXTRA_VGPR_LDS = 0, // An artificial register to track LDS writes.
+  NUM_EXTRA_VGPRS = 9,// Reserved slots f

[Lldb-commits] [mlir] [lld] [llvm] [clang] [lldb] [clang-tools-extra] [compiler-rt] [libcxx] [hwasan] Add `__hwasan_get_tag_from_pointer` (PR #75267)

2023-12-13 Thread Vitaly Buka via lldb-commits

https://github.com/vitalybuka closed 
https://github.com/llvm/llvm-project/pull/75267
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [llvm] [libc] [libunwind] [flang] [lld] [compiler-rt] [libcxx] [clang] [libcxxabi] [clang-tools-extra] [lsan] Install `pthread_atfork` (PR #75281)

2023-12-13 Thread Vitaly Buka via lldb-commits

https://github.com/vitalybuka edited 
https://github.com/llvm/llvm-project/pull/75281
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] Add a test for evicting unreachable modules from the global module cache (PR #74894)

2023-12-13 Thread via lldb-commits

jimingham wrote:

Nothing that test does should cause a crash.  It's fine to revert for 
investigation, but it seems like a good test in that it is uncovering a real 
bug (though not the one intended).

Jim


> On Dec 13, 2023, at 3:34 AM, David Spickett ***@***.***> wrote:
> 
> 
> This test crashes on Arm and AArch64:
> 
>  TEST 'lldb-api :: 
> python_api/global_module_cache/TestGlobalModuleCache.py' FAILED 
> 
> Script:
> --
> /usr/bin/python3.8 
> /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/API/dotest.py
>  -u CXXFLAGS -u CFLAGS --env ARCHIVER=/usr/local/bin/llvm-ar --env 
> OBJCOPY=/usr/bin/llvm-objcopy --env 
> LLVM_LIBS_DIR=/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./lib 
> --env 
> LLVM_INCLUDE_DIR=/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/include 
> --env 
> LLVM_TOOLS_DIR=/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./bin 
> --arch aarch64 --build-dir 
> /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lldb-test-build.noindex 
> --lldb-module-cache-dir 
> /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lldb-test-build.noindex/module-cache-lldb/lldb-api
>  --clang-module-cache-dir 
> /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lldb-test-build.noindex/module-cache-clang/lldb-api
>  --executable /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./bin/lldb 
> --compiler /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./bin/clang 
> --dsymutil 
> /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./bin/dsymutil 
> --llvm-tools-dir /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./bin 
> --lldb-libs-dir /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./lib 
> /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/API/python_api/global_module_cache
>  -p TestGlobalModuleCache.py
> --
> Exit Code: -6
> 
> Command Output (stdout):
> --
> lldb version 18.0.0git (https://github.com/llvm/llvm-project.git revision 
> bb18611e3630d956b74fe33209321cb8ba9272a8)
>   clang revision bb18611e3630d956b74fe33209321cb8ba9272a8
>   llvm revision bb18611e3630d956b74fe33209321cb8ba9272a8
> 
> --
> Command Output (stderr):
> --
> python3.8: ../llvm-project/lldb/source/Target/ThreadPlanStack.cpp:151: 
> lldb::ThreadPlanSP lldb_private::ThreadPlanStack::PopPlan(): Assertion 
> `m_plans.size() > 1 && "Can't pop the base thread plan"' failed.
> PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ 
> and include the crash backtrace.
>  #0 0x7f3d8d60 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) 
> (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lib/python3.8/site-packages/lldb/_lldb.cpython-38-aarch64-linux-gnu.so+0x51d7d60)
>  #1 0x7f3d6d1c llvm::sys::RunSignalHandlers() 
> (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lib/python3.8/site-packages/lldb/_lldb.cpython-38-aarch64-linux-gnu.so+0x51d5d1c)
>  #2 0x7f3d9494 SignalHandler(int) 
> (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lib/python3.8/site-packages/lldb/_lldb.cpython-38-aarch64-linux-gnu.so+0x51d8494)
>  #3 0x85fee7dc (linux-vdso.so.1+0x7dc)
>  #4 0x85e7cd78 raise 
> /build/glibc-RIFKjK/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
>  #5 0x85e69aac abort 
> /build/glibc-RIFKjK/glibc-2.31/stdlib/abort.c:81:7
>  #6 0x85e76490 __assert_fail_base 
> /build/glibc-RIFKjK/glibc-2.31/assert/assert.c:89:7
>  #7 0x85e764f4 (/lib/aarch64-linux-gnu/libc.so.6+0x2d4f4)
>  #8 0x7ef6f744 lldb_private::ThreadPlanStack::PopPlan() 
> (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lib/python3.8/site-packages/lldb/_lldb.cpython-38-aarch64-linux-gnu.so+0x4d6e744)
>  #9 0x7ef482f8 lldb_private::Thread::PopPlan() 
> (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lib/python3.8/site-packages/lldb/_lldb.cpython-38-aarch64-linux-gnu.so+0x4d472f8)
> #10 0x7ef47ca8 lldb_private::Thread::ShouldStop(lldb_private::Event*) 
> (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lib/python3.8/site-packages/lldb/_lldb.cpython-38-aarch64-linux-gnu.so+0x4d46ca8)
> #11 0x7ef544c8 
> lldb_private::ThreadList::ShouldStop(lldb_private::Event*) 
> (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lib/python3.8/site-packages/lldb/_lldb.cpython-38-aarch64-linux-gnu.so+0x4d534c8)
> #12 0x7eed3c30 
> lldb_private::Process::ShouldBroadcastEvent(lldb_private::Event*) 
> (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lib/python3.8/site-packages/lldb/_lldb.cpython-38-aarch64-linux-gnu.so+0x4cd2c30)
> #13 0x7eecd220 
> lldb_private::Process::HandlePrivateEvent(std::shared_ptr&)
>  
> (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lib/python3.8/site-packages/lldb/_lldb.cpython-38-aarch64-linux-gnu.so+0x4ccc220)
> #14 0x7eed4eb4 lldb_private::Process::RunPrivateStateThread(bool) 
> (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lib/python3.8/site-package

[Lldb-commits] [libc] [flang] [clang-tools-extra] [libcxx] [compiler-rt] [lld] [lldb] [clang] [llvm] [AMDGPU] Use alias info to relax waitcounts for LDS DMA (PR #74537)

2023-12-13 Thread Stanislav Mekhanoshin via lldb-commits

https://github.com/rampitec updated 
https://github.com/llvm/llvm-project/pull/74537

>From 7e382620cdc5999c645ed0746f242595f0294c58 Mon Sep 17 00:00:00 2001
From: Stanislav Mekhanoshin 
Date: Mon, 4 Dec 2023 16:11:53 -0800
Subject: [PATCH 1/8] [AMDGPU] Use alias info to relax waitcounts for LDS DMA

LDA DMA loads increase VMCNT and a load from the LDS stored must
wait on this counter to only read memory after it is written.
Wait count insertion pass does not track memory dependencies, it
tracks register dependencies. To model the LDS dependency a
psuedo register is used in the scoreboard, acting like if LDS DMA
writes it and LDS load reads it.

This patch adds 8 more pseudo registers to use for independent LDS
locations if we can prove they are disjoint using alias analysis.

Fixes: SWDEV-433427
---
 llvm/lib/Target/AMDGPU/SIISelLowering.cpp   |  16 +-
 llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp |  73 +-
 llvm/lib/Target/AMDGPU/SIInstrInfo.cpp  |   4 +-
 llvm/lib/Target/AMDGPU/SIInstrInfo.h|   8 +
 llvm/lib/Target/AMDGPU/lds-dma-waits.ll | 154 
 llvm/test/CodeGen/AMDGPU/llc-pipeline.ll|   2 +
 6 files changed, 241 insertions(+), 16 deletions(-)
 create mode 100644 llvm/lib/Target/AMDGPU/lds-dma-waits.ll

diff --git a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp 
b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
index a7f4d63229b7ef..2e079404b087fa 100644
--- a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+++ b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
@@ -1128,11 +1128,10 @@ bool SITargetLowering::getTgtMemIntrinsic(IntrinsicInfo 
&Info,
 MachineMemOperand::MOStore |
 MachineMemOperand::MODereferenceable;
 
-  // XXX - Should this be volatile without known ordering?
-  Info.flags |= MachineMemOperand::MOVolatile;
-
   switch (IntrID) {
   default:
+// XXX - Should this be volatile without known ordering?
+Info.flags |= MachineMemOperand::MOVolatile;
 break;
   case Intrinsic::amdgcn_raw_buffer_load_lds:
   case Intrinsic::amdgcn_raw_ptr_buffer_load_lds:
@@ -1140,6 +1139,7 @@ bool SITargetLowering::getTgtMemIntrinsic(IntrinsicInfo 
&Info,
   case Intrinsic::amdgcn_struct_ptr_buffer_load_lds: {
 unsigned Width = 
cast(CI.getArgOperand(2))->getZExtValue();
 Info.memVT = EVT::getIntegerVT(CI.getContext(), Width * 8);
+Info.ptrVal = CI.getArgOperand(1);
 return true;
   }
   }
@@ -1268,8 +1268,8 @@ bool SITargetLowering::getTgtMemIntrinsic(IntrinsicInfo 
&Info,
 Info.opc = ISD::INTRINSIC_VOID;
 unsigned Width = cast(CI.getArgOperand(2))->getZExtValue();
 Info.memVT = EVT::getIntegerVT(CI.getContext(), Width * 8);
-Info.flags |= MachineMemOperand::MOLoad | MachineMemOperand::MOStore |
-  MachineMemOperand::MOVolatile;
+Info.ptrVal = CI.getArgOperand(1);
+Info.flags |= MachineMemOperand::MOLoad | MachineMemOperand::MOStore;
 return true;
   }
   case Intrinsic::amdgcn_ds_bvh_stack_rtn: {
@@ -9084,7 +9084,9 @@ SDValue SITargetLowering::LowerINTRINSIC_VOID(SDValue Op,
 MachinePointerInfo LoadPtrI = LoadMMO->getPointerInfo();
 
 MachinePointerInfo StorePtrI = LoadPtrI;
-StorePtrI.V = nullptr;
+LoadPtrI.V = UndefValue::get(
+PointerType::get(*DAG.getContext(), AMDGPUAS::GLOBAL_ADDRESS));
+LoadPtrI.AddrSpace = AMDGPUAS::GLOBAL_ADDRESS;
 StorePtrI.AddrSpace = AMDGPUAS::LOCAL_ADDRESS;
 
 auto F = LoadMMO->getFlags() &
@@ -9162,6 +9164,8 @@ SDValue SITargetLowering::LowerINTRINSIC_VOID(SDValue Op,
 MachinePointerInfo LoadPtrI = LoadMMO->getPointerInfo();
 LoadPtrI.Offset = Op->getConstantOperandVal(5);
 MachinePointerInfo StorePtrI = LoadPtrI;
+LoadPtrI.V = UndefValue::get(
+PointerType::get(*DAG.getContext(), AMDGPUAS::GLOBAL_ADDRESS));
 LoadPtrI.AddrSpace = AMDGPUAS::GLOBAL_ADDRESS;
 StorePtrI.AddrSpace = AMDGPUAS::LOCAL_ADDRESS;
 auto F = LoadMMO->getFlags() &
diff --git a/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp 
b/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
index ede4841b8a5fd7..50ad22130e939e 100644
--- a/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
+++ b/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
@@ -31,6 +31,7 @@
 #include "llvm/ADT/MapVector.h"
 #include "llvm/ADT/PostOrderIterator.h"
 #include "llvm/ADT/Sequence.h"
+#include "llvm/Analysis/AliasAnalysis.h"
 #include "llvm/CodeGen/MachineLoopInfo.h"
 #include "llvm/CodeGen/MachinePostDominators.h"
 #include "llvm/InitializePasses.h"
@@ -121,8 +122,13 @@ enum RegisterMapping {
   SQ_MAX_PGM_VGPRS = 512, // Maximum programmable VGPRs across all targets.
   AGPR_OFFSET = 256,  // Maximum programmable ArchVGPRs across all targets.
   SQ_MAX_PGM_SGPRS = 256, // Maximum programmable SGPRs across all targets.
-  NUM_EXTRA_VGPRS = 1,// A reserved slot for DS.
-  EXTRA_VGPR_LDS = 0, // An artificial register to track LDS writes.
+  NUM_EXTRA_VGPRS = 9,// Reserved slots f

[Lldb-commits] [clang-tools-extra] [lldb] [llvm] [libc] [flang] [lld] [compiler-rt] [libcxx] [clang] [AMDGPU] Use alias info to relax waitcounts for LDS DMA (PR #74537)

2023-12-13 Thread Stanislav Mekhanoshin via lldb-commits

https://github.com/rampitec updated 
https://github.com/llvm/llvm-project/pull/74537

>From 7e382620cdc5999c645ed0746f242595f0294c58 Mon Sep 17 00:00:00 2001
From: Stanislav Mekhanoshin 
Date: Mon, 4 Dec 2023 16:11:53 -0800
Subject: [PATCH 1/9] [AMDGPU] Use alias info to relax waitcounts for LDS DMA

LDA DMA loads increase VMCNT and a load from the LDS stored must
wait on this counter to only read memory after it is written.
Wait count insertion pass does not track memory dependencies, it
tracks register dependencies. To model the LDS dependency a
psuedo register is used in the scoreboard, acting like if LDS DMA
writes it and LDS load reads it.

This patch adds 8 more pseudo registers to use for independent LDS
locations if we can prove they are disjoint using alias analysis.

Fixes: SWDEV-433427
---
 llvm/lib/Target/AMDGPU/SIISelLowering.cpp   |  16 +-
 llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp |  73 +-
 llvm/lib/Target/AMDGPU/SIInstrInfo.cpp  |   4 +-
 llvm/lib/Target/AMDGPU/SIInstrInfo.h|   8 +
 llvm/lib/Target/AMDGPU/lds-dma-waits.ll | 154 
 llvm/test/CodeGen/AMDGPU/llc-pipeline.ll|   2 +
 6 files changed, 241 insertions(+), 16 deletions(-)
 create mode 100644 llvm/lib/Target/AMDGPU/lds-dma-waits.ll

diff --git a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp 
b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
index a7f4d63229b7ef..2e079404b087fa 100644
--- a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+++ b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
@@ -1128,11 +1128,10 @@ bool SITargetLowering::getTgtMemIntrinsic(IntrinsicInfo 
&Info,
 MachineMemOperand::MOStore |
 MachineMemOperand::MODereferenceable;
 
-  // XXX - Should this be volatile without known ordering?
-  Info.flags |= MachineMemOperand::MOVolatile;
-
   switch (IntrID) {
   default:
+// XXX - Should this be volatile without known ordering?
+Info.flags |= MachineMemOperand::MOVolatile;
 break;
   case Intrinsic::amdgcn_raw_buffer_load_lds:
   case Intrinsic::amdgcn_raw_ptr_buffer_load_lds:
@@ -1140,6 +1139,7 @@ bool SITargetLowering::getTgtMemIntrinsic(IntrinsicInfo 
&Info,
   case Intrinsic::amdgcn_struct_ptr_buffer_load_lds: {
 unsigned Width = 
cast(CI.getArgOperand(2))->getZExtValue();
 Info.memVT = EVT::getIntegerVT(CI.getContext(), Width * 8);
+Info.ptrVal = CI.getArgOperand(1);
 return true;
   }
   }
@@ -1268,8 +1268,8 @@ bool SITargetLowering::getTgtMemIntrinsic(IntrinsicInfo 
&Info,
 Info.opc = ISD::INTRINSIC_VOID;
 unsigned Width = cast(CI.getArgOperand(2))->getZExtValue();
 Info.memVT = EVT::getIntegerVT(CI.getContext(), Width * 8);
-Info.flags |= MachineMemOperand::MOLoad | MachineMemOperand::MOStore |
-  MachineMemOperand::MOVolatile;
+Info.ptrVal = CI.getArgOperand(1);
+Info.flags |= MachineMemOperand::MOLoad | MachineMemOperand::MOStore;
 return true;
   }
   case Intrinsic::amdgcn_ds_bvh_stack_rtn: {
@@ -9084,7 +9084,9 @@ SDValue SITargetLowering::LowerINTRINSIC_VOID(SDValue Op,
 MachinePointerInfo LoadPtrI = LoadMMO->getPointerInfo();
 
 MachinePointerInfo StorePtrI = LoadPtrI;
-StorePtrI.V = nullptr;
+LoadPtrI.V = UndefValue::get(
+PointerType::get(*DAG.getContext(), AMDGPUAS::GLOBAL_ADDRESS));
+LoadPtrI.AddrSpace = AMDGPUAS::GLOBAL_ADDRESS;
 StorePtrI.AddrSpace = AMDGPUAS::LOCAL_ADDRESS;
 
 auto F = LoadMMO->getFlags() &
@@ -9162,6 +9164,8 @@ SDValue SITargetLowering::LowerINTRINSIC_VOID(SDValue Op,
 MachinePointerInfo LoadPtrI = LoadMMO->getPointerInfo();
 LoadPtrI.Offset = Op->getConstantOperandVal(5);
 MachinePointerInfo StorePtrI = LoadPtrI;
+LoadPtrI.V = UndefValue::get(
+PointerType::get(*DAG.getContext(), AMDGPUAS::GLOBAL_ADDRESS));
 LoadPtrI.AddrSpace = AMDGPUAS::GLOBAL_ADDRESS;
 StorePtrI.AddrSpace = AMDGPUAS::LOCAL_ADDRESS;
 auto F = LoadMMO->getFlags() &
diff --git a/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp 
b/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
index ede4841b8a5fd7..50ad22130e939e 100644
--- a/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
+++ b/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
@@ -31,6 +31,7 @@
 #include "llvm/ADT/MapVector.h"
 #include "llvm/ADT/PostOrderIterator.h"
 #include "llvm/ADT/Sequence.h"
+#include "llvm/Analysis/AliasAnalysis.h"
 #include "llvm/CodeGen/MachineLoopInfo.h"
 #include "llvm/CodeGen/MachinePostDominators.h"
 #include "llvm/InitializePasses.h"
@@ -121,8 +122,13 @@ enum RegisterMapping {
   SQ_MAX_PGM_VGPRS = 512, // Maximum programmable VGPRs across all targets.
   AGPR_OFFSET = 256,  // Maximum programmable ArchVGPRs across all targets.
   SQ_MAX_PGM_SGPRS = 256, // Maximum programmable SGPRs across all targets.
-  NUM_EXTRA_VGPRS = 1,// A reserved slot for DS.
-  EXTRA_VGPR_LDS = 0, // An artificial register to track LDS writes.
+  NUM_EXTRA_VGPRS = 9,// Reserved slots f

[Lldb-commits] [clang-tools-extra] [lldb] [mlir] [llvm] [libc] [libunwind] [flang] [lld] [compiler-rt] [libcxx] [libcxxabi] [clang] [libc++] Implement ranges::contains (PR #65148)

2023-12-13 Thread via lldb-commits

https://github.com/ZijunZhaoCCK updated 
https://github.com/llvm/llvm-project/pull/65148

>From 02e9afd761228f401df4d9f8dfaaca44ffae0c6e Mon Sep 17 00:00:00 2001
From: zijunzhao 
Date: Thu, 31 Aug 2023 20:08:32 +
Subject: [PATCH 01/22] [libc++] Implement ranges::contains

Differential Revision: https://reviews.llvm.org/D159232
---
 libcxx/include/CMakeLists.txt |   1 +
 libcxx/include/__algorithm/ranges_contains.h  |  60 ++
 libcxx/include/algorithm  |   9 +
 ...obust_against_copying_projections.pass.cpp |   4 +
 .../alg.contains/ranges.contains.pass.cpp | 190 ++
 .../niebloid.compile.pass.cpp |   1 +
 6 files changed, 265 insertions(+)
 create mode 100644 libcxx/include/__algorithm/ranges_contains.h
 create mode 100644 
libcxx/test/std/algorithms/alg.nonmodifying/alg.contains/ranges.contains.pass.cpp

diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt
index 77a7269121ec14..024aa8959fb720 100644
--- a/libcxx/include/CMakeLists.txt
+++ b/libcxx/include/CMakeLists.txt
@@ -104,6 +104,7 @@ set(files
   __algorithm/ranges_any_of.h
   __algorithm/ranges_binary_search.h
   __algorithm/ranges_clamp.h
+  __algorithm/ranges_contains.h
   __algorithm/ranges_copy.h
   __algorithm/ranges_copy_backward.h
   __algorithm/ranges_copy_if.h
diff --git a/libcxx/include/__algorithm/ranges_contains.h 
b/libcxx/include/__algorithm/ranges_contains.h
new file mode 100644
index 00..647b7ea34be342
--- /dev/null
+++ b/libcxx/include/__algorithm/ranges_contains.h
@@ -0,0 +1,60 @@
+//===--===//
+//
+// 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 _LIBCPP___ALGORITHM_RANGES_CONTAINS_H
+#define _LIBCPP___ALGORITHM_RANGES_CONTAINS_H
+
+#include <__algorithm/in_in_result.h>
+#include <__algorithm/ranges_find.h>
+#include <__config>
+#include <__functional/identity.h>
+#include <__functional/ranges_operations.h>
+#include <__functional/reference_wrapper.h>
+#include <__iterator/concepts.h>
+#include <__iterator/indirectly_comparable.h>
+#include <__iterator/projected.h>
+#include <__ranges/access.h>
+#include <__ranges/concepts.h>
+#include <__utility/move.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+#if _LIBCPP_STD_VER >= 23
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+namespace ranges {
+namespace __contains {
+struct __fn {
+  template  _Sent, class _Type, 
class _Proj = identity>
+requires indirect_binary_predicate, const _Type*>
+  _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool
+  operator()(_Iter __first, _Sent __last, const _Type& __value, _Proj __proj = 
{}) const {
+return ranges::find(std::move(__first), std::move(__last), __value, 
std::ref(__proj)) != __last;
+  }
+
+  template 
+requires indirect_binary_predicate, _Proj>, const _Type*>
+  _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool
+  operator()(_Range&& __range, const _Type& __value, _Proj __proj = {}) const {
+return ranges::find(ranges::begin(__range), ranges::end(__range), __value, 
std::ref(__proj)) != ranges::end(__range);
+  }
+};
+} // namespace __contains
+inline namespace __cpo {
+inline constexpr auto contains = __contains::__fn{};
+} // namespace __cpo
+} // namespace ranges
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_STD_VER >= 23
+
+#endif // _LIBCPP___ALGORITHM_RANGES_CONTAINS_H
diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm
index 76e0d22bf73ef8..003bf132b38b4d 100644
--- a/libcxx/include/algorithm
+++ b/libcxx/include/algorithm
@@ -226,6 +226,14 @@ namespace ranges {
   template
 using copy_backward_result = in_out_result;
 // since C++20
 
+  template S, class T, class Proj = identity>
+requires indirect_binary_predicate, 
const T*>
+constexpr bool ranges::contains(I first, S last, const T& value, Proj proj 
= {});   // since C++23
+
+  template
+requires indirect_binary_predicate, Proj>, const T*>
+constexpr bool ranges::contains(R&& r, const T& value, Proj proj = {});
 // since C++23
+
   template S, weakly_incrementable O>
 requires indirectly_copyable
 constexpr ranges::copy_result ranges::copy(I first, S last, O 
result);// since C++20
@@ -1827,6 +1835,7 @@ template 
 #include <__algorithm/ranges_any_of.h>
 #include <__algorithm/ranges_binary_search.h>
 #include <__algorithm/ranges_clamp.h>
+#include <__algorithm/ranges_contains.h>
 #include <__algorithm/ranges_copy.h>
 #include <__algorithm/ranges_copy_backward.h>
 #include <__algorithm/ranges_copy_if.h>
diff --git 
a/libcxx/test/libcxx/algorithms/ranges_robust_against_copying

[Lldb-commits] [lldb] [lldb][NFCI] Remove unused parameter from BreakpointResolver*::CreateFromStructuredData (PR #75374)

2023-12-13 Thread Alex Langford via lldb-commits

https://github.com/bulbazord created 
https://github.com/llvm/llvm-project/pull/75374

These appear to be unused.

>From e00884c8a9e6010b339932a9bff840634462beb7 Mon Sep 17 00:00:00 2001
From: Alex Langford 
Date: Wed, 13 Dec 2023 11:35:49 -0800
Subject: [PATCH] [lldb][NFCI] Remove unused parameter from
 BreakpointResolver*::CreateFromStructuredData

These appear to be unused.
---
 .../lldb/Breakpoint/BreakpointResolverAddress.h|  3 +--
 .../lldb/Breakpoint/BreakpointResolverFileLine.h   |  3 +--
 .../lldb/Breakpoint/BreakpointResolverFileRegex.h  |  3 +--
 lldb/include/lldb/Breakpoint/BreakpointResolverName.h  |  3 +--
 .../lldb/Breakpoint/BreakpointResolverScripted.h   |  3 +--
 lldb/source/Breakpoint/BreakpointResolver.cpp  | 10 +-
 lldb/source/Breakpoint/BreakpointResolverAddress.cpp   |  5 ++---
 lldb/source/Breakpoint/BreakpointResolverFileLine.cpp  |  5 ++---
 lldb/source/Breakpoint/BreakpointResolverFileRegex.cpp |  5 ++---
 lldb/source/Breakpoint/BreakpointResolverName.cpp  |  8 
 lldb/source/Breakpoint/BreakpointResolverScripted.cpp  |  7 +++
 11 files changed, 23 insertions(+), 32 deletions(-)

diff --git a/lldb/include/lldb/Breakpoint/BreakpointResolverAddress.h 
b/lldb/include/lldb/Breakpoint/BreakpointResolverAddress.h
index 03ae69acae4c4f..3a09892f3f1943 100644
--- a/lldb/include/lldb/Breakpoint/BreakpointResolverAddress.h
+++ b/lldb/include/lldb/Breakpoint/BreakpointResolverAddress.h
@@ -31,8 +31,7 @@ class BreakpointResolverAddress : public BreakpointResolver {
   ~BreakpointResolverAddress() override = default;
 
   static lldb::BreakpointResolverSP
-  CreateFromStructuredData(const lldb::BreakpointSP &bkpt,
-   const StructuredData::Dictionary &options_dict,
+  CreateFromStructuredData(const StructuredData::Dictionary &options_dict,
Status &error);
 
   StructuredData::ObjectSP SerializeToStructuredData() override;
diff --git a/lldb/include/lldb/Breakpoint/BreakpointResolverFileLine.h 
b/lldb/include/lldb/Breakpoint/BreakpointResolverFileLine.h
index 7635729c50a6e0..610d81727c6c6a 100644
--- a/lldb/include/lldb/Breakpoint/BreakpointResolverFileLine.h
+++ b/lldb/include/lldb/Breakpoint/BreakpointResolverFileLine.h
@@ -28,8 +28,7 @@ class BreakpointResolverFileLine : public BreakpointResolver {
   std::optional removed_prefix_opt = std::nullopt);
 
   static lldb::BreakpointResolverSP
-  CreateFromStructuredData(const lldb::BreakpointSP &bkpt,
-   const StructuredData::Dictionary &data_dict,
+  CreateFromStructuredData(const StructuredData::Dictionary &data_dict,
Status &error);
 
   StructuredData::ObjectSP SerializeToStructuredData() override;
diff --git a/lldb/include/lldb/Breakpoint/BreakpointResolverFileRegex.h 
b/lldb/include/lldb/Breakpoint/BreakpointResolverFileRegex.h
index 43e1217c13d5ef..1dcdba91a5a8d5 100644
--- a/lldb/include/lldb/Breakpoint/BreakpointResolverFileRegex.h
+++ b/lldb/include/lldb/Breakpoint/BreakpointResolverFileRegex.h
@@ -28,8 +28,7 @@ class BreakpointResolverFileRegex : public BreakpointResolver 
{
   const std::unordered_set &func_name_set, bool exact_match);
 
   static lldb::BreakpointResolverSP
-  CreateFromStructuredData(const lldb::BreakpointSP &bkpt,
-   const StructuredData::Dictionary &options_dict,
+  CreateFromStructuredData(const StructuredData::Dictionary &options_dict,
Status &error);
 
   StructuredData::ObjectSP SerializeToStructuredData() override;
diff --git a/lldb/include/lldb/Breakpoint/BreakpointResolverName.h 
b/lldb/include/lldb/Breakpoint/BreakpointResolverName.h
index 94b19db3085d76..c83814c174e883 100644
--- a/lldb/include/lldb/Breakpoint/BreakpointResolverName.h
+++ b/lldb/include/lldb/Breakpoint/BreakpointResolverName.h
@@ -51,8 +51,7 @@ class BreakpointResolverName : public BreakpointResolver {
  bool skip_prologue);
 
   static lldb::BreakpointResolverSP
-  CreateFromStructuredData(const lldb::BreakpointSP &bkpt,
-   const StructuredData::Dictionary &data_dict,
+  CreateFromStructuredData(const StructuredData::Dictionary &data_dict,
Status &error);
 
   StructuredData::ObjectSP SerializeToStructuredData() override;
diff --git a/lldb/include/lldb/Breakpoint/BreakpointResolverScripted.h 
b/lldb/include/lldb/Breakpoint/BreakpointResolverScripted.h
index c0bbc1c2bafb70..133fa8058637bb 100644
--- a/lldb/include/lldb/Breakpoint/BreakpointResolverScripted.h
+++ b/lldb/include/lldb/Breakpoint/BreakpointResolverScripted.h
@@ -31,8 +31,7 @@ class BreakpointResolverScripted : public BreakpointResolver {
   ~BreakpointResolverScripted() override = default;
 
   static lldb::BreakpointResolverSP
-  CreateFromStructuredData(const lldb::BreakpointSP &bkpt,
-   const StructuredData::Dictionary &options_dict,
+  CreateFromStructuredDat

[Lldb-commits] [lldb] [lldb][NFCI] Remove unused parameter from BreakpointResolver*::CreateFromStructuredData (PR #75374)

2023-12-13 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: Alex Langford (bulbazord)


Changes

These appear to be unused.

---
Full diff: https://github.com/llvm/llvm-project/pull/75374.diff


11 Files Affected:

- (modified) lldb/include/lldb/Breakpoint/BreakpointResolverAddress.h (+1-2) 
- (modified) lldb/include/lldb/Breakpoint/BreakpointResolverFileLine.h (+1-2) 
- (modified) lldb/include/lldb/Breakpoint/BreakpointResolverFileRegex.h (+1-2) 
- (modified) lldb/include/lldb/Breakpoint/BreakpointResolverName.h (+1-2) 
- (modified) lldb/include/lldb/Breakpoint/BreakpointResolverScripted.h (+1-2) 
- (modified) lldb/source/Breakpoint/BreakpointResolver.cpp (+5-5) 
- (modified) lldb/source/Breakpoint/BreakpointResolverAddress.cpp (+2-3) 
- (modified) lldb/source/Breakpoint/BreakpointResolverFileLine.cpp (+2-3) 
- (modified) lldb/source/Breakpoint/BreakpointResolverFileRegex.cpp (+2-3) 
- (modified) lldb/source/Breakpoint/BreakpointResolverName.cpp (+4-4) 
- (modified) lldb/source/Breakpoint/BreakpointResolverScripted.cpp (+3-4) 


``diff
diff --git a/lldb/include/lldb/Breakpoint/BreakpointResolverAddress.h 
b/lldb/include/lldb/Breakpoint/BreakpointResolverAddress.h
index 03ae69acae4c4f..3a09892f3f1943 100644
--- a/lldb/include/lldb/Breakpoint/BreakpointResolverAddress.h
+++ b/lldb/include/lldb/Breakpoint/BreakpointResolverAddress.h
@@ -31,8 +31,7 @@ class BreakpointResolverAddress : public BreakpointResolver {
   ~BreakpointResolverAddress() override = default;
 
   static lldb::BreakpointResolverSP
-  CreateFromStructuredData(const lldb::BreakpointSP &bkpt,
-   const StructuredData::Dictionary &options_dict,
+  CreateFromStructuredData(const StructuredData::Dictionary &options_dict,
Status &error);
 
   StructuredData::ObjectSP SerializeToStructuredData() override;
diff --git a/lldb/include/lldb/Breakpoint/BreakpointResolverFileLine.h 
b/lldb/include/lldb/Breakpoint/BreakpointResolverFileLine.h
index 7635729c50a6e0..610d81727c6c6a 100644
--- a/lldb/include/lldb/Breakpoint/BreakpointResolverFileLine.h
+++ b/lldb/include/lldb/Breakpoint/BreakpointResolverFileLine.h
@@ -28,8 +28,7 @@ class BreakpointResolverFileLine : public BreakpointResolver {
   std::optional removed_prefix_opt = std::nullopt);
 
   static lldb::BreakpointResolverSP
-  CreateFromStructuredData(const lldb::BreakpointSP &bkpt,
-   const StructuredData::Dictionary &data_dict,
+  CreateFromStructuredData(const StructuredData::Dictionary &data_dict,
Status &error);
 
   StructuredData::ObjectSP SerializeToStructuredData() override;
diff --git a/lldb/include/lldb/Breakpoint/BreakpointResolverFileRegex.h 
b/lldb/include/lldb/Breakpoint/BreakpointResolverFileRegex.h
index 43e1217c13d5ef..1dcdba91a5a8d5 100644
--- a/lldb/include/lldb/Breakpoint/BreakpointResolverFileRegex.h
+++ b/lldb/include/lldb/Breakpoint/BreakpointResolverFileRegex.h
@@ -28,8 +28,7 @@ class BreakpointResolverFileRegex : public BreakpointResolver 
{
   const std::unordered_set &func_name_set, bool exact_match);
 
   static lldb::BreakpointResolverSP
-  CreateFromStructuredData(const lldb::BreakpointSP &bkpt,
-   const StructuredData::Dictionary &options_dict,
+  CreateFromStructuredData(const StructuredData::Dictionary &options_dict,
Status &error);
 
   StructuredData::ObjectSP SerializeToStructuredData() override;
diff --git a/lldb/include/lldb/Breakpoint/BreakpointResolverName.h 
b/lldb/include/lldb/Breakpoint/BreakpointResolverName.h
index 94b19db3085d76..c83814c174e883 100644
--- a/lldb/include/lldb/Breakpoint/BreakpointResolverName.h
+++ b/lldb/include/lldb/Breakpoint/BreakpointResolverName.h
@@ -51,8 +51,7 @@ class BreakpointResolverName : public BreakpointResolver {
  bool skip_prologue);
 
   static lldb::BreakpointResolverSP
-  CreateFromStructuredData(const lldb::BreakpointSP &bkpt,
-   const StructuredData::Dictionary &data_dict,
+  CreateFromStructuredData(const StructuredData::Dictionary &data_dict,
Status &error);
 
   StructuredData::ObjectSP SerializeToStructuredData() override;
diff --git a/lldb/include/lldb/Breakpoint/BreakpointResolverScripted.h 
b/lldb/include/lldb/Breakpoint/BreakpointResolverScripted.h
index c0bbc1c2bafb70..133fa8058637bb 100644
--- a/lldb/include/lldb/Breakpoint/BreakpointResolverScripted.h
+++ b/lldb/include/lldb/Breakpoint/BreakpointResolverScripted.h
@@ -31,8 +31,7 @@ class BreakpointResolverScripted : public BreakpointResolver {
   ~BreakpointResolverScripted() override = default;
 
   static lldb::BreakpointResolverSP
-  CreateFromStructuredData(const lldb::BreakpointSP &bkpt,
-   const StructuredData::Dictionary &options_dict,
+  CreateFromStructuredData(const StructuredData::Dictionary &options_dict,
Status &error);
 
   StructuredData::Objec

[Lldb-commits] [lldb] Fix lldb-dap pickProcess command for selecting process for debugger attachment (PR #75342)

2023-12-13 Thread via lldb-commits

Dodzey wrote:

I've just checked one possible failure mode that came to mind. Do you get an 
error if you didn't have the MS CPPTools extension enabled and you attempt to 
use a launch profile with a hardcoded pid (`"pid": 1000 or no pid specified - 
so auto detecting a single running process), and that works okay. There is no 
error about missing `extension.pickNativeProcess` until you attempt to use 
`${command:pickProcess}` as the value for pid.

https://github.com/llvm/llvm-project/pull/75342
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] Fix lldb-dap pickProcess command for selecting process for debugger attachment (PR #75342)

2023-12-13 Thread Walter Erquinigo via lldb-commits

walter-erquinigo wrote:

> Would you want the minimal typescript extension to be a separate extension 
> from the main lldb-dap one?, or would it be okay to have the typescript in 
> the lldb-dap project/extension?

It should be part of the lldb-dap folder/project and it should also be the 
default way to use lldb-dap. Using it directly as a binary would be discouraged 
but left as a possibility. The main idea behind this approach is that several 
companies have built their own TS wrappers for lldb-dap (at least Meta, Google 
and Modular), which includes features they haven't contributed back to the 
community. This is something I'd like to get fixed.

An additional architectural point for this extension is that it should be 
possible to copy/paste the TS files into another existing vscode extensions, 
and integrate it with possibly just one single call `initLLDBDAP(settings)`.

https://github.com/llvm/llvm-project/pull/75342
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] Fix lldb-dap pickProcess command for selecting process for debugger attachment (PR #75342)

2023-12-13 Thread Walter Erquinigo via lldb-commits

walter-erquinigo wrote:

@Dodzey , I think I'll add the minimal TS project tonight and you can review 
it. Then we can add a few additional features there are as follow ups

https://github.com/llvm/llvm-project/pull/75342
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [LLDB] Add more helper functions to CompilerType class (second try). (PR #73472)

2023-12-13 Thread via lldb-commits

cmtice wrote:

@bulbazord Actually, I think you're right. I use that in my smart pointer type 
code.  I will pull that out as well (I overlooked it before).

https://github.com/llvm/llvm-project/pull/73472
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [compiler-rt] [flang] [libc] [lldb] [clang-tools-extra] [libcxxabi] [libunwind] [lld] [llvm] [clang] [libcxx] [lsan] Install `pthread_atfork` (PR #75281)

2023-12-13 Thread Vitaly Buka via lldb-commits

https://github.com/vitalybuka closed 
https://github.com/llvm/llvm-project/pull/75281
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [compiler-rt] [flang] [libc] [lldb] [libcxxabi] [libunwind] [llvm] [clang] [lld] [libcxx] [asan] Install `pthread_atfork` (PR #75290)

2023-12-13 Thread Vitaly Buka via lldb-commits

https://github.com/vitalybuka edited 
https://github.com/llvm/llvm-project/pull/75290
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [mlir] [libunwind] [lldb] [compiler-rt] [clang] [libcxx] [llvm] [libc] [flang] [libcxxabi] [lld] [asan] Install `pthread_atfork` (PR #75290)

2023-12-13 Thread Vitaly Buka via lldb-commits

https://github.com/vitalybuka updated 
https://github.com/llvm/llvm-project/pull/75290

>From 2d98fe9115e37c60fd568008c27038015f28c7e3 Mon Sep 17 00:00:00 2001
From: Vitaly Buka 
Date: Tue, 12 Dec 2023 22:59:06 -0800
Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20change?=
 =?UTF-8?q?s=20to=20main=20this=20commit=20is=20based=20on?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Created using spr 1.3.4

[skip ci]
---
 .../include/sanitizer/hwasan_interface.h  |  4 
 compiler-rt/lib/hwasan/hwasan.cpp |  2 ++
 compiler-rt/lib/hwasan/hwasan.h   |  6 ++---
 .../lib/hwasan/hwasan_interface_internal.h|  3 +++
 compiler-rt/lib/lsan/lsan.cpp |  1 +
 compiler-rt/lib/lsan/lsan.h   |  1 +
 compiler-rt/lib/lsan/lsan_common.cpp  |  3 +++
 compiler-rt/lib/lsan/lsan_common.h|  4 
 compiler-rt/lib/lsan/lsan_fuchsia.cpp |  1 +
 compiler-rt/lib/lsan/lsan_posix.cpp   | 18 ++
 compiler-rt/test/hwasan/TestCases/tag-ptr.cpp | 24 +++
 .../TestCases/Posix/fork_threaded.c   |  2 +-
 .../sanitizer_common/sanitizer_specific.h | 13 ++
 13 files changed, 78 insertions(+), 4 deletions(-)
 create mode 100644 compiler-rt/test/hwasan/TestCases/tag-ptr.cpp

diff --git a/compiler-rt/include/sanitizer/hwasan_interface.h 
b/compiler-rt/include/sanitizer/hwasan_interface.h
index abe310c0666948..407f488a24a617 100644
--- a/compiler-rt/include/sanitizer/hwasan_interface.h
+++ b/compiler-rt/include/sanitizer/hwasan_interface.h
@@ -44,6 +44,10 @@ void SANITIZER_CDECL __hwasan_tag_memory(const volatile void 
*p,
 void *SANITIZER_CDECL __hwasan_tag_pointer(const volatile void *p,
unsigned char tag);
 
+/// Get tag from the pointer.
+unsigned char SANITIZER_CDECL
+__hwasan_get_tag_from_pointer(const volatile void *p);
+
 // Set memory tag from the current SP address to the given address to zero.
 // This is meant to annotate longjmp and other non-local jumps.
 // This function needs to know the (almost) exact destination frame address;
diff --git a/compiler-rt/lib/hwasan/hwasan.cpp 
b/compiler-rt/lib/hwasan/hwasan.cpp
index 2f6cb10caf1be6..52780becbdb264 100644
--- a/compiler-rt/lib/hwasan/hwasan.cpp
+++ b/compiler-rt/lib/hwasan/hwasan.cpp
@@ -678,6 +678,8 @@ uptr __hwasan_tag_pointer(uptr p, u8 tag) {
   return AddTagToPointer(p, tag);
 }
 
+u8 __hwasan_get_tag_from_pointer(uptr p) { return GetTagFromPointer(p); }
+
 void __hwasan_handle_longjmp(const void *sp_dst) {
   uptr dst = (uptr)sp_dst;
   // HWASan does not support tagged SP.
diff --git a/compiler-rt/lib/hwasan/hwasan.h b/compiler-rt/lib/hwasan/hwasan.h
index 37ef4822285110..df21375e81671f 100644
--- a/compiler-rt/lib/hwasan/hwasan.h
+++ b/compiler-rt/lib/hwasan/hwasan.h
@@ -104,9 +104,9 @@ static inline void *UntagPtr(const void *tagged_ptr) {
 }
 
 static inline uptr AddTagToPointer(uptr p, tag_t tag) {
-  return InTaggableRegion(p)
- ? ((p & ~kAddressTagMask) | ((uptr)tag << kAddressTagShift))
- : p;
+  return InTaggableRegion(p) ? ((p & ~kAddressTagMask) |
+((uptr)(tag & kTagMask) << kAddressTagShift))
+ : p;
 }
 
 namespace __hwasan {
diff --git a/compiler-rt/lib/hwasan/hwasan_interface_internal.h 
b/compiler-rt/lib/hwasan/hwasan_interface_internal.h
index e7804cc4903343..8f2f77dad917d2 100644
--- a/compiler-rt/lib/hwasan/hwasan_interface_internal.h
+++ b/compiler-rt/lib/hwasan/hwasan_interface_internal.h
@@ -160,6 +160,9 @@ void __hwasan_tag_memory(uptr p, u8 tag, uptr sz);
 SANITIZER_INTERFACE_ATTRIBUTE
 uptr __hwasan_tag_pointer(uptr p, u8 tag);
 
+SANITIZER_INTERFACE_ATTRIBUTE
+u8 __hwasan_get_tag_from_pointer(uptr p);
+
 SANITIZER_INTERFACE_ATTRIBUTE
 void __hwasan_tag_mismatch(uptr addr, u8 ts);
 
diff --git a/compiler-rt/lib/lsan/lsan.cpp b/compiler-rt/lib/lsan/lsan.cpp
index 6b223603c6a79c..7a27b600f203f7 100644
--- a/compiler-rt/lib/lsan/lsan.cpp
+++ b/compiler-rt/lib/lsan/lsan.cpp
@@ -101,6 +101,7 @@ extern "C" void __lsan_init() {
   InstallDeadlySignalHandlers(LsanOnDeadlySignal);
   InitializeMainThread();
   InstallAtExitCheckLeaks();
+  InstallAtForkHandler();
 
   InitializeCoverage(common_flags()->coverage, common_flags()->coverage_dir);
 
diff --git a/compiler-rt/lib/lsan/lsan.h b/compiler-rt/lib/lsan/lsan.h
index 757edec8e104f9..0074ad5308785c 100644
--- a/compiler-rt/lib/lsan/lsan.h
+++ b/compiler-rt/lib/lsan/lsan.h
@@ -40,6 +40,7 @@ void InitializeInterceptors();
 void ReplaceSystemMalloc();
 void LsanOnDeadlySignal(int signo, void *siginfo, void *context);
 void InstallAtExitCheckLeaks();
+void InstallAtForkHandler();
 
 #define ENSURE_LSAN_INITED\
   do {\
diff --git a/compiler-rt/lib/lsan/lsan_common.cpp 
b/compiler-rt/lib/lsan/lsan_common.cpp
index 8b1af5b629fbce..e24839c984b346 1006

[Lldb-commits] [llvm] [lldb] [clang-tools-extra] [libcxx] [compiler-rt] [lld] [mlir] [libunwind] [libcxxabi] [flang] [libc] [clang] [asan] Install `pthread_atfork` (PR #75290)

2023-12-13 Thread Vitaly Buka via lldb-commits

https://github.com/vitalybuka updated 
https://github.com/llvm/llvm-project/pull/75290

>From 2d98fe9115e37c60fd568008c27038015f28c7e3 Mon Sep 17 00:00:00 2001
From: Vitaly Buka 
Date: Tue, 12 Dec 2023 22:59:06 -0800
Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20change?=
 =?UTF-8?q?s=20to=20main=20this=20commit=20is=20based=20on?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Created using spr 1.3.4

[skip ci]
---
 .../include/sanitizer/hwasan_interface.h  |  4 
 compiler-rt/lib/hwasan/hwasan.cpp |  2 ++
 compiler-rt/lib/hwasan/hwasan.h   |  6 ++---
 .../lib/hwasan/hwasan_interface_internal.h|  3 +++
 compiler-rt/lib/lsan/lsan.cpp |  1 +
 compiler-rt/lib/lsan/lsan.h   |  1 +
 compiler-rt/lib/lsan/lsan_common.cpp  |  3 +++
 compiler-rt/lib/lsan/lsan_common.h|  4 
 compiler-rt/lib/lsan/lsan_fuchsia.cpp |  1 +
 compiler-rt/lib/lsan/lsan_posix.cpp   | 18 ++
 compiler-rt/test/hwasan/TestCases/tag-ptr.cpp | 24 +++
 .../TestCases/Posix/fork_threaded.c   |  2 +-
 .../sanitizer_common/sanitizer_specific.h | 13 ++
 13 files changed, 78 insertions(+), 4 deletions(-)
 create mode 100644 compiler-rt/test/hwasan/TestCases/tag-ptr.cpp

diff --git a/compiler-rt/include/sanitizer/hwasan_interface.h 
b/compiler-rt/include/sanitizer/hwasan_interface.h
index abe310c0666948..407f488a24a617 100644
--- a/compiler-rt/include/sanitizer/hwasan_interface.h
+++ b/compiler-rt/include/sanitizer/hwasan_interface.h
@@ -44,6 +44,10 @@ void SANITIZER_CDECL __hwasan_tag_memory(const volatile void 
*p,
 void *SANITIZER_CDECL __hwasan_tag_pointer(const volatile void *p,
unsigned char tag);
 
+/// Get tag from the pointer.
+unsigned char SANITIZER_CDECL
+__hwasan_get_tag_from_pointer(const volatile void *p);
+
 // Set memory tag from the current SP address to the given address to zero.
 // This is meant to annotate longjmp and other non-local jumps.
 // This function needs to know the (almost) exact destination frame address;
diff --git a/compiler-rt/lib/hwasan/hwasan.cpp 
b/compiler-rt/lib/hwasan/hwasan.cpp
index 2f6cb10caf1be6..52780becbdb264 100644
--- a/compiler-rt/lib/hwasan/hwasan.cpp
+++ b/compiler-rt/lib/hwasan/hwasan.cpp
@@ -678,6 +678,8 @@ uptr __hwasan_tag_pointer(uptr p, u8 tag) {
   return AddTagToPointer(p, tag);
 }
 
+u8 __hwasan_get_tag_from_pointer(uptr p) { return GetTagFromPointer(p); }
+
 void __hwasan_handle_longjmp(const void *sp_dst) {
   uptr dst = (uptr)sp_dst;
   // HWASan does not support tagged SP.
diff --git a/compiler-rt/lib/hwasan/hwasan.h b/compiler-rt/lib/hwasan/hwasan.h
index 37ef4822285110..df21375e81671f 100644
--- a/compiler-rt/lib/hwasan/hwasan.h
+++ b/compiler-rt/lib/hwasan/hwasan.h
@@ -104,9 +104,9 @@ static inline void *UntagPtr(const void *tagged_ptr) {
 }
 
 static inline uptr AddTagToPointer(uptr p, tag_t tag) {
-  return InTaggableRegion(p)
- ? ((p & ~kAddressTagMask) | ((uptr)tag << kAddressTagShift))
- : p;
+  return InTaggableRegion(p) ? ((p & ~kAddressTagMask) |
+((uptr)(tag & kTagMask) << kAddressTagShift))
+ : p;
 }
 
 namespace __hwasan {
diff --git a/compiler-rt/lib/hwasan/hwasan_interface_internal.h 
b/compiler-rt/lib/hwasan/hwasan_interface_internal.h
index e7804cc4903343..8f2f77dad917d2 100644
--- a/compiler-rt/lib/hwasan/hwasan_interface_internal.h
+++ b/compiler-rt/lib/hwasan/hwasan_interface_internal.h
@@ -160,6 +160,9 @@ void __hwasan_tag_memory(uptr p, u8 tag, uptr sz);
 SANITIZER_INTERFACE_ATTRIBUTE
 uptr __hwasan_tag_pointer(uptr p, u8 tag);
 
+SANITIZER_INTERFACE_ATTRIBUTE
+u8 __hwasan_get_tag_from_pointer(uptr p);
+
 SANITIZER_INTERFACE_ATTRIBUTE
 void __hwasan_tag_mismatch(uptr addr, u8 ts);
 
diff --git a/compiler-rt/lib/lsan/lsan.cpp b/compiler-rt/lib/lsan/lsan.cpp
index 6b223603c6a79c..7a27b600f203f7 100644
--- a/compiler-rt/lib/lsan/lsan.cpp
+++ b/compiler-rt/lib/lsan/lsan.cpp
@@ -101,6 +101,7 @@ extern "C" void __lsan_init() {
   InstallDeadlySignalHandlers(LsanOnDeadlySignal);
   InitializeMainThread();
   InstallAtExitCheckLeaks();
+  InstallAtForkHandler();
 
   InitializeCoverage(common_flags()->coverage, common_flags()->coverage_dir);
 
diff --git a/compiler-rt/lib/lsan/lsan.h b/compiler-rt/lib/lsan/lsan.h
index 757edec8e104f9..0074ad5308785c 100644
--- a/compiler-rt/lib/lsan/lsan.h
+++ b/compiler-rt/lib/lsan/lsan.h
@@ -40,6 +40,7 @@ void InitializeInterceptors();
 void ReplaceSystemMalloc();
 void LsanOnDeadlySignal(int signo, void *siginfo, void *context);
 void InstallAtExitCheckLeaks();
+void InstallAtForkHandler();
 
 #define ENSURE_LSAN_INITED\
   do {\
diff --git a/compiler-rt/lib/lsan/lsan_common.cpp 
b/compiler-rt/lib/lsan/lsan_common.cpp
index 8b1af5b629fbce..e24839c984b346 1006

[Lldb-commits] [lldb] [LLDB] Add more helper functions to CompilerType class (second try). (PR #73472)

2023-12-13 Thread via lldb-commits

https://github.com/cmtice updated 
https://github.com/llvm/llvm-project/pull/73472

>From a063ebd8ee8bbd491fff3449bc20d663d2e501ea Mon Sep 17 00:00:00 2001
From: Caroline Tice 
Date: Sun, 26 Nov 2023 17:24:39 -0800
Subject: [PATCH 1/5] [LLDB] Add more helper functions to CompilerType class
 (second try).

This adds 23 new helper functions to LLDB's CompilerType class, things
like IsSmartPtrType, IsPromotableIntegerType,
GetNumberofNonEmptyBaseClasses, and GetTemplateArgumentType (to name a
few).

It also has run clang-format on the files CompilerType.{h,cpp}.

These helper functions are needed as part of the implementation for
the Data Inspection Language, (see
https://discourse.llvm.org/t/rfc-data-inspection-language/69893).
---
 lldb/include/lldb/Symbol/CompilerType.h |  56 -
 lldb/source/Symbol/CompilerType.cpp | 285 ++--
 2 files changed, 320 insertions(+), 21 deletions(-)

diff --git a/lldb/include/lldb/Symbol/CompilerType.h 
b/lldb/include/lldb/Symbol/CompilerType.h
index 0a9533a1ac0efc..a3331ad3269c01 100644
--- a/lldb/include/lldb/Symbol/CompilerType.h
+++ b/lldb/include/lldb/Symbol/CompilerType.h
@@ -112,9 +112,7 @@ class CompilerType {
 
   /// Tests.
   /// \{
-  explicit operator bool() const {
-return m_type_system.lock() && m_type;
-  }
+  explicit operator bool() const { return m_type_system.lock() && m_type; }
 
   bool IsValid() const { return (bool)*this; }
 
@@ -194,6 +192,54 @@ class CompilerType {
   bool IsTypedefType() const;
 
   bool IsVoidType() const;
+
+  bool IsSmartPtrType() const;
+
+  bool IsInteger() const;
+
+  bool IsFloat() const;
+
+  bool IsEnumerationType() const;
+
+  bool IsUnscopedEnumerationType() const;
+
+  bool IsIntegerOrUnscopedEnumerationType() const;
+
+  bool IsSigned() const;
+
+  bool IsNullPtrType() const;
+
+  bool IsBoolean() const;
+
+  bool IsEnumerationIntegerTypeSigned() const;
+
+  bool IsScalarOrUnscopedEnumerationType() const;
+
+  bool IsPromotableIntegerType() const;
+
+  bool IsPointerToVoid() const;
+
+  bool IsRecordType() const;
+
+  bool IsVirtualBase(CompilerType target_base, CompilerType *virtual_base,
+ bool carry_virtual = false) const;
+
+  bool IsContextuallyConvertibleToBool() const;
+
+  bool IsBasicType() const;
+
+  std::string TypeDescription();
+
+  bool CompareTypes(CompilerType rhs) const;
+
+  const char *GetTypeTag();
+
+  uint32_t GetNumberOfNonEmptyBaseClasses();
+
+  CompilerType GetTemplateArgumentType(uint32_t idx);
+
+  CompilerType GetSmartPtrPointeeType();
+
   /// \}
 
   /// Type Completion.
@@ -436,8 +482,8 @@ class CompilerType {
  ExecutionContextScope *exe_scope);
 
   /// Dump to stdout.
-  void DumpTypeDescription(lldb::DescriptionLevel level =
-   lldb::eDescriptionLevelFull) const;
+  void DumpTypeDescription(
+  lldb::DescriptionLevel level = lldb::eDescriptionLevelFull) const;
 
   /// Print a description of the type to a stream. The exact implementation
   /// varies, but the expectation is that eDescriptionLevelFull returns a
diff --git a/lldb/source/Symbol/CompilerType.cpp 
b/lldb/source/Symbol/CompilerType.cpp
index 78cc8dad94a9c5..854d6cab01b508 100644
--- a/lldb/source/Symbol/CompilerType.cpp
+++ b/lldb/source/Symbol/CompilerType.cpp
@@ -54,7 +54,7 @@ bool CompilerType::IsArrayType(CompilerType 
*element_type_ptr, uint64_t *size,
   if (IsValid())
 if (auto type_system_sp = GetTypeSystem())
   return type_system_sp->IsArrayType(m_type, element_type_ptr, size,
-  is_incomplete);
+ is_incomplete);
 
   if (element_type_ptr)
 element_type_ptr->Clear();
@@ -157,7 +157,8 @@ bool CompilerType::IsBlockPointerType(
 CompilerType *function_pointer_type_ptr) const {
   if (IsValid())
 if (auto type_system_sp = GetTypeSystem())
-  return type_system_sp->IsBlockPointerType(m_type, 
function_pointer_type_ptr);
+  return type_system_sp->IsBlockPointerType(m_type,
+function_pointer_type_ptr);
   return false;
 }
 
@@ -249,7 +250,7 @@ bool CompilerType::IsPossibleDynamicType(CompilerType 
*dynamic_pointee_type,
   if (IsValid())
 if (auto type_system_sp = GetTypeSystem())
   return type_system_sp->IsPossibleDynamicType(m_type, 
dynamic_pointee_type,
-check_cplusplus, check_objc);
+   check_cplusplus, 
check_objc);
   return false;
 }
 
@@ -302,6 +303,256 @@ bool CompilerType::IsBeingDefined() const {
   return false;
 }
 
+bool CompilerType::IsSmartPtrType() const {
+  // These regular expressions cover shared, unique and weak pointers both from
+  // stdlibc++ and libc+++.
+
+  static llvm::Regex k_libcxx_std_unique_ptr_regex(
+  "^std::__[[:alnum:]]+::unique_ptr<.+>(( )?&)?$");
+  static llvm::Regex k_libcxx_std_shared_ptr_regex(
+  "^std::__[[:alnum:]

[Lldb-commits] [compiler-rt] [mlir] [libunwind] [flang] [lldb] [lld] [clang] [clang-tools-extra] [libcxxabi] [libc] [libcxx] [llvm] [asan] Install `pthread_atfork` (PR #75290)

2023-12-13 Thread Vitaly Buka via lldb-commits

https://github.com/vitalybuka closed 
https://github.com/llvm/llvm-project/pull/75290
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [LLDB] Add more helper functions to CompilerType class (second try). (PR #73472)

2023-12-13 Thread via lldb-commits

cmtice wrote:

Ok, I have now removed CompilerType::GetTemplateArgumentType from the new 
helper functions. 

https://github.com/llvm/llvm-project/pull/73472
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] Fix a crash from character type confusion interaction with libedit (PR #75388)

2023-12-13 Thread Kevin Frei via lldb-commits

https://github.com/kevinfrei created 
https://github.com/llvm/llvm-project/pull/75388

If you type `settings show ` LLDB might crash, depending on the version of 
libedit you're compiled with, and whether you're compiled with 
`-DLLDB_EDITLINE_USE_WCHAR=0` (and depending on how the optimizer lays out the 
stack...)

The issue has to do with trying to figure out whether the libedit `getchar` 
callback is supposed to read a wide or 8 bit character. In order to maintain 
backward compatibility, there's really no 'clean' way to do it. We just have to 
make sure that we're invoking el_[w]getc with a buffer that is as wide as the 
getchar callback (registered by the `SetGetCharacterFunction` function further 
down in `Editline.cpp`.

So, it's 'fixed' with a comment, and a wider version of the 'reply' variable.

>From 16a58d40ad0ff4a7f0fd73c3033cb758aed25d5d Mon Sep 17 00:00:00 2001
From: Kevin Frei 
Date: Wed, 13 Dec 2023 13:36:20 -0800
Subject: [PATCH] Fix a crash from character type confusion interaction with
 libedit

---
 lldb/include/lldb/Host/Editline.h|  2 ++
 lldb/source/Host/common/Editline.cpp | 10 --
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/lldb/include/lldb/Host/Editline.h 
b/lldb/include/lldb/Host/Editline.h
index c598244150788d..9049b106f02a34 100644
--- a/lldb/include/lldb/Host/Editline.h
+++ b/lldb/include/lldb/Host/Editline.h
@@ -75,6 +75,8 @@ using EditLineCharType = char;
 // to wchar_t. It is not possible to detect differentiate between the two
 // versions exactly, but this is a pretty good approximation and allows us to
 // build against almost any editline version out there.
+// It does, however, require extra care when invoking el_getc, as the type
+// of the input is a single char buffer, but the callback will write a wchar_t.
 #if LLDB_EDITLINE_USE_WCHAR || defined(EL_CLIENTDATA) || LLDB_HAVE_EL_RFUNC_T
 using EditLineGetCharType = wchar_t;
 #else
diff --git a/lldb/source/Host/common/Editline.cpp 
b/lldb/source/Host/common/Editline.cpp
index 82e17ec753ab23..ce707e530d008b 100644
--- a/lldb/source/Host/common/Editline.cpp
+++ b/lldb/source/Host/common/Editline.cpp
@@ -978,8 +978,14 @@ void Editline::DisplayCompletions(
   break;
 
 fprintf(editline.m_output_file, "More (Y/n/a): ");
-char reply = 'n';
-int got_char = el_getc(editline.m_editline, &reply);
+// The type for the output and the type for the parameter are different,
+// to allow interoperability with older versions of libedit. The container
+// for the reply must be as wide as what our implementation is using,
+// but libedit may use a narrower type depending on the build
+// configuration.
+EditLineGetCharType reply = L'n';
+int got_char = el_wgetc(editline.m_editline,
+reinterpret_cast(&reply));
 // Check for a ^C or other interruption.
 if (editline.m_editor_status == EditorStatus::Interrupted) {
   editline.m_editor_status = EditorStatus::Editing;

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


[Lldb-commits] [lldb] Fix a crash from character type confusion interaction with libedit (PR #75388)

2023-12-13 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: Kevin Frei (kevinfrei)


Changes

If you type `settings show ` LLDB might crash, depending on the 
version of libedit you're compiled with, and whether you're compiled with 
`-DLLDB_EDITLINE_USE_WCHAR=0` (and depending on how the optimizer lays out the 
stack...)

The issue has to do with trying to figure out whether the libedit `getchar` 
callback is supposed to read a wide or 8 bit character. In order to maintain 
backward compatibility, there's really no 'clean' way to do it. We just have to 
make sure that we're invoking el_[w]getc with a buffer that is as wide as the 
getchar callback (registered by the `SetGetCharacterFunction` function further 
down in `Editline.cpp`.

So, it's 'fixed' with a comment, and a wider version of the 'reply' variable.

---
Full diff: https://github.com/llvm/llvm-project/pull/75388.diff


2 Files Affected:

- (modified) lldb/include/lldb/Host/Editline.h (+2) 
- (modified) lldb/source/Host/common/Editline.cpp (+8-2) 


``diff
diff --git a/lldb/include/lldb/Host/Editline.h 
b/lldb/include/lldb/Host/Editline.h
index c598244150788d..9049b106f02a34 100644
--- a/lldb/include/lldb/Host/Editline.h
+++ b/lldb/include/lldb/Host/Editline.h
@@ -75,6 +75,8 @@ using EditLineCharType = char;
 // to wchar_t. It is not possible to detect differentiate between the two
 // versions exactly, but this is a pretty good approximation and allows us to
 // build against almost any editline version out there.
+// It does, however, require extra care when invoking el_getc, as the type
+// of the input is a single char buffer, but the callback will write a wchar_t.
 #if LLDB_EDITLINE_USE_WCHAR || defined(EL_CLIENTDATA) || LLDB_HAVE_EL_RFUNC_T
 using EditLineGetCharType = wchar_t;
 #else
diff --git a/lldb/source/Host/common/Editline.cpp 
b/lldb/source/Host/common/Editline.cpp
index 82e17ec753ab23..ce707e530d008b 100644
--- a/lldb/source/Host/common/Editline.cpp
+++ b/lldb/source/Host/common/Editline.cpp
@@ -978,8 +978,14 @@ void Editline::DisplayCompletions(
   break;
 
 fprintf(editline.m_output_file, "More (Y/n/a): ");
-char reply = 'n';
-int got_char = el_getc(editline.m_editline, &reply);
+// The type for the output and the type for the parameter are different,
+// to allow interoperability with older versions of libedit. The container
+// for the reply must be as wide as what our implementation is using,
+// but libedit may use a narrower type depending on the build
+// configuration.
+EditLineGetCharType reply = L'n';
+int got_char = el_wgetc(editline.m_editline,
+reinterpret_cast(&reply));
 // Check for a ^C or other interruption.
 if (editline.m_editor_status == EditorStatus::Interrupted) {
   editline.m_editor_status = EditorStatus::Editing;

``




https://github.com/llvm/llvm-project/pull/75388
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] Fix a crash from character type confusion interaction with libedit (PR #75388)

2023-12-13 Thread Alex Langford via lldb-commits


@@ -978,8 +978,14 @@ void Editline::DisplayCompletions(
   break;
 
 fprintf(editline.m_output_file, "More (Y/n/a): ");
-char reply = 'n';
-int got_char = el_getc(editline.m_editline, &reply);
+// The type for the output and the type for the parameter are different,
+// to allow interoperability with older versions of libedit. The container
+// for the reply must be as wide as what our implementation is using,
+// but libedit may use a narrower type depending on the build
+// configuration.
+EditLineGetCharType reply = L'n';
+int got_char = el_wgetc(editline.m_editline,

bulbazord wrote:

Why does this use `el_wgetc` instead of us switching based on 
`LLDB_EDITLINE_USE_WCHAR`? I'm not too familiar with editline, but it seems 
strange to me that we would use `el_wgetc` even if there's no `wchar_t` support.

https://github.com/llvm/llvm-project/pull/75388
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [LLDB] Add more helper functions to CompilerType class (second try). (PR #73472)

2023-12-13 Thread Alex Langford via lldb-commits

https://github.com/bulbazord approved this pull request.

Seems okay to me. I don't see anything in here that wouldn't make sense in at 
least some other languages (other than C++).

https://github.com/llvm/llvm-project/pull/73472
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [libcxx] [clang] [flang] [llvm] [lld] [mlir] [libunwind] [clang-tools-extra] [libcxxabi] [libc] [lldb] [compiler-rt] [test][hwasan] Implement sanitizer_specific for HWASAN (PR #75280)

2023-12-13 Thread Vitaly Buka via lldb-commits

https://github.com/vitalybuka edited 
https://github.com/llvm/llvm-project/pull/75280
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [libcxx] [clang] [flang] [llvm] [lld] [mlir] [libunwind] [clang-tools-extra] [libcxxabi] [libc] [lldb] [compiler-rt] [test][hwasan] Implement sanitizer_specific for HWASAN (PR #75280)

2023-12-13 Thread Vitaly Buka via lldb-commits

https://github.com/vitalybuka closed 
https://github.com/llvm/llvm-project/pull/75280
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [flang] [libcxx] [llvm] [lld] [mlir] [libunwind] [clang-tools-extra] [libcxxabi] [libc] [lldb] [compiler-rt] [hwasan] Improve support of forking with threads (PR #75291)

2023-12-13 Thread Vitaly Buka via lldb-commits

https://github.com/vitalybuka edited 
https://github.com/llvm/llvm-project/pull/75291
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [libunwind] [clang] [libc] [compiler-rt] [libcxx] [clang-tools-extra] [flang] [lldb] [lld] [mlir] [libcxxabi] [llvm] [hwasan] Improve support of forking with threads (PR #75291)

2023-12-13 Thread Vitaly Buka via lldb-commits

https://github.com/vitalybuka updated 
https://github.com/llvm/llvm-project/pull/75291

>From 1a361826b5345460c201c506f2d2c78a84aebf84 Mon Sep 17 00:00:00 2001
From: Vitaly Buka 
Date: Tue, 12 Dec 2023 22:59:10 -0800
Subject: [PATCH 1/4] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20ch?=
 =?UTF-8?q?anges=20to=20main=20this=20commit=20is=20based=20on?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Created using spr 1.3.4

[skip ci]
---
 .../include/sanitizer/hwasan_interface.h  |  4 
 compiler-rt/lib/asan/asan_fuchsia.cpp |  2 ++
 compiler-rt/lib/asan/asan_internal.h  |  1 +
 compiler-rt/lib/asan/asan_posix.cpp   | 24 +++
 compiler-rt/lib/asan/asan_rtl.cpp |  2 ++
 compiler-rt/lib/asan/asan_win.cpp |  2 ++
 compiler-rt/lib/hwasan/hwasan.cpp |  2 ++
 compiler-rt/lib/hwasan/hwasan.h   |  6 ++---
 .../lib/hwasan/hwasan_interface_internal.h|  3 +++
 compiler-rt/lib/lsan/lsan.cpp |  1 +
 compiler-rt/lib/lsan/lsan.h   |  1 +
 compiler-rt/lib/lsan/lsan_common.cpp  |  3 +++
 compiler-rt/lib/lsan/lsan_common.h|  4 
 compiler-rt/lib/lsan/lsan_fuchsia.cpp |  1 +
 compiler-rt/lib/lsan/lsan_posix.cpp   | 18 ++
 compiler-rt/test/hwasan/TestCases/tag-ptr.cpp | 24 +++
 .../TestCases/Posix/fork_threaded.c   |  2 +-
 .../sanitizer_common/sanitizer_specific.h | 13 ++
 18 files changed, 109 insertions(+), 4 deletions(-)
 create mode 100644 compiler-rt/test/hwasan/TestCases/tag-ptr.cpp

diff --git a/compiler-rt/include/sanitizer/hwasan_interface.h 
b/compiler-rt/include/sanitizer/hwasan_interface.h
index abe310c0666948..407f488a24a617 100644
--- a/compiler-rt/include/sanitizer/hwasan_interface.h
+++ b/compiler-rt/include/sanitizer/hwasan_interface.h
@@ -44,6 +44,10 @@ void SANITIZER_CDECL __hwasan_tag_memory(const volatile void 
*p,
 void *SANITIZER_CDECL __hwasan_tag_pointer(const volatile void *p,
unsigned char tag);
 
+/// Get tag from the pointer.
+unsigned char SANITIZER_CDECL
+__hwasan_get_tag_from_pointer(const volatile void *p);
+
 // Set memory tag from the current SP address to the given address to zero.
 // This is meant to annotate longjmp and other non-local jumps.
 // This function needs to know the (almost) exact destination frame address;
diff --git a/compiler-rt/lib/asan/asan_fuchsia.cpp 
b/compiler-rt/lib/asan/asan_fuchsia.cpp
index 2b15504123bee7..12625e9d75833d 100644
--- a/compiler-rt/lib/asan/asan_fuchsia.cpp
+++ b/compiler-rt/lib/asan/asan_fuchsia.cpp
@@ -240,6 +240,8 @@ void FlushUnneededASanShadowMemory(uptr p, uptr size) {
 // So this doesn't install any atexit hook like on other platforms.
 void InstallAtExitCheckLeaks() {}
 
+void InstallAtForkHandler() {}
+
 }  // namespace __asan
 
 namespace __lsan {
diff --git a/compiler-rt/lib/asan/asan_internal.h 
b/compiler-rt/lib/asan/asan_internal.h
index 5b97e77882cd67..2944ebe213b5d5 100644
--- a/compiler-rt/lib/asan/asan_internal.h
+++ b/compiler-rt/lib/asan/asan_internal.h
@@ -126,6 +126,7 @@ void *AsanDlSymNext(const char *sym);
 bool HandleDlopenInit();
 
 void InstallAtExitCheckLeaks();
+void InstallAtForkHandler();
 
 #define ASAN_ON_ERROR() \
   if (&__asan_on_error) \
diff --git a/compiler-rt/lib/asan/asan_posix.cpp 
b/compiler-rt/lib/asan/asan_posix.cpp
index e1f66641617cc1..37fca8aea51511 100644
--- a/compiler-rt/lib/asan/asan_posix.cpp
+++ b/compiler-rt/lib/asan/asan_posix.cpp
@@ -148,6 +148,30 @@ void PlatformTSDDtor(void *tsd) {
 }
 #endif
 
+void InstallAtForkHandler() {
+  auto before = []() {
+if (CAN_SANITIZE_LEAKS) {
+  __lsan::LockGlobal();
+}
+// `_lsan` functions defined regardless of `CAN_SANITIZE_LEAKS` and do the
+// job.
+__lsan::LockThreads();
+__lsan::LockAllocator();
+StackDepotLockAll();
+  };
+  auto after = []() {
+StackDepotUnlockAll();
+// `_lsan` functions defined regardless of `CAN_SANITIZE_LEAKS` and do the
+// job.
+__lsan::UnlockAllocator();
+__lsan::UnlockThreads();
+if (CAN_SANITIZE_LEAKS) {
+  __lsan::UnlockGlobal();
+}
+  };
+  pthread_atfork(before, after, after);
+}
+
 void InstallAtExitCheckLeaks() {
   if (CAN_SANITIZE_LEAKS) {
 if (common_flags()->detect_leaks && common_flags()->leak_check_at_exit) {
diff --git a/compiler-rt/lib/asan/asan_rtl.cpp 
b/compiler-rt/lib/asan/asan_rtl.cpp
index b28f9f181239b3..a61deed7382b02 100644
--- a/compiler-rt/lib/asan/asan_rtl.cpp
+++ b/compiler-rt/lib/asan/asan_rtl.cpp
@@ -493,6 +493,8 @@ static bool AsanInitInternal() {
 InstallAtExitCheckLeaks();
   }
 
+  InstallAtForkHandler();
+
 #if CAN_SANITIZE_UB
   __ubsan::InitAsPlugin();
 #endif
diff --git a/compiler-rt/lib/asan/asan_win.cpp 
b/compiler-rt/lib/asan/asan_win.cpp
index d5a30f471e2b0d..f16ce677618e4f 100644
--- a/compiler-rt/lib/asan/asa

[Lldb-commits] [libunwind] [clang] [libc] [compiler-rt] [libcxx] [clang-tools-extra] [flang] [lldb] [lld] [mlir] [libcxxabi] [llvm] [hwasan] Improve support of forking with threads (PR #75291)

2023-12-13 Thread Vitaly Buka via lldb-commits

https://github.com/vitalybuka closed 
https://github.com/llvm/llvm-project/pull/75291
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] c155269 - [lldb] Return index of element in ValueObject path instead of the element's value (#74413)

2023-12-13 Thread via lldb-commits

Author: Pete Lawrence
Date: 2023-12-13T15:26:05-08:00
New Revision: c1552695aedebe02e1973d489b93af4e64e9d1a8

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

LOG: [lldb] Return index of element in ValueObject path instead of the 
element's value (#74413)

It's more meaningful and actionable to indicate which element in the
array has an issue by returning that element's index instead of its
value. The value can be ambiguous if at least one other element has the
same value.

The first parameter for these methods is `idxs`, an array of indices
that represent a path from a (root) parent to on of its descendants,
typically though intermediate descendants. When the path leads to a
descendant that doesn't exist, the method is supposed to indicate where
things went wrong by setting an index to `&index_of_error`, the second
parameter.

The problem is the method sets `*index_of_error` to the index of the
most recent parent's child in the hierarchy, which isn't very useful if
there's more one index with the same value in the path.

In this example, each element in the path has a value that's the same as
another element.

```cpp
GetChildAtIndexPath({1, 2, 3, 3, 1, 1, 2}, &index_of_error);
```

Say the the second `1` in the path (the 5th element at `[4]`) doesn't
exist and the code returns a `nullptr`. In that situation, the code sets
`*index_of_error` to `1`, but that's an ambiguous hint can implicate the
1st, 5th, or 6th element (at `[0]`, `[4]`, or `[5]`).

It’s more helpful to set `*index_of_error` to `4` to clearly indicate
which element in `idxs` has the issue.

Added: 


Modified: 
lldb/include/lldb/Core/ValueObject.h
lldb/source/Core/ValueObject.cpp

Removed: 




diff  --git a/lldb/include/lldb/Core/ValueObject.h 
b/lldb/include/lldb/Core/ValueObject.h
index 20b3086138457f..a158199e7fab1a 100644
--- a/lldb/include/lldb/Core/ValueObject.h
+++ b/lldb/include/lldb/Core/ValueObject.h
@@ -468,7 +468,7 @@ class ValueObject {
   virtual lldb::ValueObjectSP GetChildAtIndex(size_t idx,
   bool can_create = true);
 
-  // this will always create the children if necessary
+  // The method always creates missing children in the path, if necessary.
   lldb::ValueObjectSP GetChildAtIndexPath(llvm::ArrayRef idxs,
   size_t *index_of_error = nullptr);
 
@@ -476,7 +476,7 @@ class ValueObject {
   GetChildAtIndexPath(llvm::ArrayRef> idxs,
   size_t *index_of_error = nullptr);
 
-  // this will always create the children if necessary
+  // The method always creates missing children in the path, if necessary.
   lldb::ValueObjectSP GetChildAtNamePath(llvm::ArrayRef 
names);
 
   virtual lldb::ValueObjectSP GetChildMemberWithName(llvm::StringRef name,

diff  --git a/lldb/source/Core/ValueObject.cpp 
b/lldb/source/Core/ValueObject.cpp
index a7f7ee64282d89..b13bffa0ca809b 100644
--- a/lldb/source/Core/ValueObject.cpp
+++ b/lldb/source/Core/ValueObject.cpp
@@ -398,13 +398,16 @@ ValueObject::GetChildAtIndexPath(llvm::ArrayRef 
idxs,
   if (idxs.size() == 0)
 return GetSP();
   ValueObjectSP root(GetSP());
+
+  size_t current_index = 0;
   for (size_t idx : idxs) {
 root = root->GetChildAtIndex(idx);
 if (!root) {
   if (index_of_error)
-*index_of_error = idx;
+*index_of_error = current_index;
   return root;
 }
+current_index += 1;
   }
   return root;
 }
@@ -414,13 +417,17 @@ lldb::ValueObjectSP ValueObject::GetChildAtIndexPath(
   if (idxs.size() == 0)
 return GetSP();
   ValueObjectSP root(GetSP());
+
+  size_t current_index = 0;
   for (std::pair idx : idxs) {
 root = root->GetChildAtIndex(idx.first, idx.second);
 if (!root) {
   if (index_of_error)
-*index_of_error = idx.first;
+*index_of_error = current_index;
   return root;
 }
+
+current_index += 1;
   }
   return root;
 }



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


[Lldb-commits] [lldb] [lldb] Return index of element in ValueObject path instead of the element's value (PR #74413)

2023-12-13 Thread Adrian Prantl via lldb-commits

https://github.com/adrian-prantl closed 
https://github.com/llvm/llvm-project/pull/74413
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] Make only one function that needs to be implemented when searching for types (PR #74786)

2023-12-13 Thread Adrian Prantl via lldb-commits

adrian-prantl wrote:

@clayborg Do you by any chance happen to already have a version of this patch 
that applies cleanly to apple/llvm-project stable/20230725?
If not @Michael137 might try to backport it.

https://github.com/llvm/llvm-project/pull/74786
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] Add a test for evicting unreachable modules from the global module cache (PR #74894)

2023-12-13 Thread Adrian Prantl via lldb-commits


@@ -0,0 +1,169 @@
+"""
+Test the use of the global module cache in lldb
+"""
+
+import lldb
+
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+import os
+import shutil
+from pathlib import Path
+import time
+
+class GlobalModuleCacheTestCase(TestBase):
+# NO_DEBUG_INFO_TESTCASE = True

adrian-prantl wrote:

why is this commented out?

https://github.com/llvm/llvm-project/pull/74894
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Print a warning on checksum mismatch (PR #71459)

2023-12-13 Thread Pete Lawrence via lldb-commits


@@ -300,6 +300,16 @@ size_t 
SourceManager::DisplaySourceLinesWithLineNumbersUsingLastFile(
 break;
   }
 }
+
+Checksum checksum = last_file_sp->GetFileSpec().GetChecksum();
+if (checksum && checksum != last_file_sp->GetChecksum()) {
+  llvm::call_once(last_file_sp->GetChecksumOnceFlag(), [&]() {
+s->Printf("warning: source file checksum mismatch between the debug "

PortalPete wrote:

We could use what I'm working on in my other PR, but we'd have to change this 
to pass the `CommandReturnObject` instead of just its `Stream` instance (via 
`&result..GetOutputStream()`).

https://github.com/llvm/llvm-project/pull/71459
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [LLDB] Add more helper functions to CompilerType class (second try). (PR #73472)

2023-12-13 Thread Adrian Prantl via lldb-commits


@@ -302,6 +302,195 @@ bool CompilerType::IsBeingDefined() const {
   return false;
 }
 
+bool CompilerType::IsInteger() const {
+  bool is_signed = false; // May be reset by the call below.
+  return IsIntegerType(is_signed);
+}
+
+bool CompilerType::IsFloat() const {
+  uint32_t count = 0;
+  bool is_complex = false;
+  return IsFloatingPointType(count, is_complex);
+}
+
+bool CompilerType::IsEnumerationType() const {
+  bool is_signed = false; // May be reset by the call below.
+  return IsEnumerationType(is_signed);
+}
+
+bool CompilerType::IsUnscopedEnumerationType() const {
+  return IsEnumerationType() && !IsScopedEnumerationType();
+}
+
+bool CompilerType::IsIntegerOrUnscopedEnumerationType() const {
+  return IsInteger() || IsUnscopedEnumerationType();
+}
+
+bool CompilerType::IsSigned() const {
+  if (IsEnumerationType())
+return IsEnumerationIntegerTypeSigned();
+
+  return GetTypeInfo() & lldb::eTypeIsSigned;

adrian-prantl wrote:

This function looks like it's working around a bug in GetTypeInfo?

https://github.com/llvm/llvm-project/pull/73472
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [LLDB] Add more helper functions to CompilerType class (second try). (PR #73472)

2023-12-13 Thread Adrian Prantl via lldb-commits


@@ -302,6 +302,195 @@ bool CompilerType::IsBeingDefined() const {
   return false;
 }
 
+bool CompilerType::IsInteger() const {
+  bool is_signed = false; // May be reset by the call below.
+  return IsIntegerType(is_signed);
+}
+
+bool CompilerType::IsFloat() const {
+  uint32_t count = 0;
+  bool is_complex = false;
+  return IsFloatingPointType(count, is_complex);
+}
+
+bool CompilerType::IsEnumerationType() const {
+  bool is_signed = false; // May be reset by the call below.
+  return IsEnumerationType(is_signed);
+}
+
+bool CompilerType::IsUnscopedEnumerationType() const {
+  return IsEnumerationType() && !IsScopedEnumerationType();
+}
+
+bool CompilerType::IsIntegerOrUnscopedEnumerationType() const {
+  return IsInteger() || IsUnscopedEnumerationType();
+}
+
+bool CompilerType::IsSigned() const {
+  if (IsEnumerationType())
+return IsEnumerationIntegerTypeSigned();
+
+  return GetTypeInfo() & lldb::eTypeIsSigned;

adrian-prantl wrote:

(i.e., could this be fixed by modifying TypeSystemClang::GetTypeInfo to return 
the sign bit on enums?

https://github.com/llvm/llvm-project/pull/73472
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Skip 2 newly introduced tests from running on DWARF2 and clang 11 (PR #75406)

2023-12-13 Thread Augusto Noronha via lldb-commits

https://github.com/augusto2112 created 
https://github.com/llvm/llvm-project/pull/75406

None

>From 2cb9a284a924442c2f9ab8d639268b8154af22a6 Mon Sep 17 00:00:00 2001
From: Augusto Noronha 
Date: Wed, 13 Dec 2023 15:53:37 -0800
Subject: [PATCH] [lldb] Skip 2 newly introduced tests from running on DWARF2
 and clang 11

---
 .../data-formatter/builtin-formats/TestBuiltinFormats.py   | 1 +
 .../location-list-lookup/TestLocationListLookup.py | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/lldb/test/API/functionalities/data-formatter/builtin-formats/TestBuiltinFormats.py
 
b/lldb/test/API/functionalities/data-formatter/builtin-formats/TestBuiltinFormats.py
index 4e0f14d039a743..8c3bdabeaac1ba 100644
--- 
a/lldb/test/API/functionalities/data-formatter/builtin-formats/TestBuiltinFormats.py
+++ 
b/lldb/test/API/functionalities/data-formatter/builtin-formats/TestBuiltinFormats.py
@@ -19,6 +19,7 @@ def getFormatted(self, format, expr):
 self.assertTrue(result.Succeeded(), result.GetError())
 return result.GetOutput()
 
+@skipIf(dwarf_version=["<", "3"])
 @no_debug_info_test
 @skipIfWindows
 def testAllPlatforms(self):
diff --git 
a/lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py 
b/lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py
index feea14ff355e82..c5f4a7c6dedc19 100644
--- 
a/lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py
+++ 
b/lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py
@@ -43,7 +43,8 @@ def test_loclist_frame_var(self):
 self.build()
 self.check_local_vars(self.launch(), check_expr=False)
 
-@skipIf(compiler="clang", compiler_version=["<=", "11.0"])
+@skipIf(dwarf_version=["<", "3"])
+@skipIf(compiler="clang", compiler_version=["<", "12.0"])
 @skipUnlessDarwin
 def test_loclist_expr(self):
 self.build()

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


[Lldb-commits] [lldb] [lldb] Skip 2 newly introduced tests from running on DWARF2 and clang 11 (PR #75406)

2023-12-13 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: Augusto Noronha (augusto2112)


Changes



---
Full diff: https://github.com/llvm/llvm-project/pull/75406.diff


2 Files Affected:

- (modified) 
lldb/test/API/functionalities/data-formatter/builtin-formats/TestBuiltinFormats.py
 (+1) 
- (modified) 
lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py 
(+2-1) 


``diff
diff --git 
a/lldb/test/API/functionalities/data-formatter/builtin-formats/TestBuiltinFormats.py
 
b/lldb/test/API/functionalities/data-formatter/builtin-formats/TestBuiltinFormats.py
index 4e0f14d039a743..8c3bdabeaac1ba 100644
--- 
a/lldb/test/API/functionalities/data-formatter/builtin-formats/TestBuiltinFormats.py
+++ 
b/lldb/test/API/functionalities/data-formatter/builtin-formats/TestBuiltinFormats.py
@@ -19,6 +19,7 @@ def getFormatted(self, format, expr):
 self.assertTrue(result.Succeeded(), result.GetError())
 return result.GetOutput()
 
+@skipIf(dwarf_version=["<", "3"])
 @no_debug_info_test
 @skipIfWindows
 def testAllPlatforms(self):
diff --git 
a/lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py 
b/lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py
index feea14ff355e82..c5f4a7c6dedc19 100644
--- 
a/lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py
+++ 
b/lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py
@@ -43,7 +43,8 @@ def test_loclist_frame_var(self):
 self.build()
 self.check_local_vars(self.launch(), check_expr=False)
 
-@skipIf(compiler="clang", compiler_version=["<=", "11.0"])
+@skipIf(dwarf_version=["<", "3"])
+@skipIf(compiler="clang", compiler_version=["<", "12.0"])
 @skipUnlessDarwin
 def test_loclist_expr(self):
 self.build()

``




https://github.com/llvm/llvm-project/pull/75406
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] DRAFT - Remove 2nd "error: " and print caret (^) below last input line from the developer. (PR #72150)

2023-12-13 Thread Pete Lawrence via lldb-commits

https://github.com/PortalPete updated 
https://github.com/llvm/llvm-project/pull/72150

>From 0e969a1d7b198d586108a4177ecc1fc32b372e24 Mon Sep 17 00:00:00 2001
From: Pete Lawrence 
Date: Mon, 6 Nov 2023 17:16:28 -1000
Subject: [PATCH] Remove secondary "error: " and print diagnostic line with
 caret (^) just below the developer's last command.

---
 .../lldb/Expression/DiagnosticManager.h   |  15 +--
 .../lldb/Interpreter/CommandInterpreter.h |   2 +
 .../lldb/Interpreter/CommandReturnObject.h|   4 +
 lldb/include/lldb/Utility/Status.h| 105 ++
 lldb/include/lldb/lldb-private-enumerations.h |  14 +++
 lldb/source/Expression/UserExpression.cpp |  19 +++-
 .../source/Interpreter/CommandInterpreter.cpp |  31 ++
 .../Interpreter/CommandReturnObject.cpp   |  20 +++-
 lldb/source/Utility/Status.cpp|   8 ++
 9 files changed, 199 insertions(+), 19 deletions(-)

diff --git a/lldb/include/lldb/Expression/DiagnosticManager.h 
b/lldb/include/lldb/Expression/DiagnosticManager.h
index 06bf1d115f1541..904cee4403abaa 100644
--- a/lldb/include/lldb/Expression/DiagnosticManager.h
+++ b/lldb/include/lldb/Expression/DiagnosticManager.h
@@ -11,6 +11,7 @@
 
 #include "lldb/lldb-defines.h"
 #include "lldb/lldb-types.h"
+#include "lldb/lldb-private-enumerations.h"
 
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringRef.h"
@@ -20,20 +21,6 @@
 
 namespace lldb_private {
 
-enum DiagnosticOrigin {
-  eDiagnosticOriginUnknown = 0,
-  eDiagnosticOriginLLDB,
-  eDiagnosticOriginClang,
-  eDiagnosticOriginSwift,
-  eDiagnosticOriginLLVM
-};
-
-enum DiagnosticSeverity {
-  eDiagnosticSeverityError,
-  eDiagnosticSeverityWarning,
-  eDiagnosticSeverityRemark
-};
-
 const uint32_t LLDB_INVALID_COMPILER_ID = UINT32_MAX;
 
 class Diagnostic {
diff --git a/lldb/include/lldb/Interpreter/CommandInterpreter.h 
b/lldb/include/lldb/Interpreter/CommandInterpreter.h
index 747188a15312fa..5062c05c8e98c1 100644
--- a/lldb/include/lldb/Interpreter/CommandInterpreter.h
+++ b/lldb/include/lldb/Interpreter/CommandInterpreter.h
@@ -688,6 +688,8 @@ class CommandInterpreter : public Broadcaster,
   StringList &commands_help,
   const CommandObject::CommandMap &command_map);
 
+  void PrintCaretIndicator(StatusDetail detail, IOHandler &io_handler, 
std::string &command_line);
+
   // An interruptible wrapper around the stream output
   void PrintCommandOutput(IOHandler &io_handler, llvm::StringRef str,
   bool is_stdout);
diff --git a/lldb/include/lldb/Interpreter/CommandReturnObject.h 
b/lldb/include/lldb/Interpreter/CommandReturnObject.h
index 8c4dcb54d708f0..b063d6723d1ea8 100644
--- a/lldb/include/lldb/Interpreter/CommandReturnObject.h
+++ b/lldb/include/lldb/Interpreter/CommandReturnObject.h
@@ -9,6 +9,7 @@
 #ifndef LLDB_INTERPRETER_COMMANDRETURNOBJECT_H
 #define LLDB_INTERPRETER_COMMANDRETURNOBJECT_H
 
+#include "lldb/Expression/DiagnosticManager.h"
 #include "lldb/Host/StreamFile.h"
 #include "lldb/Utility/StreamString.h"
 #include "lldb/Utility/StreamTee.h"
@@ -139,6 +140,8 @@ class CommandReturnObject {
 
   void SetStatus(lldb::ReturnStatus status);
 
+  std::vector GetStatusDetails() const;
+
   bool Succeeded() const;
 
   bool HasResult() const;
@@ -162,6 +165,7 @@ class CommandReturnObject {
   StreamTee m_err_stream;
 
   lldb::ReturnStatus m_status = lldb::eReturnStatusStarted;
+  std::vector m_status_details;
 
   bool m_did_change_process_state = false;
   bool m_suppress_immediate_output = false;
diff --git a/lldb/include/lldb/Utility/Status.h 
b/lldb/include/lldb/Utility/Status.h
index fa5768141fa45d..90e60e379a3620 100644
--- a/lldb/include/lldb/Utility/Status.h
+++ b/lldb/include/lldb/Utility/Status.h
@@ -9,6 +9,7 @@
 #ifndef LLDB_UTILITY_STATUS_H
 #define LLDB_UTILITY_STATUS_H
 
+#include "lldb/Expression/DiagnosticManager.h"
 #include "lldb/lldb-defines.h"
 #include "lldb/lldb-enumerations.h"
 #include "llvm/ADT/StringRef.h"
@@ -16,6 +17,7 @@
 #include "llvm/Support/FormatVariadic.h"
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -25,6 +27,103 @@ class raw_ostream;
 }
 
 namespace lldb_private {
+struct StatusDetail {
+private:
+  std::vector m_message_lines;
+  DiagnosticSeverity m_message_type;
+  DiagnosticOrigin m_message_origin;
+
+  // Lazy, cmputed properties
+  mutable std::optional m_message;
+  mutable std::optional m_caret_string;
+
+  static std::string StringForSeverity(DiagnosticSeverity severity) {
+switch (severity) {
+  case lldb_private::eDiagnosticSeverityError:
+return std::string("error: ");
+  case lldb_private::eDiagnosticSeverityWarning:
+return std::string("warning: ");
+  case lldb_private::eDiagnosticSeverityRemark:
+return std::string("note: ");
+}
+  }
+
+  std::vector
+  GetMessageLinesFromDiagnostic(Diagnostic *diagnostic) {
+const char newline = '\n';
+std::vector message_lines;

[Lldb-commits] [libc] [lld] [clang] [libcxx] [lldb] [mlir] [clang-tools-extra] [libcxxabi] [flang] [llvm] [openmp] [compiler-rt] [llvm] Support IFuncs on Darwin platforms (PR #73686)

2023-12-13 Thread Ahmed Bougacha via lldb-commits

https://github.com/ahmedbougacha commented:

Only a couple minor comments, LG otherwise, thanks!  The Subtarget weirdness is 
unfortunate but I can't say I have a better alternative

https://github.com/llvm/llvm-project/pull/73686
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [libcxx] [clang] [libcxxabi] [lld] [flang] [openmp] [mlir] [llvm] [libc] [compiler-rt] [clang-tools-extra] [lldb] [llvm] Support IFuncs on Darwin platforms (PR #73686)

2023-12-13 Thread Ahmed Bougacha via lldb-commits

https://github.com/ahmedbougacha edited 
https://github.com/llvm/llvm-project/pull/73686
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [clang] [openmp] [lld] [compiler-rt] [libc] [flang] [libcxxabi] [llvm] [libcxx] [clang-tools-extra] [mlir] [llvm] Support IFuncs on Darwin platforms (PR #73686)

2023-12-13 Thread Ahmed Bougacha via lldb-commits


@@ -599,6 +599,26 @@ class AsmPrinter : public MachineFunctionPass {
   /// instructions in verbose mode.
   virtual void emitImplicitDef(const MachineInstr *MI) const;
 
+  /// getSubtargetInfo() cannot be used where this is needed because we don't
+  /// have a MachineFunction when we're lowering a GlobalIFunc, and
+  /// getSubtargetInfo requires one. Override the implementation in targets
+  /// that support the Mach-O IFunc lowering.
+  virtual const MCSubtargetInfo *getIFuncMCSubtargetInfo() const {
+return nullptr;
+  }
+
+  virtual void emitMachOIFuncStubBody(Module &M, const GlobalIFunc &GI,
+  MCSymbol *LazyPointer) {

ahmedbougacha wrote:

Maybe pass the symbol string directly, since the implementations make their own 
symbol references anyway?  That way you also don't have to do the awkward 
de-mangle/re-mangle dance with the +1

https://github.com/llvm/llvm-project/pull/73686
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [llvm] [libcxxabi] [compiler-rt] [mlir] [openmp] [lldb] [flang] [clang-tools-extra] [libc] [lld] [libcxx] [clang] [llvm] Support IFuncs on Darwin platforms (PR #73686)

2023-12-13 Thread Ahmed Bougacha via lldb-commits


@@ -2147,24 +2148,80 @@ void AsmPrinter::emitGlobalIFunc(Module &M, const 
GlobalIFunc &GI) {
   assert(!TM.getTargetTriple().isOSBinFormatXCOFF() &&
  "IFunc is not supported on AIX.");
 
-  MCSymbol *Name = getSymbol(&GI);
+  auto EmitLinkage = [&](MCSymbol *Sym) {
+if (GI.hasExternalLinkage() || !MAI->getWeakRefDirective())
+  OutStreamer->emitSymbolAttribute(Sym, MCSA_Global);
+else if (GI.hasWeakLinkage() || GI.hasLinkOnceLinkage())
+  OutStreamer->emitSymbolAttribute(Sym, MCSA_WeakReference);
+else
+  assert(GI.hasLocalLinkage() && "Invalid ifunc linkage");
+  };
 
-  if (GI.hasExternalLinkage() || !MAI->getWeakRefDirective())
-OutStreamer->emitSymbolAttribute(Name, MCSA_Global);
-  else if (GI.hasWeakLinkage() || GI.hasLinkOnceLinkage())
-OutStreamer->emitSymbolAttribute(Name, MCSA_WeakReference);
-  else
-assert(GI.hasLocalLinkage() && "Invalid ifunc linkage");
+  if (TM.getTargetTriple().isOSBinFormatELF()) {
+MCSymbol *Name = getSymbol(&GI);
+EmitLinkage(Name);
+OutStreamer->emitSymbolAttribute(Name, MCSA_ELF_TypeIndFunction);
+emitVisibility(Name, GI.getVisibility());
+
+// Emit the directives as assignments aka .set:
+const MCExpr *Expr = lowerConstant(GI.getResolver());
+OutStreamer->emitAssignment(Name, Expr);
+MCSymbol *LocalAlias = getSymbolPreferLocal(GI);
+if (LocalAlias != Name)
+  OutStreamer->emitAssignment(LocalAlias, Expr);
+  } else if (TM.getTargetTriple().isOSBinFormatMachO() &&

ahmedbougacha wrote:

early return with if->fatal_error, for indentation?

https://github.com/llvm/llvm-project/pull/73686
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Skip 2 newly introduced tests from running on DWARF2 and clang 11 (PR #75406)

2023-12-13 Thread Adrian Prantl via lldb-commits

https://github.com/adrian-prantl approved this pull request.


https://github.com/llvm/llvm-project/pull/75406
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] b047c91 - [lldb] Skip 2 newly introduced tests from running on DWARF2 and clang 11 (#75406)

2023-12-13 Thread via lldb-commits

Author: Augusto Noronha
Date: 2023-12-13T16:30:39-08:00
New Revision: b047c9116432375586ddf7f01bf272f99d9a005c

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

LOG: [lldb] Skip 2 newly introduced tests from running on DWARF2 and clang 11 
(#75406)

Added: 


Modified: 

lldb/test/API/functionalities/data-formatter/builtin-formats/TestBuiltinFormats.py
lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py

Removed: 




diff  --git 
a/lldb/test/API/functionalities/data-formatter/builtin-formats/TestBuiltinFormats.py
 
b/lldb/test/API/functionalities/data-formatter/builtin-formats/TestBuiltinFormats.py
index 4e0f14d039a743..8c3bdabeaac1ba 100644
--- 
a/lldb/test/API/functionalities/data-formatter/builtin-formats/TestBuiltinFormats.py
+++ 
b/lldb/test/API/functionalities/data-formatter/builtin-formats/TestBuiltinFormats.py
@@ -19,6 +19,7 @@ def getFormatted(self, format, expr):
 self.assertTrue(result.Succeeded(), result.GetError())
 return result.GetOutput()
 
+@skipIf(dwarf_version=["<", "3"])
 @no_debug_info_test
 @skipIfWindows
 def testAllPlatforms(self):

diff  --git 
a/lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py 
b/lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py
index feea14ff355e82..c5f4a7c6dedc19 100644
--- 
a/lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py
+++ 
b/lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py
@@ -43,7 +43,8 @@ def test_loclist_frame_var(self):
 self.build()
 self.check_local_vars(self.launch(), check_expr=False)
 
-@skipIf(compiler="clang", compiler_version=["<=", "11.0"])
+@skipIf(dwarf_version=["<", "3"])
+@skipIf(compiler="clang", compiler_version=["<", "12.0"])
 @skipUnlessDarwin
 def test_loclist_expr(self):
 self.build()



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


  1   2   >