#include "llvm/Support/GraphWriter.h"
#include "DebugOptions.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Config/config.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/ErrorOr.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Program.h"
#include "llvm/Support/raw_ostream.h"
#ifdef __APPLE__
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ManagedStatic.h"
#endif
#include <string>
#include <system_error>
#include <vector>
usingnamespacellvm;
#ifdef __APPLE__
namespace {
struct CreateViewBackground {
static void *call() {
return new cl::opt<bool>("view-background", cl::Hidden,
cl::desc("Execute graph viewer in the background. "
"Creates tmp file litter."));
}
};
}
static ManagedStatic<cl::opt<bool>, CreateViewBackground> ViewBackground;
void llvm::initGraphWriterOptions() { *ViewBackground; }
#else
void llvm::initGraphWriterOptions() { … }
#endif
std::string llvm::DOT::EscapeString(const std::string &Label) { … }
StringRef llvm::DOT::getColorString(unsigned ColorNumber) { … }
static std::string replaceIllegalFilenameChars(std::string Filename,
const char ReplacementChar) { … }
std::string llvm::createGraphFilename(const Twine &Name, int &FD) { … }
static bool ExecGraphViewer(StringRef ExecPath, std::vector<StringRef> &args,
StringRef Filename, bool wait,
std::string &ErrMsg) { … }
namespace {
struct GraphSession { … };
}
static const char *getProgramName(GraphProgram::Name program) { … }
bool llvm::DisplayGraph(StringRef FilenameRef, bool wait,
GraphProgram::Name program) { … }