summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-02-27 21:44:08 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-02-27 21:44:08 +0000
commit53c9b3f68c74c6ea4d739bb268e5fc5b495adff3 (patch)
tree6d62458335e7058f8ce46221d440c00249f6cca0 /utils
parent5ef9226f30d0615558cdfc6a2b76c7a914a8e32f (diff)
downloadllvm-53c9b3f68c74c6ea4d739bb268e5fc5b495adff3.tar.gz
llvm-53c9b3f68c74c6ea4d739bb268e5fc5b495adff3.tar.bz2
llvm-53c9b3f68c74c6ea4d739bb268e5fc5b495adff3.tar.xz
Backing out
CodeGenTarget.cpp updated: 1.82 -> 1.83 Record.cpp updated: 1.55 -> 1.56 Record.h updated: 1.59 -> 1.60 TableGen.cpp updated: 1.47 -> 1.48 It's missing CallingConvEmitter.h git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34693 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/TableGen/CodeGenTarget.cpp8
-rw-r--r--utils/TableGen/Record.cpp7
-rw-r--r--utils/TableGen/Record.h2
-rw-r--r--utils/TableGen/TableGen.cpp8
4 files changed, 7 insertions, 18 deletions
diff --git a/utils/TableGen/CodeGenTarget.cpp b/utils/TableGen/CodeGenTarget.cpp
index d29ce514be..688ed0f924 100644
--- a/utils/TableGen/CodeGenTarget.cpp
+++ b/utils/TableGen/CodeGenTarget.cpp
@@ -604,7 +604,9 @@ CodeGenIntrinsic::CodeGenIntrinsic(Record *R, CodeGenTarget *CGT) {
// Parse the list of argument types.
ListInit *TypeList = R->getValueAsListInit("Types");
for (unsigned i = 0, e = TypeList->getSize(); i != e; ++i) {
- Record *TyEl = TypeList->getElementAsRecord(i);
+ DefInit *DI = dynamic_cast<DefInit*>(TypeList->getElement(i));
+ assert(DI && "Invalid list type!");
+ Record *TyEl = DI->getDef();
assert(TyEl->isSubClassOf("LLVMType") && "Expected a type!");
ArgTypes.push_back(TyEl->getValueAsString("TypeVal"));
@@ -618,7 +620,9 @@ CodeGenIntrinsic::CodeGenIntrinsic(Record *R, CodeGenTarget *CGT) {
// Parse the intrinsic properties.
ListInit *PropList = R->getValueAsListInit("Properties");
for (unsigned i = 0, e = PropList->getSize(); i != e; ++i) {
- Record *Property = PropList->getElementAsRecord(i);
+ DefInit *DI = dynamic_cast<DefInit*>(PropList->getElement(i));
+ assert(DI && "Invalid list type!");
+ Record *Property = DI->getDef();
assert(Property->isSubClassOf("IntrinsicProperty") &&
"Expected a property!");
diff --git a/utils/TableGen/Record.cpp b/utils/TableGen/Record.cpp
index bbcdbe7da3..94e0cb472f 100644
--- a/utils/TableGen/Record.cpp
+++ b/utils/TableGen/Record.cpp
@@ -337,13 +337,6 @@ Init *ListInit::convertInitListSlice(const std::vector<unsigned> &Elements) {
return new ListInit(Vals);
}
-Record *ListInit::getElementAsRecord(unsigned i) const {
- assert(i < Values.size() && "List element index out of range!");
- DefInit *DI = dynamic_cast<DefInit*>(Values[i]);
- if (DI == 0) throw "Expected record in list!";
- return DI->getDef();
-}
-
Init *ListInit::resolveReferences(Record &R, const RecordVal *RV) {
std::vector<Init*> Resolved;
Resolved.reserve(getSize());
diff --git a/utils/TableGen/Record.h b/utils/TableGen/Record.h
index 0971e938ba..986e9178d9 100644
--- a/utils/TableGen/Record.h
+++ b/utils/TableGen/Record.h
@@ -626,8 +626,6 @@ public:
return Values[i];
}
- Record *getElementAsRecord(unsigned i) const;
-
Init *convertInitListSlice(const std::vector<unsigned> &Elements);
virtual Init *convertInitializerTo(RecTy *Ty) {
diff --git a/utils/TableGen/TableGen.cpp b/utils/TableGen/TableGen.cpp
index d3d241e6c7..4345234c27 100644
--- a/utils/TableGen/TableGen.cpp
+++ b/utils/TableGen/TableGen.cpp
@@ -20,7 +20,6 @@
#include "llvm/Support/Streams.h"
#include "llvm/System/Signals.h"
#include "llvm/Support/FileUtilities.h"
-#include "CallingConvEmitter.h"
#include "CodeEmitterGen.h"
#include "RegisterInfoEmitter.h"
#include "InstrInfoEmitter.h"
@@ -39,7 +38,6 @@ enum ActionType {
GenEmitter,
GenRegisterEnums, GenRegister, GenRegisterHeader,
GenInstrEnums, GenInstrs, GenAsmWriter,
- GenCallingConv,
GenDAGISel,
GenSubtarget,
GenIntrinsic,
@@ -63,8 +61,6 @@ namespace {
"Generate enum values for instructions"),
clEnumValN(GenInstrs, "gen-instr-desc",
"Generate instruction descriptions"),
- clEnumValN(GenCallingConv, "gen-callingconv",
- "Generate calling convention descriptions"),
clEnumValN(GenAsmWriter, "gen-asm-writer",
"Generate assembly writer"),
clEnumValN(GenDAGISel, "gen-dag-isel",
@@ -142,9 +138,7 @@ int main(int argc, char **argv) {
case GenInstrs:
InstrInfoEmitter(Records).run(*Out);
break;
- case GenCallingConv:
- CallingConvEmitter(Records).run(*Out);
- break;
+
case GenAsmWriter:
AsmWriterEmitter(Records).run(*Out);
break;