From: Craig Topper Date: Thu, 28 May 2015 06:38:28 +0000 (+0000) Subject: [TableGen] Don't convert types to strings to query what they are. Just use 'isa' X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=commitdiff_plain;h=38e3e6a1955b5847498bedde39ab05464a9d2852;hp=48e2671cb6eeb6dc9498d72e4586c21ae32f37ed [TableGen] Don't convert types to strings to query what they are. Just use 'isa' git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238398 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/TableGen/Record.cpp b/lib/TableGen/Record.cpp index 9783922b966..9f71e1347f6 100644 --- a/lib/TableGen/Record.cpp +++ b/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(getType())) { if (StringInit *LHSs = dyn_cast(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(Arg)) - if (TArg->getType()->getAsString() == "dag") + if (isa(TArg->getType())) return ForeachHelper(LHS, Arg, RHSo, Type, CurRec, CurMultiClass); std::vector NewOperands;