15 #include "llvm/Config/config.h"
30 const std::string& FileName)
38 const char EnvPathSeparatorStr[] = {EnvPathSeparator,
'\0'};
42 for (
const auto &Dir : Dirs) {
49 FoundPath = FilePath.
str();
58 #define COLOR(FGBG, CODE, BOLD) "\033[0;" BOLD FGBG CODE "m"
60 #define ALLCOLORS(FGBG,BOLD) {\
61 COLOR(FGBG, "0", BOLD),\
62 COLOR(FGBG, "1", BOLD),\
63 COLOR(FGBG, "2", BOLD),\
64 COLOR(FGBG, "3", BOLD),\
65 COLOR(FGBG, "4", BOLD),\
66 COLOR(FGBG, "5", BOLD),\
67 COLOR(FGBG, "6", BOLD),\
68 COLOR(FGBG, "7", BOLD)\
static Optional< std::string > FindInEnvPath(const std::string &EnvName, const std::string &FileName)
This function searches for an existing file in the list of directories in a PATH like environment var...
void append(SmallVectorImpl< char > &path, const Twine &a, const Twine &b="", const Twine &c="", const Twine &d="")
Append to path.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
bool is_absolute(const Twine &path)
Is path absolute?
static const char colorcodes[2][2][8][10]
const T & getValue() const LLVM_LVALUE_FUNCTION
void SplitString(StringRef Source, SmallVectorImpl< StringRef > &OutFragments, StringRef Delimiters=" \t\n\v\f\r")
SplitString - Split up the specified string according to the specified delimiters, appending the result fragments to the output list.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
StringRef str() const
Explicit conversion to StringRef.
Provides a library for accessing information about this process and other processes on the operating ...
#define ALLCOLORS(FGBG, BOLD)
bool exists(file_status status)
Does file exist?
static Optional< std::string > GetEnv(StringRef name)