llvm.org GIT mirror llvm / e5104ac
Fix a subtle multiclass bug: when using class inheritance on a toplevel 'defm', make sure to properly resolve references. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106570 91177308-0d34-0410-b5e6-96231b3b80d8 Bruno Cardoso Lopes 10 years ago
2 changed file(s) with 6 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
1515 class I op> : BaseI {
1616 bits<4> opcode = op;
1717 int val = !if(!eq(Prefix, xd.Prefix), 7, 21);
18 int check = !if(hasVEX_4VPrefix, 0, 10);
1819 }
1920
2021 multiclass R {
3233 defm SD : R, M, XS;
3334 }
3435
36 // CHECK: int check = 0;
3537 defm Instr : Y, VEX;
20192019 }
20202020 } else {
20212021 Records.addDef(CurRec);
2022 CurRec->resolveReferences();
20232022 }
20242023
20252024 NewRecDefs.push_back(CurRec);
20632062 if (SetValue(CurRec, LetStack[i][j].Loc, LetStack[i][j].Name,
20642063 LetStack[i][j].Bits, LetStack[i][j].Value))
20652064 return true;
2066
2067 if (!CurMultiClass)
2068 CurRec->resolveReferences();
20692065 }
20702066
20712067 if (Lex.getCode() != tgtok::comma) break;
20732069 SubClass = ParseSubClassReference(0, false);
20742070 }
20752071 }
2072
2073 if (!CurMultiClass)
2074 for (unsigned i = 0, e = NewRecDefs.size(); i != e; ++i)
2075 NewRecDefs[i]->resolveReferences();
20762076
20772077 if (Lex.getCode() != tgtok::semi)
20782078 return TokError("expected ';' at end of defm");