summaryrefslogtreecommitdiffstats
path: root/llvm/lib/TableGen
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2015-05-28 06:38:28 +0000
committerCraig Topper <craig.topper@gmail.com>2015-05-28 06:38:28 +0000
commit2a8d4b294c950c73714aec7383cbf7a46adc9895 (patch)
tree9736e36fe3fe5c9197d87386dc676e7f1f618f27 /llvm/lib/TableGen
parent587336d2ad2f4ff7570e7dbd03d635a826186586 (diff)
downloadbcm5719-llvm-2a8d4b294c950c73714aec7383cbf7a46adc9895.tar.gz
bcm5719-llvm-2a8d4b294c950c73714aec7383cbf7a46adc9895.zip
[TableGen] Don't convert types to strings to query what they are. Just use 'isa'
llvm-svn: 238398
Diffstat (limited to 'llvm/lib/TableGen')
-rw-r--r--llvm/lib/TableGen/Record.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/TableGen/Record.cpp b/llvm/lib/TableGen/Record.cpp
index 9783922b966..9f71e1347f6 100644
--- a/llvm/lib/TableGen/Record.cpp
+++ b/llvm/lib/TableGen/Record.cpp
@@ -717,7 +717,7 @@ UnOpInit *UnOpInit::get(UnaryOp opc, Init *lhs, RecTy *Type) {
Init *UnOpInit::Fold(Record *CurRec, MultiClass *CurMultiClass) const {
switch (getOpcode()) {
case CAST: {
- if (getType()->getAsString() == "string") {
+ if (isa<StringRecTy>(getType())) {
if (StringInit *LHSs = dyn_cast<StringInit>(LHS))
return LHSs;
@@ -987,7 +987,7 @@ static Init *EvaluateOperation(OpInit *RHSo, Init *LHS, Init *Arg,
MultiClass *CurMultiClass) {
// If this is a dag, recurse
if (auto *TArg = dyn_cast<TypedInit>(Arg))
- if (TArg->getType()->getAsString() == "dag")
+ if (isa<DagRecTy>(TArg->getType()))
return ForeachHelper(LHS, Arg, RHSo, Type, CurRec, CurMultiClass);
std::vector<Init *> NewOperands;
OpenPOWER on IntegriCloud