mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +00:00
[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
This commit is contained in:
parent
48e2671cb6
commit
38e3e6a195
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user