@@ -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 !=
@@ -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 st
@@ -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 !=
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
___
cfe-commits mailing list
cfe-commits@lists.llvm.o
https://github.com/DrTodd13 edited
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
@@ -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_FILENAM
@@ -94,7 +96,7 @@ void printGraphForFunction(Function &F, GraphT Graph,
StringRef Name,
raw_fd_ostream File(Filename, EC, sys::fs::OF_TextWithCRLF);
DrTodd13 wrote:
I needed to work around this bug when I found it so in my local version I did a
(Name.str() +
@@ -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_L
@@ -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_
https://github.com/DrTodd13 edited
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
@@ -94,7 +96,7 @@ void printGraphForFunction(Function &F, GraphT Graph,
StringRef Name,
raw_fd_ostream File(Filename, EC, sys::fs::OF_TextWithCRLF);
DrTodd13 wrote:
If Filename is too long, then EC here will already contain an error code.
https://github.com/
https://github.com/DrTodd13 requested changes to this pull request.
I don't think these changes as they are solve the problem.
https://github.com/llvm/llvm-project/pull/72654
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.or
12 matches
Mail list logo