[Lldb-commits] [lldb] Colorize output when searching for symbols in lldb (PR #69422)

2023-11-20 Thread David Spickett via lldb-commits
=?utf-8?q?José?= L. Junior ,taalhaataahir0102
 <23100...@lums.edu.pk>,
=?utf-8?q?José?= L. Junior ,
=?utf-8?q?José?= L. Junior ,taalhaataahir0102
 <23100...@lums.edu.pk>
Message-ID:
In-Reply-To: 


DavidSpickett wrote:

Pretty sure you need to follow the specific co-author format as shown on:
https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-with-multiple-authors

The biggest reason being that `git log --author` is going to search by name 
and/or email, not GitHub username.

Unless you have done that and GitHub is doing something clever and rendering it 
as `@` here in but I don't think that's the case.

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


[Lldb-commits] [lldb] Colorize output when searching for symbols in lldb (PR #69422)

2023-11-20 Thread via lldb-commits
=?utf-8?q?José?= L. Junior ,taalhaataahir0102
 <23100...@lums.edu.pk>,
=?utf-8?q?José?= L. Junior ,
=?utf-8?q?José?= L. Junior ,taalhaataahir0102
 <23100...@lums.edu.pk>
Message-ID:
In-Reply-To: 


taalhaataahir0102 wrote:

Hi David! We're new to git that why there are some stupid things are done by me 
in the above commit. 😞 Sorry for that.
Now trying to to do this in a new branch:

> Then take the opportunity to squash your commits and rebase them onto the 
> latest main branch. You will do fixup commits on top of this when other 
> reviewers request changes, then the final set of commits will be squashed and 
> the PR title/message is used as the commit message.

Once done successfully there, I'll update this branch and we'll inform you + 
change the status from draft to PR for other reviewers. 
1 thing which we are not able to get: If we squash our commits into a single 
commit and add 2 authors for that commit (Jose and Talha), like done in this 
one: 
https://github.com/llvm/llvm-project/pull/69422/commits/4a47c6a9185ce157e40f79a7adf9ca0b95af7c22
 
Than the part of code updated by any of us will be by the name of both of us 
right? 
e.g.,
int a = 10 // commit by Talha
int b = 20; // commit by Jose
But after squash and co-author:
int a = 10 // commit by Talha and Jose
int b = 20; // commit by Talha and Jose
This is what going to happen right? But than how we will be able to see which 
changes are made by the individuals? 🤔 And whats the purpose of squashing 🤔 

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


[Lldb-commits] [lldb] Colorize output when searching for symbols in lldb (PR #69422)

2023-11-20 Thread David Spickett via lldb-commits
=?utf-8?q?José?= L. Junior ,taalhaataahir0102
 <23100...@lums.edu.pk>,
=?utf-8?q?José?= L. Junior ,
=?utf-8?q?José?= L. Junior ,taalhaataahir0102
 <23100...@lums.edu.pk>
Message-ID:
In-Reply-To: 


DavidSpickett wrote:

> This is what going to happen right? But than how we will be able to see which 
> changes are made by the individuals? 🤔 And whats the purpose of squashing 🤔

So the only way to keep that level of detail is to do all your changes as 
individual commits from each author. While that could be done...

llvm-project does not allow (with some minor exceptions) folks to land sets of 
commits from a PR without squashing them first. the general expected thing is 
that you have one initial commit, and a lot of fixup commits on top of that 
responding to comments. When that's landed it gets squashed into one commit and 
the PR's message is used as the commit message.

The purpose of squashing right now is mostly because you're at a point where 
you know it all works, and squashing them all down will give a nice clean base 
to start the proper review with. Folks will inevitably ask for some changes, 
and you won't be managing 7+N fixup commits.

If there were something, let's say, uncertain in one of the fixup commits, I'd 
tell you not to squash it until reviewers had debated it. I don't see anything 
like that here.

So it's not required as it'll happen before landing anyway, but if you want to 
manage a smaller stack of commits it can help. It's a judgement call. Sometimes 
reviewers will surprise you, so you can always keep a copy of the original 
branch locally just in case.

Which means that yes, the final commit is one commit with 2 authors. And that's 
the most detail that git will track in that form. If you work on a different 
project that allows rebasing or merge commits, you may be able to keep the 
history of who added what.

If you want to add a sentence or two to describe what aspects were tackled by 
whom, you can do so (in addition to the co-author tag), but the content of that 
is up to you. For instance I saw a patch the other day that was like "tests 
from X, improved implementation from review Y, I added docs on top and cleaned 
it up". Keep it brief, we don't need an item by item breakdown.

As far as llvm-project is concerned, as long as multiple authors are noted in 
some way, that's fine.

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


[Lldb-commits] [lldb] Colorize output when searching for symbols in lldb (PR #69422)

2023-11-20 Thread David Spickett via lldb-commits
=?utf-8?q?José?= L. Junior ,taalhaataahir0102
 <23100...@lums.edu.pk>,
=?utf-8?q?José?= L. Junior ,
=?utf-8?q?José?= L. Junior ,taalhaataahir0102
 <23100...@lums.edu.pk>
Message-ID:
In-Reply-To: 


DavidSpickett wrote:

If you are working for some kind of group or scheme, I suggest you ask them how 
credit should be noted if that's important to them.

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


[Lldb-commits] [libc] [llvm] [lldb] [clang] [flang] [mlir] [compiler-rt] [libunwind] [clang-tools-extra] [libcxxabi] [lld] [libcxx] PR#72453 : Exceeding maximum file name length (PR #72654)

2023-11-20 Thread Shahid Iqbal via lldb-commits

https://github.com/shahidiqbal13 updated 
https://github.com/llvm/llvm-project/pull/72654

>From b6bfb18e25c111baf6c95a0a4a1c3d667bb25b6d Mon Sep 17 00:00:00 2001
From: Shahid Iqbal 
Date: Thu, 16 Nov 2023 11:26:43 -0500
Subject: [PATCH 1/6] TESTING infra

---
 clang/NOTES.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/clang/NOTES.txt b/clang/NOTES.txt
index f06ea8c70cd3409..c83dda52a1fc21e 100644
--- a/clang/NOTES.txt
+++ b/clang/NOTES.txt
@@ -4,6 +4,8 @@
 
 //===-===//
 
+//TESTING git infra//
+
 To time GCC preprocessing speed without output, use:
"time gcc -MM file"
 This is similar to -Eonly.

>From 7662d4f177d32c3159c1c48b11ce3884e4ea78c8 Mon Sep 17 00:00:00 2001
From: Shahid Iqbal 
Date: Fri, 17 Nov 2023 09:26:31 -0500
Subject: [PATCH 2/6] PR#72453 : Exceeding maximum file name length

---
 llvm/include/llvm/Analysis/DOTGraphTraitsPass.h | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h 
b/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
index 07c08bc1cc3bcb6..f78d8ff52ee3932 100644
--- a/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
+++ b/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
@@ -17,6 +17,8 @@
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/GraphWriter.h"
 
+#define MAX_FILENAME_LEN 255
+
 namespace llvm {
 
 /// Default traits class for extracting a graph from an analysis pass.
@@ -94,7 +96,7 @@ void printGraphForFunction(Function &F, GraphT Graph, 
StringRef Name,
   raw_fd_ostream File(Filename, EC, sys::fs::OF_TextWithCRLF);
   std::string GraphName = DOTGraphTraits::getGraphName(Graph);
 
-  if (!EC)
+  if (!EC && (Filename.length() <= MAX_FILENAME_LEN ))
 WriteGraph(File, Graph, IsSimple,
GraphName + " for '" + F.getName() + "' function");
   else
@@ -280,7 +282,7 @@ class DOTGraphTraitsModulePrinterWrapperPass : public 
ModulePass {
 raw_fd_ostream File(Filename, EC, sys::fs::OF_TextWithCRLF);
 std::string Title = DOTGraphTraits::getGraphName(Graph);
 
-if (!EC)
+if (!EC && (Filename.length() <= MAX_FILENAME_LEN ))
   WriteGraph(File, Graph, IsSimple, Title);
 else
   errs() << "  error opening file for writing!";
@@ -310,7 +312,7 @@ void WriteDOTGraphToFile(Function &F, GraphT &&Graph,
   std::string GraphName = DOTGraphTraits::getGraphName(Graph);
   std::string Title = GraphName + " for '" + F.getName().str() + "' function";
 
-  if (!EC)
+  if (!EC && (Filename.length() <= MAX_FILENAME_LEN ))
 WriteGraph(File, Graph, IsSimple, Title);
   else
 errs() << "  error opening file for writing!";

>From d3d33e5bfe907b761ecb9065fe45b698c3ce0672 Mon Sep 17 00:00:00 2001
From: Shahid Iqbal 
Date: Fri, 17 Nov 2023 09:48:43 -0500
Subject: [PATCH 3/6] Reverted the earlier test text

---
 clang/NOTES.txt | 2 --
 1 file changed, 2 deletions(-)

diff --git a/clang/NOTES.txt b/clang/NOTES.txt
index c83dda52a1fc21e..f06ea8c70cd3409 100644
--- a/clang/NOTES.txt
+++ b/clang/NOTES.txt
@@ -4,8 +4,6 @@
 
 //===-===//
 
-//TESTING git infra//
-
 To time GCC preprocessing speed without output, use:
"time gcc -MM file"
 This is similar to -Eonly.

>From 41c19e2ceee80cce8a60d0fd869958a0783ddb7f Mon Sep 17 00:00:00 2001
From: Shahid Iqbal 
Date: Fri, 17 Nov 2023 10:06:52 -0500
Subject: [PATCH 4/6] Code refactoring

---
 llvm/include/llvm/Analysis/DOTGraphTraitsPass.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h 
b/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
index f78d8ff52ee3932..f7ab6df3b4dd819 100644
--- a/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
+++ b/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
@@ -96,7 +96,7 @@ void printGraphForFunction(Function &F, GraphT Graph, 
StringRef Name,
   raw_fd_ostream File(Filename, EC, sys::fs::OF_TextWithCRLF);
   std::string GraphName = DOTGraphTraits::getGraphName(Graph);
 
-  if (!EC && (Filename.length() <= MAX_FILENAME_LEN ))
+  if (!EC && (Filename.length() <= MAX_FILENAME_LEN))
 WriteGraph(File, Graph, IsSimple,
GraphName + " for '" + F.getName() + "' function");
   else
@@ -282,7 +282,7 @@ class DOTGraphTraitsModulePrinterWrapperPass : public 
ModulePass {
 raw_fd_ostream File(Filename, EC, sys::fs::OF_TextWithCRLF);
 std::string Title = DOTGraphTraits::getGraphName(Graph);
 
-if (!EC && (Filename.length() <= MAX_FILENAME_LEN ))
+if (!EC && (Filename.length() <= MAX_FILENAME_LEN))
   WriteGraph(File, Graph, IsSimple, Title);
 else
   errs() << "  error opening file for writing!";
@@ -312,7 +312,7 @@ void WriteDOTGraphToFile(Function &F, GraphT &&Graph,
   std::string GraphName = DOTGraphTraits::getGraphName(Graph);
   std::string Title = GraphName + " for '" + F.getName().str() + "' function";
 
-  if (!EC && (Filename.length() 

[Lldb-commits] [compiler-rt] [lld] [libcxx] [clang-tools-extra] [clang] [llvm] [libc] [lldb] [mlir] [flang] [MLIR] Enable GPU Dialect to SYCL runtime integration (PR #71430)

2023-11-20 Thread Fabian Mora via lldb-commits


@@ -61,6 +63,7 @@ registerAllGPUToLLVMIRTranslations(DialectRegistry ®istry) 
{
   registerLLVMDialectTranslation(registry);
   registerNVVMDialectTranslation(registry);
   registerROCDLDialectTranslation(registry);
+  registerSPIRVDialectTranslation(registry);

fabianmcg wrote:

@silee2 can you add a test 
[here](https://github.com/llvm/llvm-project/blob/main/mlir/test/Target/LLVMIR/gpu.mlir#L46-L49)
 using the GPU SPIR-V target attribute?

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


[Lldb-commits] [lld] [lldb] [clang-tools-extra] [libunwind] [flang] [llvm] [clang] [libc] [libcxx] [compiler-rt] [Clang] Add __builtin_vectorelements to get number of elements in vector (PR #69010)

2023-11-20 Thread Lawrence Benson via lldb-commits


@@ -5126,6 +5126,14 @@ void CXXNameMangler::mangleExpression(const Expr *E, 
unsigned Arity,
   Diags.Report(DiagID);
   return;
 }
+case UETT_VectorElements: {

lawben wrote:

@philnik777 I'm adding you here because of your recent commit that adds 
`__datasizeof` (#67805). This is essentially the same code path and you also 
specify the "cannot mangle" for Itanium but not for Microsoft. Do you know if 
this is needed for Microsoft (see comments above)? 

I'm happy to address this for `__builtin_vectorelements`, but I really don't 
know where to start and `__datasizeof` seems to be the same.

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


[Lldb-commits] [clang-tools-extra] [libc] [llvm] [clang] [libunwind] [lld] [libcxx] [lldb] [compiler-rt] [libcxxabi] [mlir] [flang] PR#72453 : Exceeding maximum file name length (PR #72654)

2023-11-20 Thread Todd A. Anderson via lldb-commits


@@ -83,10 +85,29 @@ struct DOTGraphTraitsViewer
   StringRef Name;
 };
 
+static void shortenFileName(std::string &FN, unsigned char len = 250) {
+
+  FN = FN.substr(0, len);
+  if (nameObj.empty())
+nameObj.push_back(FN);
+
+  else {
+for (auto it = nameObj.begin(); it != nameObj.end(); it++) {
+  if (*it == FN) {
+FN = FN.substr(0, --len);

DrTodd13 wrote:

@shahidiqbal13 Thanks for the changes. Just one minor point, you don't need the 
initial "if" to check for empty set anymore.  The first time through the loop 
if it isn't found in the set then it will add it.  Also, I don't know how much 
we need to consider this but sometimes ordering will be reversed and so the 
filename assigned to a function would be different in your approach based on 
which function is encountered first.  With the hash approach this wouldn't 
happen.  At this point, we need input from regular LLVM devs in terms of how 
they like to do things.

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


[Lldb-commits] [lldb] Fix command escape bug in lldb-dap (PR #72902)

2023-11-20 Thread via lldb-commits

https://github.com/jeffreytan81 created 
https://github.com/llvm/llvm-project/pull/72902

https://github.com/llvm/llvm-project/pull/69238 caused breakage in VSCode debug 
console usage -- the user's input is always treated as commands instead of 
expressions (the same behavior as if empty command escape prefix is specified). 

The bug is in one overload of `GetString()` which did not respect the default 
value of "`". But more important, I am puzzled to find out why the regression 
is not caught by lldb test (testdap_evaluate). Turns out 
https://github.com/llvm/llvm-project/pull/69238 specifies commandEscapePrefix 
default value in test framework to be "`" while VSCode will default not specify 
any commandEscapePrefix at all. Changing it to None will fail 
`testdap_evaluate`. We should align the default behavior between DAP client and 
testcase. 

This patches fixes the bug in `GetString()` and changed the default value of 
commandEscapePrefix in testcases to be None (be consistent with IDE). 

>From 2838929d255642942dfe33d6584d0486d026f926 Mon Sep 17 00:00:00 2001
From: jeffreytan81 
Date: Mon, 20 Nov 2023 10:54:39 -0800
Subject: [PATCH] Fix command escape bug in lldb-dap

---
 .../Python/lldbsuite/test/tools/lldb-dap/dap_server.py| 2 +-
 .../Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py  | 4 ++--
 lldb/tools/lldb-dap/JSONUtils.cpp | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py 
b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
index 518e3b9cf5bab33..bb863bb87191763 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
@@ -731,7 +731,7 @@ def request_launch(
 postRunCommands=None,
 enableAutoVariableSummaries=False,
 enableSyntheticChildDebugging=False,
-commandEscapePrefix="`",
+commandEscapePrefix=None,
 customFrameFormat=None,
 customThreadFormat=None,
 ):
diff --git 
a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py 
b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py
index 0cf9d4fde49488f..4ccd6014e54be6a 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py
@@ -354,7 +354,7 @@ def launch(
 postRunCommands=None,
 enableAutoVariableSummaries=False,
 enableSyntheticChildDebugging=False,
-commandEscapePrefix="`",
+commandEscapePrefix=None,
 customFrameFormat=None,
 customThreadFormat=None,
 ):
@@ -434,7 +434,7 @@ def build_and_launch(
 lldbDAPEnv=None,
 enableAutoVariableSummaries=False,
 enableSyntheticChildDebugging=False,
-commandEscapePrefix="`",
+commandEscapePrefix=None,
 customFrameFormat=None,
 customThreadFormat=None,
 ):
diff --git a/lldb/tools/lldb-dap/JSONUtils.cpp 
b/lldb/tools/lldb-dap/JSONUtils.cpp
index 50ade02801529c3..03a43f9da87f241 100644
--- a/lldb/tools/lldb-dap/JSONUtils.cpp
+++ b/lldb/tools/lldb-dap/JSONUtils.cpp
@@ -57,7 +57,7 @@ llvm::StringRef GetString(const llvm::json::Object *obj, 
llvm::StringRef key,
   llvm::StringRef defaultValue) {
   if (obj == nullptr)
 return defaultValue;
-  return GetString(*obj, key);
+  return GetString(*obj, key, defaultValue);
 }
 
 // Gets an unsigned integer from a JSON object using the key, or returns the

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


[Lldb-commits] [lldb] Fix command escape bug in lldb-dap (PR #72902)

2023-11-20 Thread via lldb-commits

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


[Lldb-commits] [lldb] Fix command escape bug in lldb-dap (PR #72902)

2023-11-20 Thread via lldb-commits

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


[Lldb-commits] [lldb] Fix command escape bug in lldb-dap (PR #72902)

2023-11-20 Thread via lldb-commits

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


[Lldb-commits] [lldb] Fix command escape bug in lldb-dap (PR #72902)

2023-11-20 Thread via lldb-commits

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


[Lldb-commits] [lldb] Fix command escape bug in lldb-dap (PR #72902)

2023-11-20 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: None (jeffreytan81)


Changes

https://github.com/llvm/llvm-project/pull/69238 caused breakage in VSCode debug 
console usage -- the user's input is always treated as commands instead of 
expressions (the same behavior as if empty command escape prefix is specified). 

The bug is in one overload of `GetString()` which did not respect the default 
value of "\`". But more important, I am puzzled to find out why the regression 
is not caught by lldb test (testdap_evaluate). Turns out 
https://github.com/llvm/llvm-project/pull/69238 specifies commandEscapePrefix 
default value in test framework to be "\`" while VSCode will default not 
specify any commandEscapePrefix at all. Changing it to None will fail 
`testdap_evaluate`. We should align the default behavior between DAP client and 
testcase. 

This patches fixes the bug in `GetString()` and changed the default value of 
commandEscapePrefix in testcases to be None (be consistent with IDE). 

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


3 Files Affected:

- (modified) lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py 
(+1-1) 
- (modified) 
lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py (+2-2) 
- (modified) lldb/tools/lldb-dap/JSONUtils.cpp (+1-1) 


``diff
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py 
b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
index 518e3b9cf5bab33..bb863bb87191763 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
@@ -731,7 +731,7 @@ def request_launch(
 postRunCommands=None,
 enableAutoVariableSummaries=False,
 enableSyntheticChildDebugging=False,
-commandEscapePrefix="`",
+commandEscapePrefix=None,
 customFrameFormat=None,
 customThreadFormat=None,
 ):
diff --git 
a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py 
b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py
index 0cf9d4fde49488f..4ccd6014e54be6a 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py
@@ -354,7 +354,7 @@ def launch(
 postRunCommands=None,
 enableAutoVariableSummaries=False,
 enableSyntheticChildDebugging=False,
-commandEscapePrefix="`",
+commandEscapePrefix=None,
 customFrameFormat=None,
 customThreadFormat=None,
 ):
@@ -434,7 +434,7 @@ def build_and_launch(
 lldbDAPEnv=None,
 enableAutoVariableSummaries=False,
 enableSyntheticChildDebugging=False,
-commandEscapePrefix="`",
+commandEscapePrefix=None,
 customFrameFormat=None,
 customThreadFormat=None,
 ):
diff --git a/lldb/tools/lldb-dap/JSONUtils.cpp 
b/lldb/tools/lldb-dap/JSONUtils.cpp
index 50ade02801529c3..03a43f9da87f241 100644
--- a/lldb/tools/lldb-dap/JSONUtils.cpp
+++ b/lldb/tools/lldb-dap/JSONUtils.cpp
@@ -57,7 +57,7 @@ llvm::StringRef GetString(const llvm::json::Object *obj, 
llvm::StringRef key,
   llvm::StringRef defaultValue) {
   if (obj == nullptr)
 return defaultValue;
-  return GetString(*obj, key);
+  return GetString(*obj, key, defaultValue);
 }
 
 // Gets an unsigned integer from a JSON object using the key, or returns the

``




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


[Lldb-commits] [lldb] Fix command escape bug in lldb-dap (PR #72902)

2023-11-20 Thread Walter Erquinigo via lldb-commits

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


[Lldb-commits] [lldb] Fix command escape bug in lldb-dap (PR #72902)

2023-11-20 Thread Walter Erquinigo via lldb-commits

https://github.com/walter-erquinigo approved this pull request.


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


[Lldb-commits] [lldb] Fix command escape bug in lldb-dap (PR #72902)

2023-11-20 Thread Walter Erquinigo via lldb-commits


@@ -57,7 +57,7 @@ llvm::StringRef GetString(const llvm::json::Object *obj, 
llvm::StringRef key,
   llvm::StringRef defaultValue) {
   if (obj == nullptr)
 return defaultValue;
-  return GetString(*obj, key);

walter-erquinigo wrote:

owch!

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


[Lldb-commits] [lldb] [lldb][split-dwarf] implement GetSeparateDebugInfo for SymbolFileOnDemand (PR #71230)

2023-11-20 Thread Greg Clayton via lldb-commits

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

Looks good!

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


[Lldb-commits] [lldb] Fix command escape bug in lldb-dap (PR #72902)

2023-11-20 Thread via lldb-commits

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


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


[Lldb-commits] [lldb] Fix command escape bug in lldb-dap (PR #72902)

2023-11-20 Thread Alex Langford via lldb-commits

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

LGTM. It may be a good idea to move these APIs over to use std::optional 
instead of taking a default value so we can use 'value_or' instead of having to 
write logic to handle the default value through a parameter.

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


[Lldb-commits] [lldb] 69a5869 - [lldb][split-dwarf] implement GetSeparateDebugInfo for SymbolFileOnDemand (#71230)

2023-11-20 Thread via lldb-commits

Author: Tom Yang
Date: 2023-11-20T12:17:15-08:00
New Revision: 69a5869da4906f61caf59ff021559ca7d974c5f9

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

LOG: [lldb][split-dwarf] implement GetSeparateDebugInfo for SymbolFileOnDemand 
(#71230)

Small change to get `image dump separate-debug-info` working when using
`symbols.load-on-demand`.

Added tests to `TestDumpDwo`, and enabled the test for all platforms. If we 
fail to build, we skip the test, so this shouldn't cause the test to fail on 
unsupported platforms.
```
bin/lldb-dotest -p TestDumpDwo
```

It's easy to verify this manually by running 
```
lldb --one-line-before-file "settings set symbols.load-on-demand true" 

(lldb) image dump separate-debug-info
...
```

-

Co-authored-by: Tom Yang 

Added: 
lldb/test/API/commands/target/dump-separate-debug-info/dwo/foo.c
lldb/test/API/commands/target/dump-separate-debug-info/dwo/main.c

Modified: 
lldb/include/lldb/Symbol/SymbolFileOnDemand.h
lldb/test/API/commands/target/dump-separate-debug-info/dwo/Makefile
lldb/test/API/commands/target/dump-separate-debug-info/dwo/TestDumpDwo.py
lldb/test/API/commands/target/dump-separate-debug-info/oso/TestDumpOso.py

Removed: 
lldb/test/API/commands/target/dump-separate-debug-info/dwo/foo.cpp
lldb/test/API/commands/target/dump-separate-debug-info/dwo/main.cpp



diff  --git a/lldb/include/lldb/Symbol/SymbolFileOnDemand.h 
b/lldb/include/lldb/Symbol/SymbolFileOnDemand.h
index adf1017ce73c11b..9cbcef2a111d320 100644
--- a/lldb/include/lldb/Symbol/SymbolFileOnDemand.h
+++ b/lldb/include/lldb/Symbol/SymbolFileOnDemand.h
@@ -228,6 +228,11 @@ class SymbolFileOnDemand : public lldb_private::SymbolFile 
{
 return m_sym_file_impl->SetDebugInfoHadFrameVariableErrors();
   }
 
+  bool GetSeparateDebugInfo(StructuredData::Dictionary &d,
+bool errors_only) override {
+return m_sym_file_impl->GetSeparateDebugInfo(d, errors_only);
+  }
+
   lldb::TypeSP MakeType(lldb::user_id_t uid, ConstString name,
 std::optional byte_size,
 SymbolContextScope *context,

diff  --git 
a/lldb/test/API/commands/target/dump-separate-debug-info/dwo/Makefile 
b/lldb/test/API/commands/target/dump-separate-debug-info/dwo/Makefile
index 3b6d788b2b0130a..99b3fb3bd7762f7 100644
--- a/lldb/test/API/commands/target/dump-separate-debug-info/dwo/Makefile
+++ b/lldb/test/API/commands/target/dump-separate-debug-info/dwo/Makefile
@@ -1,4 +1,4 @@
-CXX_SOURCES := main.cpp foo.cpp
-CFLAGS_EXTRAS := -gsplit-dwarf
-
 include Makefile.rules
+
+a.out:
+   $(CC) -target x86_64-pc-linux-elf -g -gsplit-dwarf -o $@ 
$(SRCDIR)/main.c $(SRCDIR)/foo.c

diff  --git 
a/lldb/test/API/commands/target/dump-separate-debug-info/dwo/TestDumpDwo.py 
b/lldb/test/API/commands/target/dump-separate-debug-info/dwo/TestDumpDwo.py
index 163f5a112367693..05c72945b14390e 100644
--- a/lldb/test/API/commands/target/dump-separate-debug-info/dwo/TestDumpDwo.py
+++ b/lldb/test/API/commands/target/dump-separate-debug-info/dwo/TestDumpDwo.py
@@ -7,6 +7,7 @@
 
 from lldbsuite.test import lldbtest, lldbutil
 from lldbsuite.test.decorators import *
+from lldbsuite.test_event.build_exception import BuildError
 
 
 class TestDumpDWO(lldbtest.TestBase):
@@ -23,14 +24,17 @@ def get_dwos_from_json_output(self):
 result[symfile_entry["symfile"]] = dwo_dict
 return result
 
-@skipIfRemote
-@skipIfDarwin
-@skipIfWindows
+def build_and_skip_if_error(self):
+try:
+self.build()
+except BuildError as e:
+self.skipTest(f"Skipping test due to build exception: {e}")
+
 def test_dwos_loaded_json_output(self):
-self.build()
+self.build_and_skip_if_error()
 exe = self.getBuildArtifact("a.out")
-main_dwo = self.getBuildArtifact("main.dwo")
-foo_dwo = self.getBuildArtifact("foo.dwo")
+main_dwo = self.getBuildArtifact("a.out-main.dwo")
+foo_dwo = self.getBuildArtifact("a.out-foo.dwo")
 
 # Make sure dwo files exist
 self.assertTrue(os.path.exists(main_dwo), f'Make sure "{main_dwo}" 
file exists')
@@ -43,17 +47,14 @@ def test_dwos_loaded_json_output(self):
 
 # Check the output
 output = self.get_dwos_from_json_output()
-self.assertTrue(output[exe]["main.dwo"]["loaded"])
-self.assertTrue(output[exe]["foo.dwo"]["loaded"])
+self.assertTrue(output[exe]["a.out-main.dwo"]["loaded"])
+self.assertTrue(output[exe]["a.out-foo.dwo"]["loaded"])
 
-@skipIfRemote
-@skipIfDarwin
-@skipIfWindows
 def test_dwos_not_loaded_json_output(self):
-self.build()
+self.build_and_skip_if_error()
 exe = self.getBuildArtifact(

[Lldb-commits] [lldb] [lldb][split-dwarf] implement GetSeparateDebugInfo for SymbolFileOnDemand (PR #71230)

2023-11-20 Thread Tom Yang via lldb-commits

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


[Lldb-commits] [llvm] [lld] [lldb] [compiler-rt] [mlir] [clang] [flang] [libcxx] [mlir][async] Avoid crash when not using `func.func` (PR #72801)

2023-11-20 Thread Rik Huijzer via lldb-commits

https://github.com/rikhuijzer updated 
https://github.com/llvm/llvm-project/pull/72801

>From 8abbf36f741c8363155e0f3cbf2450ff7f1f0801 Mon Sep 17 00:00:00 2001
From: Rik Huijzer 
Date: Sun, 19 Nov 2023 18:31:38 +0100
Subject: [PATCH 1/3] [mlir][async] Avoid crash when not using `func.func`

---
 .../Async/Transforms/AsyncParallelFor.cpp |  4 
 .../Async/async-parallel-for-compute-fn.mlir  | 19 +++
 mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp   |  2 ++
 3 files changed, 25 insertions(+)

diff --git a/mlir/lib/Dialect/Async/Transforms/AsyncParallelFor.cpp 
b/mlir/lib/Dialect/Async/Transforms/AsyncParallelFor.cpp
index 12a28c2e23b221a..639bc7f9ec7f112 100644
--- a/mlir/lib/Dialect/Async/Transforms/AsyncParallelFor.cpp
+++ b/mlir/lib/Dialect/Async/Transforms/AsyncParallelFor.cpp
@@ -102,6 +102,10 @@ struct AsyncParallelForPass
 : public impl::AsyncParallelForBase {
   AsyncParallelForPass() = default;
 
+  void getDependentDialects(DialectRegistry ®istry) const override {
+registry.insert();
+  }
+
   AsyncParallelForPass(bool asyncDispatch, int32_t numWorkerThreads,
int32_t minTaskSize) {
 this->asyncDispatch = asyncDispatch;
diff --git a/mlir/test/Dialect/Async/async-parallel-for-compute-fn.mlir 
b/mlir/test/Dialect/Async/async-parallel-for-compute-fn.mlir
index 2115b1881fa6d66..fa3b53dd839c6c6 100644
--- a/mlir/test/Dialect/Async/async-parallel-for-compute-fn.mlir
+++ b/mlir/test/Dialect/Async/async-parallel-for-compute-fn.mlir
@@ -69,6 +69,25 @@ func.func @sink_constant_step(%arg0: memref, %lb: 
index, %ub: index) {
 
 // -
 
+// Smoke test that parallel for doesn't crash when func dialect is not loaded.
+
+// CHECK-LABEL: llvm.func @without_func_dialect()
+llvm.func @without_func_dialect() {
+  %cst = arith.constant 0.0 : f32
+
+  %c0 = arith.constant 0 : index
+  %c22 = arith.constant 22 : index
+  %c1 = arith.constant 1 : index
+  %54 = memref.alloc() : memref<22xf32>
+  %alloc_4 = memref.alloc() : memref<22xf32>
+  scf.parallel (%arg0) = (%c0) to (%c22) step (%c1) {
+memref.store %cst, %alloc_4[%arg0] : memref<22xf32>
+  }
+  llvm.return
+}
+
+// -
+
 // Check that for statically known inner loop bound block size is aligned and
 // inner loop uses statically known loop trip counts.
 
diff --git a/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp 
b/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
index 842964b853d084d..963c52fd4191657 100644
--- a/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
+++ b/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
@@ -1143,6 +1143,8 @@ void OpEmitter::genAttrNameGetters() {
   const char *const getAttrName = R"(
   assert(index < {0} && "invalid attribute index");
   assert(name.getStringRef() == getOperationName() && "invalid operation 
name");
+  assert(!name.getAttributeNames().empty() && "empty attribute names. Is a new 
"
+ "op created without having initialized its dialect?");
   return name.getAttributeNames()[index];
 )";
   method->body() << formatv(getAttrName, attributes.size());

>From eb09cc895d7d1c08f745df22345cd0fae5432c7a Mon Sep 17 00:00:00 2001
From: Rik Huijzer 
Date: Mon, 20 Nov 2023 19:23:49 +0100
Subject: [PATCH 2/3] Declare dependentDialects in `Passes.td`

---
 mlir/include/mlir/Dialect/Async/Passes.td  | 1 +
 mlir/lib/Dialect/Async/Transforms/AsyncParallelFor.cpp | 4 
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/mlir/include/mlir/Dialect/Async/Passes.td 
b/mlir/include/mlir/Dialect/Async/Passes.td
index c7ee4ba39aecdf0..f0ef83ca3fd4f1a 100644
--- a/mlir/include/mlir/Dialect/Async/Passes.td
+++ b/mlir/include/mlir/Dialect/Async/Passes.td
@@ -36,6 +36,7 @@ def AsyncParallelFor : Pass<"async-parallel-for", "ModuleOp"> 
{
   let dependentDialects = [
 "arith::ArithDialect",
 "async::AsyncDialect",
+"func::FuncDialect",
 "scf::SCFDialect"
   ];
 }
diff --git a/mlir/lib/Dialect/Async/Transforms/AsyncParallelFor.cpp 
b/mlir/lib/Dialect/Async/Transforms/AsyncParallelFor.cpp
index 639bc7f9ec7f112..12a28c2e23b221a 100644
--- a/mlir/lib/Dialect/Async/Transforms/AsyncParallelFor.cpp
+++ b/mlir/lib/Dialect/Async/Transforms/AsyncParallelFor.cpp
@@ -102,10 +102,6 @@ struct AsyncParallelForPass
 : public impl::AsyncParallelForBase {
   AsyncParallelForPass() = default;
 
-  void getDependentDialects(DialectRegistry ®istry) const override {
-registry.insert();
-  }
-
   AsyncParallelForPass(bool asyncDispatch, int32_t numWorkerThreads,
int32_t minTaskSize) {
 this->asyncDispatch = asyncDispatch;

>From 77ba982eba8f7511543e9e06864a15c839feece8 Mon Sep 17 00:00:00 2001
From: Rik Huijzer 
Date: Mon, 20 Nov 2023 21:19:37 +0100
Subject: [PATCH 3/3] Update assertion

---
 mlir/test/Dialect/Async/async-parallel-for-compute-fn.mlir | 2 +-
 mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp| 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/mlir/test/Dialect/Async/async-parallel-for-comp

[Lldb-commits] [llvm] [lld] [lldb] [compiler-rt] [mlir] [clang] [flang] [libcxx] [mlir][async] Avoid crash when not using `func.func` (PR #72801)

2023-11-20 Thread Rik Huijzer via lldb-commits


@@ -1143,6 +1143,8 @@ void OpEmitter::genAttrNameGetters() {
   const char *const getAttrName = R"(
   assert(index < {0} && "invalid attribute index");
   assert(name.getStringRef() == getOperationName() && "invalid operation 
name");
+  assert(!name.getAttributeNames().empty() && "empty attribute names. Is a new 
"

rikhuijzer wrote:

Good tip. Thanks! I've implemented it and verified that it is triggered when 
reverting the fix from this PR (`func::FuncDialect` in `dependentDialects`).

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


[Lldb-commits] [lldb] Fix command escape bug in lldb-dap (PR #72902)

2023-11-20 Thread Greg Clayton via lldb-commits

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


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


[Lldb-commits] [clang] [lldb] Reland "[clang][DebugInfo] Emit global variable definitions for static data members with constant initializers" (PR #71780)

2023-11-20 Thread Michael Buch via lldb-commits

Michael137 wrote:

> I'm unclear on the specifics of the check, but it's probably something we can 
> adjust if that is the long-term solution.
> 
> CC @petrhosek Since he was interested in getting this resolved soon.

There's a few things left to iron out with 
https://github.com/llvm/llvm-project/pull/72730, which I hope to resolve by 
Friday. If this is blocking you urgently then we could add back the constant to 
the declaration until I land https://github.com/llvm/llvm-project/pull/72730 
(instead of reverting the entire patch).

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


[Lldb-commits] [llvm] [lldb] DEBUGINFOD based DWP acquisition for LLDB (PR #70996)

2023-11-20 Thread Greg Clayton via lldb-commits


@@ -0,0 +1,142 @@
+//===-- SymbolLocatorDebuginfod.cpp 
---===//
+//
+// 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
+//
+//===--===//
+
+#include "SymbolLocatorDebuginfod.h"
+
+#include "lldb/Core/PluginManager.h"
+#include "lldb/Utility/Args.h"
+
+#include "llvm/Debuginfod/Debuginfod.h"
+#include "llvm/Debuginfod/HTTPClient.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+LLDB_PLUGIN_DEFINE(SymbolLocatorDebuginfod)
+
+namespace {
+
+#define LLDB_PROPERTIES_symbollocatordebuginfod
+#include "SymbolLocatorDebuginfodProperties.inc"
+
+enum {
+#define LLDB_PROPERTIES_symbollocatordebuginfod
+#include "SymbolLocatorDebuginfodPropertiesEnum.inc"
+};
+
+class PluginProperties : public Properties {
+public:
+  static llvm::StringRef GetSettingName() {
+return SymbolLocatorDebuginfod::GetPluginNameStatic();
+  }
+
+  PluginProperties() {
+m_collection_sp = 
std::make_shared(GetSettingName());
+m_collection_sp->Initialize(g_symbollocatordebuginfod_properties);
+
+// We need to read the default value first to read the environment 
variable.
+llvm::SmallVector urls = llvm::getDefaultDebuginfodUrls();
+Args arg_urls{urls};
+m_collection_sp->SetPropertyAtIndexFromArgs(ePropertyServerURLs, arg_urls);
+
+m_collection_sp->SetValueChangedCallback(
+ePropertyServerURLs, [this] { ServerURLsChangedCallback(); });
+  }
+
+  Args GetDebugInfoDURLs() const {
+Args urls;
+m_collection_sp->GetPropertyAtIndexAsArgs(ePropertyServerURLs, urls);
+return urls;
+  }
+
+private:
+  void ServerURLsChangedCallback() {
+Args urls = GetDebugInfoDURLs();
+llvm::SmallVector dbginfod_urls;
+llvm::transform(urls, dbginfod_urls.end(),
+[](const auto &obj) { return obj.ref(); });
+llvm::setDefaultDebuginfodUrls(dbginfod_urls);
+  }
+};
+
+} // namespace
+
+static PluginProperties &GetGlobalPluginProperties() {
+  static PluginProperties g_settings;
+  return g_settings;
+}
+
+SymbolLocatorDebuginfod::SymbolLocatorDebuginfod() : SymbolLocator() {}
+
+void SymbolLocatorDebuginfod::Initialize() {
+  static llvm::once_flag g_once_flag;
+
+  llvm::call_once(g_once_flag, []() {
+PluginManager::RegisterPlugin(
+GetPluginNameStatic(), GetPluginDescriptionStatic(), CreateInstance,
+LocateExecutableObjectFile, LocateExecutableSymbolFile, nullptr,
+nullptr, SymbolLocatorDebuginfod::DebuggerInitialize);
+llvm::HTTPClient::initialize();
+  });
+}
+
+void SymbolLocatorDebuginfod::DebuggerInitialize(Debugger &debugger) {
+  if (!PluginManager::GetSettingForSymbolLocatorPlugin(
+  debugger, PluginProperties::GetSettingName())) {
+const bool is_global_setting = true;
+PluginManager::CreateSettingForSymbolLocatorPlugin(
+debugger, GetGlobalPluginProperties().GetValueProperties(),
+"Properties for the Debuginfod Symbol Locator plug-in.",
+is_global_setting);
+  }
+}
+
+void SymbolLocatorDebuginfod::Terminate() {
+  PluginManager::UnregisterPlugin(CreateInstance);
+  llvm::HTTPClient::cleanup();
+}
+
+llvm::StringRef SymbolLocatorDebuginfod::GetPluginDescriptionStatic() {
+  return "Debuginfod symbol locator.";
+}
+
+SymbolLocator *SymbolLocatorDebuginfod::CreateInstance() {
+  return new SymbolLocatorDebuginfod();
+}
+
+std::optional SymbolLocatorDebuginfod::LocateExecutableObjectFile(
+const ModuleSpec &module_spec) {
+  const UUID &module_uuid = module_spec.GetUUID();
+  if (module_uuid.IsValid() && llvm::canUseDebuginfod()) {
+llvm::object::BuildID build_id(module_uuid.GetBytes());
+llvm::Expected result =
+llvm::getCachedOrDownloadExecutable(build_id);
+if (result)
+  return FileSpec(*result);
+// An error here should be logged as a failure in the Debuginfod library,
+// so just consume it here
+consumeError(result.takeError());
+  }
+  return {};
+}
+
+std::optional SymbolLocatorDebuginfod::LocateExecutableSymbolFile(
+const ModuleSpec &module_spec, const FileSpecList &default_search_paths) {
+  const UUID &module_uuid = module_spec.GetUUID();
+  if (module_uuid.IsValid() && llvm::canUseDebuginfod()) {
+llvm::object::BuildID build_id(module_uuid.GetBytes());
+llvm::Expected result =
+llvm::getCachedOrDownloadDebuginfo(build_id);
+if (result)
+  return FileSpec(*result);
+// An error here should be logged as a failure in the Debuginfod library,
+// so just consume it here
+consumeError(result.takeError());
+  }

clayborg wrote:

This implementation is exactly the same as 
`SymbolLocatorDebuginfod::LocateExecutableObjectFile(...)` right? We should 
just call that directly from here if so?

https://github.com/llvm/llvm-projec

[Lldb-commits] [lldb] [compiler-rt] [llvm] [clang] [lld] [mlir] [flang] [libcxx] [mlir][async] Avoid crash when not using `func.func` (PR #72801)

2023-11-20 Thread Mehdi Amini via lldb-commits

https://github.com/joker-eph approved this pull request.


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


[Lldb-commits] [lldb] Fix command escape bug in lldb-dap (PR #72902)

2023-11-20 Thread via lldb-commits

jeffreytan81 wrote:

> LGTM. It may be a good idea to move these APIs over to use std::optional 
> instead of taking a default value so we can use 'value_or' instead of having 
> to write logic to handle the default value through a parameter.

My goal is fixing the regression in this diff. I will let @walter-erquinigo to 
comment/follow-up on this suggestion.

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


[Lldb-commits] [lldb] 85ee3fc - Fix command escape bug in lldb-dap (#72902)

2023-11-20 Thread via lldb-commits

Author: jeffreytan81
Date: 2023-11-20T15:57:14-08:00
New Revision: 85ee3fc7ec15f432430ee0c73fe81f3d6382d9df

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

LOG: Fix command escape bug in lldb-dap (#72902)

https://github.com/llvm/llvm-project/pull/69238 caused breakage in
VSCode debug console usage -- the user's input is always treated as
commands instead of expressions (the same behavior as if empty command
escape prefix is specified).

The bug is in one overload of `GetString()` which did not respect the
default value of "\`". But more important, I am puzzled to find out why
the regression is not caught by lldb test (testdap_evaluate). Turns out
https://github.com/llvm/llvm-project/pull/69238 specifies
commandEscapePrefix default value in test framework to be "\`" while
VSCode will default not specify any commandEscapePrefix at all. Changing
it to None will fail `testdap_evaluate`. We should align the default
behavior between DAP client and testcase.

This patches fixes the bug in `GetString()` and changed the default
value of commandEscapePrefix in testcases to be None (be consistent with
IDE).

Co-authored-by: jeffreytan81 

Added: 


Modified: 
lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py
lldb/tools/lldb-dap/JSONUtils.cpp

Removed: 




diff  --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py 
b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
index 518e3b9cf5bab33..bb863bb87191763 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
@@ -731,7 +731,7 @@ def request_launch(
 postRunCommands=None,
 enableAutoVariableSummaries=False,
 enableSyntheticChildDebugging=False,
-commandEscapePrefix="`",
+commandEscapePrefix=None,
 customFrameFormat=None,
 customThreadFormat=None,
 ):

diff  --git 
a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py 
b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py
index 0cf9d4fde49488f..4ccd6014e54be6a 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py
@@ -354,7 +354,7 @@ def launch(
 postRunCommands=None,
 enableAutoVariableSummaries=False,
 enableSyntheticChildDebugging=False,
-commandEscapePrefix="`",
+commandEscapePrefix=None,
 customFrameFormat=None,
 customThreadFormat=None,
 ):
@@ -434,7 +434,7 @@ def build_and_launch(
 lldbDAPEnv=None,
 enableAutoVariableSummaries=False,
 enableSyntheticChildDebugging=False,
-commandEscapePrefix="`",
+commandEscapePrefix=None,
 customFrameFormat=None,
 customThreadFormat=None,
 ):

diff  --git a/lldb/tools/lldb-dap/JSONUtils.cpp 
b/lldb/tools/lldb-dap/JSONUtils.cpp
index 50ade02801529c3..03a43f9da87f241 100644
--- a/lldb/tools/lldb-dap/JSONUtils.cpp
+++ b/lldb/tools/lldb-dap/JSONUtils.cpp
@@ -57,7 +57,7 @@ llvm::StringRef GetString(const llvm::json::Object *obj, 
llvm::StringRef key,
   llvm::StringRef defaultValue) {
   if (obj == nullptr)
 return defaultValue;
-  return GetString(*obj, key);
+  return GetString(*obj, key, defaultValue);
 }
 
 // Gets an unsigned integer from a JSON object using the key, or returns the



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


[Lldb-commits] [lldb] Fix command escape bug in lldb-dap (PR #72902)

2023-11-20 Thread via lldb-commits

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


[Lldb-commits] [lldb] [llvm] Add support for parsing type unit entries in .debug_names. (PR #72952)

2023-11-20 Thread Greg Clayton via lldb-commits

https://github.com/clayborg created 
https://github.com/llvm/llvm-project/pull/72952

This is a follow up patch after .debug_names can now emit local type unit 
entries when we compile with type units + DWARF5 + .debug_names. The pull 
request that added this functionality was:

https://github.com/llvm/llvm-project/pull/70515

This patch makes sure that the DebugNamesDWARFIndex in LLDB will not manually 
need to parse type units if they have a valid index. It also fixes the index to 
be able to correctly extract name entries that reference type unit DIEs. Added 
a test to verify things work as expected.

>From 749bf924a0a18493f2e1035b43b536100507bd31 Mon Sep 17 00:00:00 2001
From: Greg Clayton 
Date: Mon, 20 Nov 2023 20:33:22 -0800
Subject: [PATCH] Add support for parsing type unit entries in .debug_names.

This is a follow up patch after .debug_names can now emit local type unit 
entries when we compile with type units + DWARF5 + .debug_names. The pull 
request that added this functionality was:

https://github.com/llvm/llvm-project/pull/70515

This patch makes sure that the DebugNamesDWARFIndex in LLDB will not manually 
need to parse type units if they have a valid index. It also fixes the index to 
be able to correctly extract name entries that reference type unit DIEs. Added 
a test to verify things work as expected.
---
 .../SymbolFile/DWARF/DebugNamesDWARFIndex.cpp | 18 +--
 .../DWARF/x86/debug-types-debug-names.cpp | 48 +++
 .../DebugInfo/DWARF/DWARFAcceleratorTable.h   | 19 +++-
 .../DebugInfo/DWARF/DWARFAcceleratorTable.cpp | 18 ++-
 4 files changed, 97 insertions(+), 6 deletions(-)
 create mode 100644 
lldb/test/Shell/SymbolFile/DWARF/x86/debug-types-debug-names.cpp

diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp 
b/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
index 4fc3866a3b608fd..62c5417191a124d 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
@@ -37,19 +37,29 @@ llvm::DenseSet
 DebugNamesDWARFIndex::GetUnits(const DebugNames &debug_names) {
   llvm::DenseSet result;
   for (const DebugNames::NameIndex &ni : debug_names) {
-for (uint32_t cu = 0; cu < ni.getCUCount(); ++cu)
+const uint32_t num_cus = ni.getCUCount();
+for (uint32_t cu = 0; cu < num_cus; ++cu)
   result.insert(ni.getCUOffset(cu));
+const uint32_t num_tus = ni.getLocalTUCount();
+for (uint32_t tu = 0; tu < num_tus; ++tu)
+  result.insert(ni.getLocalTUOffset(tu));
   }
   return result;
 }
 
 std::optional
 DebugNamesDWARFIndex::ToDIERef(const DebugNames::Entry &entry) {
+  // Look for a CU offset or a local TU offset as they are both offsets into
+  // the .debug_info section.
   std::optional cu_offset = entry.getCUOffset();
-  if (!cu_offset)
-return std::nullopt;
+  if (!cu_offset) {
+cu_offset = entry.getLocalTUOffset();
+if (!cu_offset)
+  return std::nullopt;
+  }
 
-  DWARFUnit *cu = m_debug_info.GetUnitAtOffset(DIERef::Section::DebugInfo, 
*cu_offset);
+  DWARFUnit *cu =
+  m_debug_info.GetUnitAtOffset(DIERef::Section::DebugInfo, *cu_offset);
   if (!cu)
 return std::nullopt;
 
diff --git a/lldb/test/Shell/SymbolFile/DWARF/x86/debug-types-debug-names.cpp 
b/lldb/test/Shell/SymbolFile/DWARF/x86/debug-types-debug-names.cpp
new file mode 100644
index 000..2b7a928c89a8f71
--- /dev/null
+++ b/lldb/test/Shell/SymbolFile/DWARF/x86/debug-types-debug-names.cpp
@@ -0,0 +1,48 @@
+// Test that we can use .debug_names to lookup a type that is only referenced
+// from within a type unit. In the code below the type named "stype" is only
+// referenced within the type unit itself and when we enable .debug_names, we
+// expect the have an entry for this and to be able to find this type when
+// we do a lookup.
+
+// REQUIRES: lld
+
+// RUN: %clang %s -target x86_64-pc-linux -gdwarf-5 -fdebug-types-section \
+// RUN:   -gpubnames -fno-limit-debug-info -c -o %t.o
+// RUN: ld.lld %t.o -o %t
+// RUN: %lldb %t -o "type lookup stype" -b | FileCheck %s --check-prefix=BASE
+// RUN: %lldb %t -o "type lookup bar::stype" -b | FileCheck %s 
--check-prefix=PART
+// RUN: %lldb %t -o "type lookup foo::bar::stype" -b | FileCheck %s 
--check-prefix=FULL
+
+// BASE: (lldb) type lookup stype
+// BASE-NEXT: int
+
+// PART: (lldb) type lookup bar::stype
+// PART-NEXT: int
+
+// FULL: (lldb) type lookup foo::bar::stype
+// FULL-NEXT: int
+
+namespace foo {
+class bar {
+public:
+  typedef unsigned utype;
+  // This type is only referenced from within the type unit and we need to
+  // make sure we can find it with the new type unit support in .debug_names.
+  typedef int stype;
+
+private:
+  utype m_unsigned;
+
+public:
+  bar(utype u) : m_unsigned(u) {}
+
+  utype get() const { return m_unsigned; }
+  void set(utype u) { m_unsigned = u; }
+  stype gets() const { return (stype)m_unsigned; }
+};
+} // namespace foo
+
+int main()

[Lldb-commits] [lldb] [llvm] Add support for parsing type unit entries in .debug_names. (PR #72952)

2023-11-20 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: Greg Clayton (clayborg)


Changes

This is a follow up patch after .debug_names can now emit local type unit 
entries when we compile with type units + DWARF5 + .debug_names. The pull 
request that added this functionality was:

https://github.com/llvm/llvm-project/pull/70515

This patch makes sure that the DebugNamesDWARFIndex in LLDB will not manually 
need to parse type units if they have a valid index. It also fixes the index to 
be able to correctly extract name entries that reference type unit DIEs. Added 
a test to verify things work as expected.

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


4 Files Affected:

- (modified) lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp 
(+14-4) 
- (added) lldb/test/Shell/SymbolFile/DWARF/x86/debug-types-debug-names.cpp 
(+48) 
- (modified) llvm/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h (+18-1) 
- (modified) llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp (+17-1) 


``diff
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp 
b/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
index 4fc3866a3b608fd..62c5417191a124d 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
@@ -37,19 +37,29 @@ llvm::DenseSet
 DebugNamesDWARFIndex::GetUnits(const DebugNames &debug_names) {
   llvm::DenseSet result;
   for (const DebugNames::NameIndex &ni : debug_names) {
-for (uint32_t cu = 0; cu < ni.getCUCount(); ++cu)
+const uint32_t num_cus = ni.getCUCount();
+for (uint32_t cu = 0; cu < num_cus; ++cu)
   result.insert(ni.getCUOffset(cu));
+const uint32_t num_tus = ni.getLocalTUCount();
+for (uint32_t tu = 0; tu < num_tus; ++tu)
+  result.insert(ni.getLocalTUOffset(tu));
   }
   return result;
 }
 
 std::optional
 DebugNamesDWARFIndex::ToDIERef(const DebugNames::Entry &entry) {
+  // Look for a CU offset or a local TU offset as they are both offsets into
+  // the .debug_info section.
   std::optional cu_offset = entry.getCUOffset();
-  if (!cu_offset)
-return std::nullopt;
+  if (!cu_offset) {
+cu_offset = entry.getLocalTUOffset();
+if (!cu_offset)
+  return std::nullopt;
+  }
 
-  DWARFUnit *cu = m_debug_info.GetUnitAtOffset(DIERef::Section::DebugInfo, 
*cu_offset);
+  DWARFUnit *cu =
+  m_debug_info.GetUnitAtOffset(DIERef::Section::DebugInfo, *cu_offset);
   if (!cu)
 return std::nullopt;
 
diff --git a/lldb/test/Shell/SymbolFile/DWARF/x86/debug-types-debug-names.cpp 
b/lldb/test/Shell/SymbolFile/DWARF/x86/debug-types-debug-names.cpp
new file mode 100644
index 000..2b7a928c89a8f71
--- /dev/null
+++ b/lldb/test/Shell/SymbolFile/DWARF/x86/debug-types-debug-names.cpp
@@ -0,0 +1,48 @@
+// Test that we can use .debug_names to lookup a type that is only referenced
+// from within a type unit. In the code below the type named "stype" is only
+// referenced within the type unit itself and when we enable .debug_names, we
+// expect the have an entry for this and to be able to find this type when
+// we do a lookup.
+
+// REQUIRES: lld
+
+// RUN: %clang %s -target x86_64-pc-linux -gdwarf-5 -fdebug-types-section \
+// RUN:   -gpubnames -fno-limit-debug-info -c -o %t.o
+// RUN: ld.lld %t.o -o %t
+// RUN: %lldb %t -o "type lookup stype" -b | FileCheck %s --check-prefix=BASE
+// RUN: %lldb %t -o "type lookup bar::stype" -b | FileCheck %s 
--check-prefix=PART
+// RUN: %lldb %t -o "type lookup foo::bar::stype" -b | FileCheck %s 
--check-prefix=FULL
+
+// BASE: (lldb) type lookup stype
+// BASE-NEXT: int
+
+// PART: (lldb) type lookup bar::stype
+// PART-NEXT: int
+
+// FULL: (lldb) type lookup foo::bar::stype
+// FULL-NEXT: int
+
+namespace foo {
+class bar {
+public:
+  typedef unsigned utype;
+  // This type is only referenced from within the type unit and we need to
+  // make sure we can find it with the new type unit support in .debug_names.
+  typedef int stype;
+
+private:
+  utype m_unsigned;
+
+public:
+  bar(utype u) : m_unsigned(u) {}
+
+  utype get() const { return m_unsigned; }
+  void set(utype u) { m_unsigned = u; }
+  stype gets() const { return (stype)m_unsigned; }
+};
+} // namespace foo
+
+int main() {
+  foo::bar b(12);
+  return 0;
+}
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h 
b/llvm/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h
index 1ba555a061904cc..b89536bc0c7230c 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h
@@ -56,6 +56,14 @@ class DWARFAcceleratorTable {
 /// recorded in this Accelerator Entry.
 virtual std::optional getCUOffset() const = 0;
 
+/// Returns the Offset of the Type Unit associated with this
+/// Accelerator Entry or std::nullopt if the Type Unit offset is not
+/// recorded in this Accelerator Entry.
+virtual std::op

[Lldb-commits] [flang] [clang] [libcxx] [lld] [lldb] [compiler-rt] [mlir] [llvm] [mlir][async] Avoid crash when not using `func.func` (PR #72801)

2023-11-20 Thread Mehdi Amini via lldb-commits

joker-eph wrote:

FYI the build is failing (maybe re-running would be enough though)

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


[Lldb-commits] [llvm] [clang-tools-extra] [openmp] [libc] [compiler-rt] [clang] [lld] [flang] [libcxx] [mlir] [lldb] [mlir][async] Avoid crash when not using `func.func` (PR #72801)

2023-11-20 Thread Rik Huijzer via lldb-commits

https://github.com/rikhuijzer updated 
https://github.com/llvm/llvm-project/pull/72801

>From 8abbf36f741c8363155e0f3cbf2450ff7f1f0801 Mon Sep 17 00:00:00 2001
From: Rik Huijzer 
Date: Sun, 19 Nov 2023 18:31:38 +0100
Subject: [PATCH 1/3] [mlir][async] Avoid crash when not using `func.func`

---
 .../Async/Transforms/AsyncParallelFor.cpp |  4 
 .../Async/async-parallel-for-compute-fn.mlir  | 19 +++
 mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp   |  2 ++
 3 files changed, 25 insertions(+)

diff --git a/mlir/lib/Dialect/Async/Transforms/AsyncParallelFor.cpp 
b/mlir/lib/Dialect/Async/Transforms/AsyncParallelFor.cpp
index 12a28c2e23b221a..639bc7f9ec7f112 100644
--- a/mlir/lib/Dialect/Async/Transforms/AsyncParallelFor.cpp
+++ b/mlir/lib/Dialect/Async/Transforms/AsyncParallelFor.cpp
@@ -102,6 +102,10 @@ struct AsyncParallelForPass
 : public impl::AsyncParallelForBase {
   AsyncParallelForPass() = default;
 
+  void getDependentDialects(DialectRegistry ®istry) const override {
+registry.insert();
+  }
+
   AsyncParallelForPass(bool asyncDispatch, int32_t numWorkerThreads,
int32_t minTaskSize) {
 this->asyncDispatch = asyncDispatch;
diff --git a/mlir/test/Dialect/Async/async-parallel-for-compute-fn.mlir 
b/mlir/test/Dialect/Async/async-parallel-for-compute-fn.mlir
index 2115b1881fa6d66..fa3b53dd839c6c6 100644
--- a/mlir/test/Dialect/Async/async-parallel-for-compute-fn.mlir
+++ b/mlir/test/Dialect/Async/async-parallel-for-compute-fn.mlir
@@ -69,6 +69,25 @@ func.func @sink_constant_step(%arg0: memref, %lb: 
index, %ub: index) {
 
 // -
 
+// Smoke test that parallel for doesn't crash when func dialect is not loaded.
+
+// CHECK-LABEL: llvm.func @without_func_dialect()
+llvm.func @without_func_dialect() {
+  %cst = arith.constant 0.0 : f32
+
+  %c0 = arith.constant 0 : index
+  %c22 = arith.constant 22 : index
+  %c1 = arith.constant 1 : index
+  %54 = memref.alloc() : memref<22xf32>
+  %alloc_4 = memref.alloc() : memref<22xf32>
+  scf.parallel (%arg0) = (%c0) to (%c22) step (%c1) {
+memref.store %cst, %alloc_4[%arg0] : memref<22xf32>
+  }
+  llvm.return
+}
+
+// -
+
 // Check that for statically known inner loop bound block size is aligned and
 // inner loop uses statically known loop trip counts.
 
diff --git a/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp 
b/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
index 842964b853d084d..963c52fd4191657 100644
--- a/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
+++ b/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
@@ -1143,6 +1143,8 @@ void OpEmitter::genAttrNameGetters() {
   const char *const getAttrName = R"(
   assert(index < {0} && "invalid attribute index");
   assert(name.getStringRef() == getOperationName() && "invalid operation 
name");
+  assert(!name.getAttributeNames().empty() && "empty attribute names. Is a new 
"
+ "op created without having initialized its dialect?");
   return name.getAttributeNames()[index];
 )";
   method->body() << formatv(getAttrName, attributes.size());

>From eb09cc895d7d1c08f745df22345cd0fae5432c7a Mon Sep 17 00:00:00 2001
From: Rik Huijzer 
Date: Mon, 20 Nov 2023 19:23:49 +0100
Subject: [PATCH 2/3] Declare dependentDialects in `Passes.td`

---
 mlir/include/mlir/Dialect/Async/Passes.td  | 1 +
 mlir/lib/Dialect/Async/Transforms/AsyncParallelFor.cpp | 4 
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/mlir/include/mlir/Dialect/Async/Passes.td 
b/mlir/include/mlir/Dialect/Async/Passes.td
index c7ee4ba39aecdf0..f0ef83ca3fd4f1a 100644
--- a/mlir/include/mlir/Dialect/Async/Passes.td
+++ b/mlir/include/mlir/Dialect/Async/Passes.td
@@ -36,6 +36,7 @@ def AsyncParallelFor : Pass<"async-parallel-for", "ModuleOp"> 
{
   let dependentDialects = [
 "arith::ArithDialect",
 "async::AsyncDialect",
+"func::FuncDialect",
 "scf::SCFDialect"
   ];
 }
diff --git a/mlir/lib/Dialect/Async/Transforms/AsyncParallelFor.cpp 
b/mlir/lib/Dialect/Async/Transforms/AsyncParallelFor.cpp
index 639bc7f9ec7f112..12a28c2e23b221a 100644
--- a/mlir/lib/Dialect/Async/Transforms/AsyncParallelFor.cpp
+++ b/mlir/lib/Dialect/Async/Transforms/AsyncParallelFor.cpp
@@ -102,10 +102,6 @@ struct AsyncParallelForPass
 : public impl::AsyncParallelForBase {
   AsyncParallelForPass() = default;
 
-  void getDependentDialects(DialectRegistry ®istry) const override {
-registry.insert();
-  }
-
   AsyncParallelForPass(bool asyncDispatch, int32_t numWorkerThreads,
int32_t minTaskSize) {
 this->asyncDispatch = asyncDispatch;

>From 77ba982eba8f7511543e9e06864a15c839feece8 Mon Sep 17 00:00:00 2001
From: Rik Huijzer 
Date: Mon, 20 Nov 2023 21:19:37 +0100
Subject: [PATCH 3/3] Update assertion

---
 mlir/test/Dialect/Async/async-parallel-for-compute-fn.mlir | 2 +-
 mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp| 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/mlir/test/Dialect/Async/async-parallel-for-comp

[Lldb-commits] [mlir] [libc] [llvm] [openmp] [lldb] [libcxx] [clang] [lld] [flang] [clang-tools-extra] [compiler-rt] [mlir][async] Avoid crash when not using `func.func` (PR #72801)

2023-11-20 Thread Rik Huijzer via lldb-commits

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