mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-25 21:18:19 +00:00
Delete CodeInit and CodeRecTy from TableGen.
The code type was always identical to a string anyway. Now it is simply
a synonym. The code literal syntax [{...}] is still valid.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148092 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -78,7 +78,6 @@ template<> struct DenseMapInfo<TableGenStringKey> {
|
||||
BitRecTy BitRecTy::Shared;
|
||||
IntRecTy IntRecTy::Shared;
|
||||
StringRecTy StringRecTy::Shared;
|
||||
CodeRecTy CodeRecTy::Shared;
|
||||
DagRecTy DagRecTy::Shared;
|
||||
|
||||
void RecTy::anchor() { }
|
||||
@@ -316,12 +315,6 @@ Init *ListRecTy::convertValue(TypedInit *TI) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
Init *CodeRecTy::convertValue(TypedInit *TI) {
|
||||
if (TI->getType()->typeIsConvertibleTo(this))
|
||||
return TI;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Init *DagRecTy::convertValue(TypedInit *TI) {
|
||||
if (TI->getType()->typeIsConvertibleTo(this))
|
||||
return TI;
|
||||
@@ -582,17 +575,6 @@ StringInit *StringInit::get(StringRef V) {
|
||||
return I;
|
||||
}
|
||||
|
||||
void CodeInit::anchor() { }
|
||||
|
||||
CodeInit *CodeInit::get(StringRef V) {
|
||||
typedef StringMap<CodeInit *> Pool;
|
||||
static Pool ThePool;
|
||||
|
||||
CodeInit *&I = ThePool[V];
|
||||
if (!I) I = new CodeInit(V);
|
||||
return I;
|
||||
}
|
||||
|
||||
static void ProfileListInit(FoldingSetNodeID &ID,
|
||||
ArrayRef<Init *> Range,
|
||||
RecTy *EltTy) {
|
||||
@@ -1993,18 +1975,6 @@ DagInit *Record::getValueAsDag(StringRef FieldName) const {
|
||||
"' does not have a dag initializer!";
|
||||
}
|
||||
|
||||
std::string Record::getValueAsCode(StringRef FieldName) const {
|
||||
const RecordVal *R = getValue(FieldName);
|
||||
if (R == 0 || R->getValue() == 0)
|
||||
throw "Record `" + getName() + "' does not have a field named `" +
|
||||
FieldName.str() + "'!\n";
|
||||
|
||||
if (CodeInit *CI = dynamic_cast<CodeInit*>(R->getValue()))
|
||||
return CI->getValue();
|
||||
throw "Record `" + getName() + "', field `" + FieldName.str() +
|
||||
"' does not have a code initializer!";
|
||||
}
|
||||
|
||||
|
||||
void MultiClass::dump() const {
|
||||
errs() << "Record:\n";
|
||||
|
||||
Reference in New Issue
Block a user