[mlir] [libunwind] [clang-tools-extra] [lld] [lldb] [compiler-rt] [libcxxabi] [clang] [llvm] [libc] [flang] [libcxx] 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/3] 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/3] 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 , 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 , GraphT &, 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/3] 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. ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[mlir] [libunwind] [clang-tools-extra] [lld] [lldb] [compiler-rt] [libcxxabi] [clang] [llvm] [libc] [flang] [libcxx] PR#72453 : Exceeding maximum file name length (PR #72654)
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 44af5924b1cbbb395e7e71250a5445053c4ec4a3 7662d4f177d32c3159c1c48b11ce3884e4ea78c8 -- llvm/include/llvm/Analysis/DOTGraphTraitsPass.h `` View the diff from clang-format here. ``diff diff --git a/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h b/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h index f78d8ff52e..f7ab6df3b4 100644 --- a/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h +++ b/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h @@ -96,7 +96,7 @@ void printGraphForFunction(Function , 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 @@ public: 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 , GraphT &, std::string GraphName = DOTGraphTraits::getGraphName(Graph); std::string Title = GraphName + " for '" + F.getName().str() + "' function"; - 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!"; `` https://github.com/llvm/llvm-project/pull/72654 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[mlir] [libunwind] [clang-tools-extra] [lld] [lldb] [compiler-rt] [libcxxabi] [clang] [llvm] [libc] [flang] [libcxx] PR#72453 : Exceeding maximum file name length (PR #72654)
llvmbot wrote: @llvm/pr-subscribers-llvm-analysis Author: Shahid Iqbal (shahidiqbal13) Changes This issue is raised by @DrTodd13 The code in include/llvm/Analysis/DOTGraphTraitsPass.h will exceed most normal file system's maximum filename length of 255 if, e.g., the function's name is that length. --- Full diff: https://github.com/llvm/llvm-project/pull/72654.diff 2 Files Affected: - (modified) clang/NOTES.txt (+2) - (modified) llvm/include/llvm/Analysis/DOTGraphTraitsPass.h (+5-3) ``diff 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. 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 , 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 , GraphT &, 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!"; `` https://github.com/llvm/llvm-project/pull/72654 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[mlir] [libunwind] [clang-tools-extra] [lld] [lldb] [compiler-rt] [libcxxabi] [clang] [llvm] [libc] [flang] [libcxx] PR#72453 : Exceeding maximum file name length (PR #72654)
https://github.com/shahidiqbal13 created https://github.com/llvm/llvm-project/pull/72654 This issue is raised by @DrTodd13 The code in include/llvm/Analysis/DOTGraphTraitsPass.h will exceed most normal file system's maximum filename length of 255 if, e.g., the function's name is that length. >From b6bfb18e25c111baf6c95a0a4a1c3d667bb25b6d Mon Sep 17 00:00:00 2001 From: Shahid Iqbal Date: Thu, 16 Nov 2023 11:26:43 -0500 Subject: [PATCH 1/2] 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/2] 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 , 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 , GraphT &, 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!"; ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits