Index: include/llvm/Support/GraphWriter.h =================================================================== --- include/llvm/Support/GraphWriter.h +++ include/llvm/Support/GraphWriter.h @@ -325,7 +325,9 @@ std::string WriteGraph(const GraphType &G, const Twine &Name, bool ShortNames = false, const Twine &Title = "") { int FD; - std::string Filename = createGraphFilename(Name, FD); + std::string N = Name.str(); + N = N.substr(0, std::min(N.size(), 140)); + std::string Filename = createGraphFilename(N, FD); raw_fd_ostream O(FD, /*shouldClose=*/ true); if (FD == -1) {