Go to the documentation of this file.
26 #include <system_error>
57 "no-warn-on-unused-template-args",
58 cl::desc(
"Disable unused template argument warnings."));
61 errs() << ProgName <<
": " <<
Msg;
72 return reportError(argv0,
"the option -d must be used together with -o\n");
81 DepOut.
os() <<
' ' << Dep;
99 if (std::error_code EC = FileOrErr.
getError())
101 "': " + EC.message() +
"\n");
120 std::string OutString;
122 unsigned status = MainFn(Out, Records);
137 bool WriteFile =
true;
142 if (
auto ExistingOrErr =
144 if (
std::move(ExistingOrErr.get())->getBuffer() == Out.
str())
152 EC.message() +
"\n");
153 OutFile.
os() << Out.
str();
This is an optimization pass for GlobalISel generic memory operations.
static ErrorOr< std::unique_ptr< MemoryBuffer > > getFile(const Twine &Filename, bool IsText=false, bool RequiresNullTerminator=true, bool IsVolatile=false, std::optional< Align > Alignment=std::nullopt)
Open the specified file as a MemoryBuffer, returning a new MemoryBuffer if successful,...
static cl::opt< bool > WriteIfChanged("write-if-changed", cl::desc("Only write output if it changed"))
bool(raw_ostream &OS, RecordKeeper &Records) TableGenMainFn
Perform the action using Records, and write output to OS.
A raw_ostream that writes to an std::string.
static int reportError(const char *ProgName, Twine Msg)
raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
void startBackendTimer(StringRef Name)
Start timing the overall backend.
static cl::opt< std::string > InputFilename(cl::Positional, cl::desc("<input file>"), cl::init("-"))
void startTimer(StringRef Name)
Start timing a phase. Automatically stops any previous phase timer.
Represents a location in source code.
static ErrorOr< std::unique_ptr< MemoryBuffer > > getFileOrSTDIN(const Twine &Filename, bool IsText=false, bool RequiresNullTerminator=true, std::optional< Align > Alignment=std::nullopt)
Open the specified file as a MemoryBuffer, or open stdin if the Filename is "-".
static int createDependencyFile(const TGParser &Parser, const char *argv0)
Create a dependency file for -d option.
std::error_code getError() const
void stopBackendTimer()
Stop timing the overall backend.
void startPhaseTiming()
Start phase timing; called if the –time-phases option is specified.
@ OF_Text
The file should be opened in text mode on platforms like z/OS that make this distinction.
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
initializer< Ty > init(const Ty &Val)
static cl::list< std::string > MacroNames("D", cl::desc("Name of the macro to be defined"), cl::value_desc("macro name"), cl::Prefix)
void stopPhaseTiming()
Stop phase timing and print the report.
static cl::list< std::string > IncludeDirs("I", cl::desc("Directory of include files"), cl::value_desc("directory"), cl::Prefix)
int TableGenMain(const char *argv0, TableGenMainFn *MainFn)
static cl::opt< bool > TimePhases("time-phases", cl::desc("Time phases of parser and backend"))
void setIncludeDirs(const std::vector< std::string > &Dirs)
void stopTimer()
Stop timing a phase.
const CustomOperand< const MCSubtargetInfo & > Msg[]
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
const TGLexer::DependenciesSetTy & getDependencies() const
unsigned AddNewSourceBuffer(std::unique_ptr< MemoryBuffer > F, SMLoc IncludeLoc)
Add a new source buffer to this source manager.
void saveInputFilename(std::string Filename)
static cl::opt< std::string > OutputFilename("o", cl::desc("Output filename"), cl::value_desc("filename"), cl::init("-"))
std::error_code status(const Twine &path, file_status &result, bool follow=true)
Get file status as if by POSIX stat().
Represents either an error or a value T.
std::string & str()
Returns the string's reference.
bool ParseFile()
ParseFile - Main entrypoint for parsing a tblgen file.
static cl::opt< bool > NoWarnOnUnusedTemplateArgs("no-warn-on-unused-template-args", cl::desc("Disable unused template argument warnings."))
static cl::opt< std::string > DependFilename("d", cl::desc("Dependency filename"), cl::value_desc("filename"), cl::init(""))