29 #include <system_error> 50 errs() << ProgName <<
": " << Msg;
61 return reportError(argv0,
"the option -d must be used together with -o\n");
70 DepOut.
os() <<
' ' << Dep.first;
83 if (std::error_code EC = FileOrErr.
getError())
85 "': " + EC.message() +
"\n");
103 EC.message() +
"\n");
109 if (MainFn(Out.
os(), Records))
Represents either an error or a value T.
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
Compute iterated dominance frontiers using a linear time algorithm.
static cl::list< std::string > IncludeDirs("I", cl::desc("Directory of include files"), cl::value_desc("directory"), cl::Prefix)
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
static cl::opt< std::string > OutputFilename("o", cl::desc("Output filename"), cl::value_desc("filename"), cl::init("-"))
unsigned AddNewSourceBuffer(std::unique_ptr< MemoryBuffer > F, SMLoc IncludeLoc)
Add a new source buffer to this source manager.
static cl::opt< std::string > DependFilename("d", cl::desc("Dependency filename"), cl::value_desc("filename"), cl::init(""))
initializer< Ty > init(const Ty &Val)
std::error_code getError() const
int TableGenMain(char *argv0, TableGenMainFn *MainFn)
const TGLexer::DependenciesMapTy & getDependencies() const
The file should be opened in text mode on platforms that make this distinction.
static int reportError(const char *ProgName, Twine Msg)
static ErrorOr< std::unique_ptr< MemoryBuffer > > getFileOrSTDIN(const Twine &Filename, int64_t FileSize=-1, bool RequiresNullTerminator=true)
Open the specified file as a MemoryBuffer, or open stdin if the Filename is "-".
bool(raw_ostream &OS, RecordKeeper &Records) TableGenMainFn
Perform the action using Records, and write output to OS.
bool ParseFile()
ParseFile - Main entrypoint for parsing a tblgen file.
static cl::opt< std::string > InputFilename(cl::Positional, cl::desc("<input file>"), cl::init("-"))
void setIncludeDirs(const std::vector< std::string > &Dirs)
static int createDependencyFile(const TGParser &Parser, const char *argv0)
Create a dependency file for -d option.
Represents a location in source code.