13#ifndef LLVM_TABLEGEN_CODEGENHELPERS_H
14#define LLVM_TABLEGEN_CODEGENHELPERS_H
30 : Name(Name.str()), OS(OS), LateUndef(LateUndef) {
31 OS <<
"#ifdef " << Name <<
"\n";
33 OS <<
"#undef " << Name <<
"\n";
39 OS <<
"#undef " << Name <<
"\n";
40 OS <<
"#endif // " << Name <<
"\n\n";
55 : Condition(Condition.str()), OS(OS) {
56 OS <<
"#if " << Condition <<
"\n\n";
62 std::string Condition;
70 : Name(Name.str()), OS(OS) {
71 OS <<
"#ifndef " << Name <<
"\n"
72 <<
"#define " << Name <<
"\n\n";
87 : Name(trim(NameUntrimmed).str()), OS(OS) {
89 OS <<
"namespace " << Name <<
" {\n\n";
94 OS <<
"\n} // namespace " << Name <<
"\n";
106 Name.consume_front(
"::");
IfDefEmitter(raw_ostream &OS, StringRef Name, bool LateUndef=false)
IfGuardEmitter(raw_ostream &OS, StringRef Condition)
IncludeGuardEmitter(raw_ostream &OS, StringRef Name)
NamespaceEmitter(raw_ostream &OS, StringRef NameUntrimmed)
StringRef - Represent a constant reference to a string, i.e.
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.