Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Support/GraphWriter.cpp
Show All 17 Lines | |||||
#include "llvm/ADT/SmallVector.h" | #include "llvm/ADT/SmallVector.h" | ||||
#include "llvm/ADT/StringRef.h" | #include "llvm/ADT/StringRef.h" | ||||
#include "llvm/Config/config.h" | #include "llvm/Config/config.h" | ||||
#include "llvm/Support/CommandLine.h" | #include "llvm/Support/CommandLine.h" | ||||
#include "llvm/Support/Compiler.h" | #include "llvm/Support/Compiler.h" | ||||
#include "llvm/Support/ErrorHandling.h" | #include "llvm/Support/ErrorHandling.h" | ||||
#include "llvm/Support/ErrorOr.h" | #include "llvm/Support/ErrorOr.h" | ||||
#include "llvm/Support/FileSystem.h" | #include "llvm/Support/FileSystem.h" | ||||
#include "llvm/Support/Path.h" | |||||
#include "llvm/Support/Program.h" | #include "llvm/Support/Program.h" | ||||
#include "llvm/Support/raw_ostream.h" | #include "llvm/Support/raw_ostream.h" | ||||
#include <cassert> | #include <cassert> | ||||
#include <system_error> | |||||
#include <string> | #include <string> | ||||
#include <system_error> | |||||
#include <vector> | #include <vector> | ||||
using namespace llvm; | using namespace llvm; | ||||
#ifdef __APPLE__ | #ifdef __APPLE__ | ||||
namespace { | namespace { | ||||
struct CreateViewBackground { | struct CreateViewBackground { | ||||
static void *call() { | static void *call() { | ||||
▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | static const char* Colors[NumColors] = { | ||||
"aaaaaa", "aa0000", "00aa00", "aa5500", "0055ff", "aa00aa", "00aaaa", | "aaaaaa", "aa0000", "00aa00", "aa5500", "0055ff", "aa00aa", "00aaaa", | ||||
"555555", "ff5555", "55ff55", "ffff55", "5555ff", "ff55ff", "55ffff", | "555555", "ff5555", "55ff55", "ffff55", "5555ff", "ff55ff", "55ffff", | ||||
"ffaaaa", "aaffaa", "ffffaa", "aaaaff", "ffaaff", "aaffff"}; | "ffaaaa", "aaffaa", "ffffaa", "aaaaff", "ffaaff", "aaffff"}; | ||||
return Colors[ColorNumber % NumColors]; | return Colors[ColorNumber % NumColors]; | ||||
} | } | ||||
static std::string replaceIllegalFilenameChars(std::string Filename, | static std::string replaceIllegalFilenameChars(std::string Filename, | ||||
const char ReplacementChar) { | const char ReplacementChar) { | ||||
#ifdef _WIN32 | std::string IllegalChars = | ||||
std::string IllegalChars = "\\/:?\"<>|"; | is_style_windows(sys::path::Style::native) ? "\\/:?\"<>|" : "/"; | ||||
#else | |||||
std::string IllegalChars = "/"; | |||||
#endif | |||||
for (char IllegalChar : IllegalChars) { | for (char IllegalChar : IllegalChars) { | ||||
std::replace(Filename.begin(), Filename.end(), IllegalChar, | std::replace(Filename.begin(), Filename.end(), IllegalChar, | ||||
ReplacementChar); | ReplacementChar); | ||||
} | } | ||||
return Filename; | return Filename; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 230 Lines • Show Last 20 Lines |