summaryrefslogtreecommitdiffstats
path: root/include/llvm/TableGen
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/TableGen')
-rw-r--r--include/llvm/TableGen/Record.h222
-rw-r--r--include/llvm/TableGen/TableGenAction.h1
-rw-r--r--include/llvm/TableGen/TableGenBackend.h4
3 files changed, 99 insertions, 128 deletions
diff --git a/include/llvm/TableGen/Record.h b/include/llvm/TableGen/Record.h
index afce760..5e68c10 100644
--- a/include/llvm/TableGen/Record.h
+++ b/include/llvm/TableGen/Record.h
@@ -20,6 +20,7 @@
#include "llvm/Support/Allocator.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/DataTypes.h"
+#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include <map>
@@ -32,7 +33,6 @@ class BitsRecTy;
class IntRecTy;
class StringRecTy;
class ListRecTy;
-class CodeRecTy;
class DagRecTy;
class RecordRecTy;
@@ -43,7 +43,6 @@ class BitInit;
class BitsInit;
class IntInit;
class StringInit;
-class CodeInit;
class ListInit;
class UnOpInit;
class BinOpInit;
@@ -68,6 +67,7 @@ class RecordKeeper;
class RecTy {
ListRecTy *ListTy;
+ virtual void anchor();
public:
RecTy() : ListTy(0) {}
virtual ~RecTy() {}
@@ -99,7 +99,6 @@ public: // These methods should only be called from subclasses of Init
virtual Init *convertValue( TernOpInit *UI) {
return convertValue((TypedInit*)UI);
}
- virtual Init *convertValue( CodeInit *CI) { return 0; }
virtual Init *convertValue(VarBitInit *VB) { return 0; }
virtual Init *convertValue( DefInit *DI) { return 0; }
virtual Init *convertValue( DagInit *DI) { return 0; }
@@ -119,7 +118,6 @@ public: // These methods should only be called by subclasses of RecTy.
virtual bool baseClassOf(const IntRecTy *RHS) const { return false; }
virtual bool baseClassOf(const StringRecTy *RHS) const { return false; }
virtual bool baseClassOf(const ListRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const CodeRecTy *RHS) const { return false; }
virtual bool baseClassOf(const DagRecTy *RHS) const { return false; }
virtual bool baseClassOf(const RecordRecTy *RHS) const { return false; }
};
@@ -144,7 +142,6 @@ public:
virtual Init *convertValue( IntInit *II);
virtual Init *convertValue(StringInit *SI) { return 0; }
virtual Init *convertValue( ListInit *LI) { return 0; }
- virtual Init *convertValue( CodeInit *CI) { return 0; }
virtual Init *convertValue(VarBitInit *VB) { return (Init*)VB; }
virtual Init *convertValue( DefInit *DI) { return 0; }
virtual Init *convertValue( DagInit *DI) { return 0; }
@@ -165,7 +162,6 @@ public:
virtual bool baseClassOf(const IntRecTy *RHS) const { return true; }
virtual bool baseClassOf(const StringRecTy *RHS) const { return false; }
virtual bool baseClassOf(const ListRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const CodeRecTy *RHS) const { return false; }
virtual bool baseClassOf(const DagRecTy *RHS) const { return false; }
virtual bool baseClassOf(const RecordRecTy *RHS) const { return false; }
@@ -189,7 +185,6 @@ public:
virtual Init *convertValue( IntInit *II);
virtual Init *convertValue(StringInit *SI) { return 0; }
virtual Init *convertValue( ListInit *LI) { return 0; }
- virtual Init *convertValue( CodeInit *CI) { return 0; }
virtual Init *convertValue(VarBitInit *VB) { return 0; }
virtual Init *convertValue( DefInit *DI) { return 0; }
virtual Init *convertValue( DagInit *DI) { return 0; }
@@ -212,7 +207,6 @@ public:
virtual bool baseClassOf(const IntRecTy *RHS) const { return true; }
virtual bool baseClassOf(const StringRecTy *RHS) const { return false; }
virtual bool baseClassOf(const ListRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const CodeRecTy *RHS) const { return false; }
virtual bool baseClassOf(const DagRecTy *RHS) const { return false; }
virtual bool baseClassOf(const RecordRecTy *RHS) const { return false; }
@@ -233,7 +227,6 @@ public:
virtual Init *convertValue( IntInit *II) { return (Init*)II; }
virtual Init *convertValue(StringInit *SI) { return 0; }
virtual Init *convertValue( ListInit *LI) { return 0; }
- virtual Init *convertValue( CodeInit *CI) { return 0; }
virtual Init *convertValue(VarBitInit *VB) { return 0; }
virtual Init *convertValue( DefInit *DI) { return 0; }
virtual Init *convertValue( DagInit *DI) { return 0; }
@@ -255,7 +248,6 @@ public:
virtual bool baseClassOf(const IntRecTy *RHS) const { return true; }
virtual bool baseClassOf(const StringRecTy *RHS) const { return false; }
virtual bool baseClassOf(const ListRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const CodeRecTy *RHS) const { return false; }
virtual bool baseClassOf(const DagRecTy *RHS) const { return false; }
virtual bool baseClassOf(const RecordRecTy *RHS) const { return false; }
@@ -279,7 +271,6 @@ public:
virtual Init *convertValue( BinOpInit *BO);
virtual Init *convertValue( TernOpInit *BO) { return RecTy::convertValue(BO);}
- virtual Init *convertValue( CodeInit *CI) { return 0; }
virtual Init *convertValue(VarBitInit *VB) { return 0; }
virtual Init *convertValue( DefInit *DI) { return 0; }
virtual Init *convertValue( DagInit *DI) { return 0; }
@@ -298,7 +289,6 @@ public:
virtual bool baseClassOf(const IntRecTy *RHS) const { return false; }
virtual bool baseClassOf(const StringRecTy *RHS) const { return true; }
virtual bool baseClassOf(const ListRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const CodeRecTy *RHS) const { return false; }
virtual bool baseClassOf(const DagRecTy *RHS) const { return false; }
virtual bool baseClassOf(const RecordRecTy *RHS) const { return false; }
};
@@ -322,7 +312,6 @@ public:
virtual Init *convertValue( IntInit *II) { return 0; }
virtual Init *convertValue(StringInit *SI) { return 0; }
virtual Init *convertValue( ListInit *LI);
- virtual Init *convertValue( CodeInit *CI) { return 0; }
virtual Init *convertValue(VarBitInit *VB) { return 0; }
virtual Init *convertValue( DefInit *DI) { return 0; }
virtual Init *convertValue( DagInit *DI) { return 0; }
@@ -346,47 +335,6 @@ public:
virtual bool baseClassOf(const ListRecTy *RHS) const {
return RHS->getElementType()->typeIsConvertibleTo(Ty);
}
- virtual bool baseClassOf(const CodeRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const DagRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const RecordRecTy *RHS) const { return false; }
-};
-
-/// CodeRecTy - 'code' - Represent an code fragment, function or method.
-///
-class CodeRecTy : public RecTy {
- static CodeRecTy Shared;
- CodeRecTy() {}
-public:
- static CodeRecTy *get() { return &Shared; }
-
- virtual Init *convertValue( UnsetInit *UI) { return (Init*)UI; }
- virtual Init *convertValue( BitInit *BI) { return 0; }
- virtual Init *convertValue( BitsInit *BI) { return 0; }
- virtual Init *convertValue( IntInit *II) { return 0; }
- virtual Init *convertValue(StringInit *SI) { return 0; }
- virtual Init *convertValue( ListInit *LI) { return 0; }
- virtual Init *convertValue( CodeInit *CI) { return (Init*)CI; }
- virtual Init *convertValue(VarBitInit *VB) { return 0; }
- virtual Init *convertValue( DefInit *DI) { return 0; }
- virtual Init *convertValue( DagInit *DI) { return 0; }
- virtual Init *convertValue( UnOpInit *UI) { return RecTy::convertValue(UI);}
- virtual Init *convertValue( BinOpInit *UI) { return RecTy::convertValue(UI);}
- virtual Init *convertValue( TernOpInit *UI) { return RecTy::convertValue(UI);}
- virtual Init *convertValue( TypedInit *TI);
- virtual Init *convertValue( VarInit *VI) { return RecTy::convertValue(VI);}
- virtual Init *convertValue( FieldInit *FI) { return RecTy::convertValue(FI);}
-
- std::string getAsString() const { return "code"; }
-
- bool typeIsConvertibleTo(const RecTy *RHS) const {
- return RHS->baseClassOf(this);
- }
- virtual bool baseClassOf(const BitRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const BitsRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const IntRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const StringRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const ListRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const CodeRecTy *RHS) const { return true; }
virtual bool baseClassOf(const DagRecTy *RHS) const { return false; }
virtual bool baseClassOf(const RecordRecTy *RHS) const { return false; }
};
@@ -405,7 +353,6 @@ public:
virtual Init *convertValue( IntInit *II) { return 0; }
virtual Init *convertValue(StringInit *SI) { return 0; }
virtual Init *convertValue( ListInit *LI) { return 0; }
- virtual Init *convertValue( CodeInit *CI) { return 0; }
virtual Init *convertValue(VarBitInit *VB) { return 0; }
virtual Init *convertValue( DefInit *DI) { return 0; }
virtual Init *convertValue( UnOpInit *BO);
@@ -427,7 +374,6 @@ public:
virtual bool baseClassOf(const IntRecTy *RHS) const { return false; }
virtual bool baseClassOf(const StringRecTy *RHS) const { return false; }
virtual bool baseClassOf(const ListRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const CodeRecTy *RHS) const { return false; }
virtual bool baseClassOf(const DagRecTy *RHS) const { return true; }
virtual bool baseClassOf(const RecordRecTy *RHS) const { return false; }
};
@@ -451,7 +397,6 @@ public:
virtual Init *convertValue( IntInit *II) { return 0; }
virtual Init *convertValue(StringInit *SI) { return 0; }
virtual Init *convertValue( ListInit *LI) { return 0; }
- virtual Init *convertValue( CodeInit *CI) { return 0; }
virtual Init *convertValue(VarBitInit *VB) { return 0; }
virtual Init *convertValue( UnOpInit *UI) { return RecTy::convertValue(UI);}
virtual Init *convertValue( BinOpInit *UI) { return RecTy::convertValue(UI);}
@@ -472,7 +417,6 @@ public:
virtual bool baseClassOf(const IntRecTy *RHS) const { return false; }
virtual bool baseClassOf(const StringRecTy *RHS) const { return false; }
virtual bool baseClassOf(const ListRecTy *RHS) const { return false; }
- virtual bool baseClassOf(const CodeRecTy *RHS) const { return false; }
virtual bool baseClassOf(const DagRecTy *RHS) const { return false; }
virtual bool baseClassOf(const RecordRecTy *RHS) const;
};
@@ -489,6 +433,7 @@ RecTy *resolveTypes(RecTy *T1, RecTy *T2);
class Init {
Init(const Init &); // Do not define.
Init &operator=(const Init &); // Do not define.
+ virtual void anchor();
protected:
Init(void) {}
@@ -617,6 +562,7 @@ class UnsetInit : public Init {
UnsetInit() : Init() {}
UnsetInit(const UnsetInit &); // Do not define.
UnsetInit &operator=(const UnsetInit &Other); // Do not define.
+ virtual void anchor();
public:
static UnsetInit *get();
@@ -638,6 +584,7 @@ class BitInit : public Init {
explicit BitInit(bool V) : Value(V) {}
BitInit(const BitInit &Other); // Do not define.
BitInit &operator=(BitInit &Other); // Do not define.
+ virtual void anchor();
public:
static BitInit *get(bool V);
@@ -725,8 +672,7 @@ public:
///
virtual Init *resolveBitReference(Record &R, const RecordVal *RV,
unsigned Bit) const {
- assert(0 && "Illegal bit reference off int");
- return 0;
+ llvm_unreachable("Illegal bit reference off int");
}
/// resolveListElementReference - This method is used to implement
@@ -734,8 +680,7 @@ public:
/// now, we return the resolved value, otherwise we return null.
virtual Init *resolveListElementReference(Record &R, const RecordVal *RV,
unsigned Elt) const {
- assert(0 && "Illegal element reference off int");
- return 0;
+ llvm_unreachable("Illegal element reference off int");
}
};
@@ -750,9 +695,10 @@ class StringInit : public TypedInit {
StringInit(const StringInit &Other); // Do not define.
StringInit &operator=(const StringInit &Other); // Do not define.
+ virtual void anchor();
public:
- static StringInit *get(const std::string &V);
+ static StringInit *get(StringRef);
const std::string &getValue() const { return Value; }
@@ -769,8 +715,7 @@ public:
///
virtual Init *resolveBitReference(Record &R, const RecordVal *RV,
unsigned Bit) const {
- assert(0 && "Illegal bit reference off string");
- return 0;
+ llvm_unreachable("Illegal bit reference off string");
}
/// resolveListElementReference - This method is used to implement
@@ -778,31 +723,8 @@ public:
/// now, we return the resolved value, otherwise we return null.
virtual Init *resolveListElementReference(Record &R, const RecordVal *RV,
unsigned Elt) const {
- assert(0 && "Illegal element reference off string");
- return 0;
- }
-};
-
-/// CodeInit - "[{...}]" - Represent a code fragment.
-///
-class CodeInit : public Init {
- std::string Value;
-
- explicit CodeInit(const std::string &V) : Value(V) {}
-
- CodeInit(const CodeInit &Other); // Do not define.
- CodeInit &operator=(const CodeInit &Other); // Do not define.
-
-public:
- static CodeInit *get(const std::string &V);
-
- const std::string &getValue() const { return Value; }
-
- virtual Init *convertInitializerTo(RecTy *Ty) const {
- return Ty->convertValue(const_cast<CodeInit *>(this));
+ llvm_unreachable("Illegal element reference off string");
}
-
- virtual std::string getAsString() const { return "[{" + Value + "}]"; }
};
/// ListInit - [AL, AH, CL] - Represent a list of defs
@@ -861,8 +783,7 @@ public:
///
virtual Init *resolveBitReference(Record &R, const RecordVal *RV,
unsigned Bit) const {
- assert(0 && "Illegal bit reference off list");
- return 0;
+ llvm_unreachable("Illegal bit reference off list");
}
/// resolveListElementReference - This method is used to implement
@@ -1058,9 +979,11 @@ public:
/// VarInit - 'Opcode' - Represent a reference to an entire variable object.
///
class VarInit : public TypedInit {
- std::string VarName;
+ Init *VarName;
explicit VarInit(const std::string &VN, RecTy *T)
+ : TypedInit(T), VarName(StringInit::get(VN)) {}
+ explicit VarInit(Init *VN, RecTy *T)
: TypedInit(T), VarName(VN) {}
VarInit(const VarInit &Other); // Do not define.
@@ -1074,7 +997,11 @@ public:
return Ty->convertValue(const_cast<VarInit *>(this));
}
- const std::string &getName() const { return VarName; }
+ const std::string &getName() const;
+ Init *getNameInit() const { return VarName; }
+ std::string getNameInitAsString() const {
+ return getNameInit()->getAsUnquotedString();
+ }
virtual Init *resolveBitReference(Record &R, const RecordVal *RV,
unsigned Bit) const;
@@ -1092,7 +1019,7 @@ public:
///
virtual Init *resolveReferences(Record &R, const RecordVal *RV) const;
- virtual std::string getAsString() const { return VarName; }
+ virtual std::string getAsString() const { return getName(); }
};
@@ -1201,8 +1128,7 @@ public:
///
virtual Init *resolveBitReference(Record &R, const RecordVal *RV,
unsigned Bit) const {
- assert(0 && "Illegal bit reference off def");
- return 0;
+ llvm_unreachable("Illegal bit reference off def");
}
/// resolveListElementReference - This method is used to implement
@@ -1210,8 +1136,7 @@ public:
/// now, we return the resolved value, otherwise we return null.
virtual Init *resolveListElementReference(Record &R, const RecordVal *RV,
unsigned Elt) const {
- assert(0 && "Illegal element reference off def");
- return 0;
+ llvm_unreachable("Illegal element reference off def");
}
};
@@ -1320,14 +1245,12 @@ public:
virtual Init *resolveBitReference(Record &R, const RecordVal *RV,
unsigned Bit) const {
- assert(0 && "Illegal bit reference off dag");
- return 0;
+ llvm_unreachable("Illegal bit reference off dag");
}
virtual Init *resolveListElementReference(Record &R, const RecordVal *RV,
unsigned Elt) const {
- assert(0 && "Illegal element reference off dag");
- return 0;
+ llvm_unreachable("Illegal element reference off dag");
}
};
@@ -1345,6 +1268,10 @@ public:
RecordVal(const std::string &N, RecTy *T, unsigned P);
const std::string &getName() const;
+ const Init *getNameInit() const { return Name; }
+ std::string getNameInitAsString() const {
+ return getNameInit()->getAsUnquotedString();
+ }
unsigned getPrefix() const { return Prefix; }
RecTy *getType() const { return Ty; }
@@ -1375,7 +1302,7 @@ class Record {
unsigned ID;
Init *Name;
SMLoc Loc;
- std::vector<std::string> TemplateArgs;
+ std::vector<Init *> TemplateArgs;
std::vector<RecordVal> Values;
std::vector<Record*> SuperClasses;
@@ -1384,13 +1311,21 @@ class Record {
DefInit *TheInit;
+ void init();
void checkName();
public:
// Constructs a record.
explicit Record(const std::string &N, SMLoc loc, RecordKeeper &records) :
- ID(LastID++), Name(StringInit::get(N)), Loc(loc), TrackedRecords(records), TheInit(0) {}
+ ID(LastID++), Name(StringInit::get(N)), Loc(loc), TrackedRecords(records),
+ TheInit(0) {
+ init();
+ }
+ explicit Record(Init *N, SMLoc loc, RecordKeeper &records) :
+ ID(LastID++), Name(N), Loc(loc), TrackedRecords(records), TheInit(0) {
+ init();
+ }
~Record() {}
@@ -1400,6 +1335,13 @@ public:
unsigned getID() const { return ID; }
const std::string &getName() const;
+ Init *getNameInit() const {
+ return Name;
+ }
+ const std::string getNameInitAsString() const {
+ return getNameInit()->getAsUnquotedString();
+ }
+
void setName(Init *Name); // Also updates RecordKeeper.
void setName(const std::string &Name); // Also updates RecordKeeper.
@@ -1408,46 +1350,69 @@ public:
/// get the corresponding DefInit.
DefInit *getDefInit();
- const std::vector<std::string> &getTemplateArgs() const {
+ const std::vector<Init *> &getTemplateArgs() const {
return TemplateArgs;
}
const std::vector<RecordVal> &getValues() const { return Values; }
const std::vector<Record*> &getSuperClasses() const { return SuperClasses; }
- bool isTemplateArg(StringRef Name) const {
+ bool isTemplateArg(Init *Name) const {
for (unsigned i = 0, e = TemplateArgs.size(); i != e; ++i)
if (TemplateArgs[i] == Name) return true;
return false;
}
+ bool isTemplateArg(StringRef Name) const {
+ return isTemplateArg(StringInit::get(Name.str()));
+ }
- const RecordVal *getValue(StringRef Name) const {
+ const RecordVal *getValue(const Init *Name) const {
for (unsigned i = 0, e = Values.size(); i != e; ++i)
- if (Values[i].getName() == Name) return &Values[i];
+ if (Values[i].getNameInit() == Name) return &Values[i];
return 0;
}
- RecordVal *getValue(StringRef Name) {
+ const RecordVal *getValue(StringRef Name) const {
+ return getValue(StringInit::get(Name));
+ }
+ RecordVal *getValue(const Init *Name) {
for (unsigned i = 0, e = Values.size(); i != e; ++i)
- if (Values[i].getName() == Name) return &Values[i];
+ if (Values[i].getNameInit() == Name) return &Values[i];
return 0;
}
+ RecordVal *getValue(StringRef Name) {
+ return getValue(StringInit::get(Name));
+ }
- void addTemplateArg(StringRef Name) {
+ void addTemplateArg(Init *Name) {
assert(!isTemplateArg(Name) && "Template arg already defined!");
TemplateArgs.push_back(Name);
}
+ void addTemplateArg(StringRef Name) {
+ addTemplateArg(StringInit::get(Name.str()));
+ }
void addValue(const RecordVal &RV) {
- assert(getValue(RV.getName()) == 0 && "Value already added!");
+ assert(getValue(RV.getNameInit()) == 0 && "Value already added!");
Values.push_back(RV);
+ if (Values.size() > 1)
+ // Keep NAME at the end of the list. It makes record dumps a
+ // bit prettier and allows TableGen tests to be written more
+ // naturally. Tests can use CHECK-NEXT to look for Record
+ // fields they expect to see after a def. They can't do that if
+ // NAME is the first Record field.
+ std::swap(Values[Values.size() - 2], Values[Values.size() - 1]);
}
- void removeValue(StringRef Name) {
+ void removeValue(Init *Name) {
for (unsigned i = 0, e = Values.size(); i != e; ++i)
- if (Values[i].getName() == Name) {
+ if (Values[i].getNameInit() == Name) {
Values.erase(Values.begin()+i);
return;
}
- assert(0 && "Cannot remove an entry that does not exist!");
+ llvm_unreachable("Cannot remove an entry that does not exist!");
+ }
+
+ void removeValue(StringRef Name) {
+ removeValue(StringInit::get(Name.str()));
}
bool isSubClassOf(const Record *R) const {
@@ -1459,7 +1424,7 @@ public:
bool isSubClassOf(StringRef Name) const {
for (unsigned i = 0, e = SuperClasses.size(); i != e; ++i)
- if (SuperClasses[i]->getName() == Name)
+ if (SuperClasses[i]->getNameInitAsString() == Name)
return true;
return false;
}
@@ -1553,12 +1518,6 @@ public:
/// the value is not the right type.
///
DagInit *getValueAsDag(StringRef FieldName) const;
-
- /// getValueAsCode - This method looks up the specified field and returns
- /// its value as the string data in a CodeInit, throwing an exception if the
- /// field does not exist or if the value is not a code object.
- ///
- std::string getValueAsCode(StringRef FieldName) const;
};
raw_ostream &operator<<(raw_ostream &OS, const Record &R);
@@ -1576,6 +1535,7 @@ struct MultiClass {
class RecordKeeper {
std::map<std::string, Record*> Classes, Defs;
+
public:
~RecordKeeper() {
for (std::map<std::string, Record*>::iterator I = Classes.begin(),
@@ -1598,12 +1558,12 @@ public:
return I == Defs.end() ? 0 : I->second;
}
void addClass(Record *R) {
- assert(getClass(R->getName()) == 0 && "Class already exists!");
- Classes.insert(std::make_pair(R->getName(), R));
+ assert(getClass(R->getNameInitAsString()) == 0 && "Class already exists!");
+ Classes.insert(std::make_pair(R->getNameInitAsString(), R));
}
void addDef(Record *R) {
- assert(getDef(R->getName()) == 0 && "Def already exists!");
- Defs.insert(std::make_pair(R->getName(), R));
+ assert(getDef(R->getNameInitAsString()) == 0 && "Def already exists!");
+ Defs.insert(std::make_pair(R->getNameInitAsString(), R));
}
/// removeClass - Remove, but do not delete, the specified record.
@@ -1650,6 +1610,16 @@ struct LessRecordFieldName {
raw_ostream &operator<<(raw_ostream &OS, const RecordKeeper &RK);
+/// QualifyName - Return an Init with a qualifier prefix referring
+/// to CurRec's name.
+Init *QualifyName(Record &CurRec, MultiClass *CurMultiClass,
+ Init *Name, const std::string &Scoper);
+
+/// QualifyName - Return an Init with a qualifier prefix referring
+/// to CurRec's name.
+Init *QualifyName(Record &CurRec, MultiClass *CurMultiClass,
+ const std::string &Name, const std::string &Scoper);
+
} // End llvm namespace
#endif
diff --git a/include/llvm/TableGen/TableGenAction.h b/include/llvm/TableGen/TableGenAction.h
index 9f1c23c..733ae62 100644
--- a/include/llvm/TableGen/TableGenAction.h
+++ b/include/llvm/TableGen/TableGenAction.h
@@ -21,6 +21,7 @@ class raw_ostream;
class RecordKeeper;
class TableGenAction {
+ virtual void anchor();
public:
virtual ~TableGenAction() {}
diff --git a/include/llvm/TableGen/TableGenBackend.h b/include/llvm/TableGen/TableGenBackend.h
index 853f92e..3ebcd92 100644
--- a/include/llvm/TableGen/TableGenBackend.h
+++ b/include/llvm/TableGen/TableGenBackend.h
@@ -16,7 +16,6 @@
#define LLVM_TABLEGEN_TABLEGENBACKEND_H
#include "llvm/Support/raw_ostream.h"
-#include <string>
namespace llvm {
@@ -24,6 +23,7 @@ class Record;
class RecordKeeper;
struct TableGenBackend {
+ virtual void anchor();
virtual ~TableGenBackend() {}
// run - All TableGen backends should implement the run method, which should
@@ -34,7 +34,7 @@ struct TableGenBackend {
public: // Useful helper routines...
/// EmitSourceFileHeader - Output a LLVM style file header to the specified
/// ostream.
- void EmitSourceFileHeader(const std::string &Desc, raw_ostream &OS) const;
+ void EmitSourceFileHeader(StringRef Desc, raw_ostream &OS) const;
};
OpenPOWER on IntegriCloud