Lines Matching +full:string +full:- +full:support

1 //===- GraphWriter.cpp - Implements GraphWriter support routines ----------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file implements misc. GraphWriter support routines.
11 //===----------------------------------------------------------------------===//
13 #include "llvm/Support/GraphWriter.h"
21 #include "llvm/Support/Compiler.h"
22 #include "llvm/Support/ErrorHandling.h"
23 #include "llvm/Support/ErrorOr.h"
24 #include "llvm/Support/FileSystem.h"
25 #include "llvm/Support/Path.h"
26 #include "llvm/Support/Program.h"
27 #include "llvm/Support/raw_ostream.h"
30 #include "llvm/Support/CommandLine.h"
31 #include "llvm/Support/ManagedStatic.h"
34 #include <string>
44 return new cl::opt<bool>("view-background", cl::Hidden, in call()
56 std::string llvm::DOT::EscapeString(const std::string &Label) { in EscapeString()
57 std::string Str(Label); in EscapeString()
89 /// Get a color string for this node number. Simply round-robin selects
100 static std::string replaceIllegalFilenameChars(std::string Filename, in replaceIllegalFilenameChars()
102 std::string IllegalChars = in replaceIllegalFilenameChars()
113 std::string llvm::createGraphFilename(const Twine &Name, int &FD) { in createGraphFilename()
114 FD = -1; in createGraphFilename()
118 std::string N = Name.str(); in createGraphFilename()
123 std::string CleansedName = replaceIllegalFilenameChars(N, '_'); in createGraphFilename()
133 return std::string(Filename); in createGraphFilename()
139 std::string &ErrMsg) { in ExecGraphViewer()
157 std::string LogBuffer;
159 bool TryFindProgram(StringRef Names, std::string &ProgramPath) { in TryFindProgram()
164 if (ErrorOr<std::string> P = sys::findProgramByName(Name)) { in TryFindProgram()
194 std::string Filename = std::string(FilenameRef); in DisplayGraph()
195 std::string ErrMsg; in DisplayGraph()
196 std::string ViewerPath; in DisplayGraph()
205 args.push_back("-W"); in DisplayGraph()
212 if (S.TryFindProgram("xdg-open", ViewerPath)) { in DisplayGraph()
216 errs() << "Trying 'xdg-open' program... "; in DisplayGraph()
237 args.push_back("-f"); in DisplayGraph()
258 if (!Viewer && S.TryFindProgram("xdg-open", ViewerPath)) in DisplayGraph()
267 std::string GeneratorPath; in DisplayGraph()
271 std::string OutputFilename = in DisplayGraph()
277 args.push_back("-Tpdf"); in DisplayGraph()
279 args.push_back("-Tps"); in DisplayGraph()
280 args.push_back("-Nfontname=Courier"); in DisplayGraph()
281 args.push_back("-Gsize=7.5,10"); in DisplayGraph()
283 args.push_back("-o"); in DisplayGraph()
293 std::string StartArg; in DisplayGraph()
299 args.push_back("-W"); in DisplayGraph()
307 args.push_back("--spartan"); in DisplayGraph()