[Lldb-commits] [flang] [clang-tools-extra] [lldb] [clang] [llvm] [mlir] [compiler-rt] [CodeGen][DebugInfo] Add missing debug info for jump table BB (PR #71021)
HaohaiWen wrote: Thanks! https://github.com/llvm/llvm-project/pull/71021 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [flang] [clang] [llvm] [compiler-rt] [clang-tools-extra] [mlir] [CodeGen][DebugInfo] Add missing debug info for jump table BB (PR #71021)
https://github.com/HaohaiWen closed https://github.com/llvm/llvm-project/pull/71021 ___ 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] [lldb] [compiler-rt] [mlir] [flang] [libunwind] [libcxxabi] [clang] [llvm] [libcxx] [lld] PR#72453 : Exceeding maximum file name length (PR #72654)
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/5] 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/5] 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/5] 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/5] 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] [lld] [llvm] [clang-tools-extra] [lldb] [compiler-rt] [libunwind] [libc] [mlir] [clang] [libcxxabi] [libcxx] [flang] PR#72453 : Exceeding maximum file name length (PR #72654)
https://github.com/DrTodd13 edited 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] [llvm] [libc] [libunwind] [clang-tools-extra] [flang] [libcxxabi] [lldb] [mlir] [libcxx] [compiler-rt] [lld] [clang] PR#72453 : Exceeding maximum file name length (PR #72654)
https://github.com/DrTodd13 requested changes to this pull request. I like the idea of that new function but I don't think it does what you intended. 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] [mlir] [lldb] [libc] [libcxxabi] [flang] [compiler-rt] [lld] [clang-tools-extra] [libcxx] [clang] [llvm] [libunwind] PR#72453 : Exceeding maximum file name length (PR #72654)
@@ -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: Let's say that I have 3 filenames submitted in a row that share the same first 250 characters. Line 92 will add the first one truncated to 250. Then, line 97 will add the second one truncated to 249. But then, for the third one, the first time through the nameObj list, it is going to match with the first name you added, decrement len by 1 and then add to nameObj. So, I think the 2nd and 3rd names in your list are going to be duplicates. Maybe a more classic way of doing this would be to use a set instead of a list, check if the FN truncated to 250 is in the set and if not add it. If it is then truncate to 249 and repeat the process of checking if it is in the set. Add if it isn't and if it is then truncate to 248 and keep repeating the process until it can be added. Of course, this approach has the problem that if you have more than 250 names that shared the first 250 characters then len would go to 0 and you'd try to have a filename that was empty. Then the 251st time you tried it you'd have a negative substr len. If that is equivalent to 0 len then you could end up in an infinite loop. 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] [libunwind] [compiler-rt] [libcxx] [mlir] [lldb] [lld] [flang] [clang-tools-extra] [libc] [libcxxabi] [llvm] [clang] PR#72453 : Exceeding maximum file name length (PR #72654)
@@ -17,6 +17,8 @@ #include "llvm/Support/FileSystem.h" #include "llvm/Support/GraphWriter.h" +static std::vector nameObj; DrTodd13 wrote: I don't know if there is some LLVM code approach that would dictate what to do here. We can have some kind of a data structure to remember names to try to avoid duplicates or we can accept that there may be duplicates but just make them probabilistically rare. I guess I am leaning toward the latter where you do something like take up to a certain number of characters of the filename as they are but then you take the rest of the characters of the filename and hash them and add the hash to the filename. This latter approach works even if you are going in and out of llvm whereas having a data structure to remember names would only work in the context of single execution of LLVM. Again, that is just my opinion and I'm not sure what people with approval authority here will say. 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