X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FTableGen%2FTGParser.cpp;h=e5875ad7957ed8ec15a76bd341a2d3c5c8bc31b5;hb=22bd64173981bf1251c4b3bfc684207340534ba3;hp=1b1c18b589ac9b00663b38db6e238a9acb2e42c6;hpb=6cfc806a6b82b60a3e923b6b89f2b4da62cdb50b;p=oota-llvm.git diff --git a/lib/TableGen/TGParser.cpp b/lib/TableGen/TGParser.cpp index 1b1c18b589a..e5875ad7957 100644 --- a/lib/TableGen/TGParser.cpp +++ b/lib/TableGen/TGParser.cpp @@ -12,12 +12,12 @@ //===----------------------------------------------------------------------===// #include "TGParser.h" -#include "llvm/TableGen/Record.h" +#include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringExtras.h" +#include "llvm/Support/CommandLine.h" +#include "llvm/TableGen/Record.h" #include #include -#include "llvm/ADT/SmallVector.h" -#include "llvm/Support/CommandLine.h" using namespace llvm; //===----------------------------------------------------------------------===// @@ -406,8 +406,7 @@ Init *TGParser::ParseObjectName(MultiClass *CurMultiClass) { RecTy *Type = 0; if (CurRec) { - const TypedInit *CurRecName = - dyn_cast(CurRec->getNameInit()); + const TypedInit *CurRecName = dyn_cast(CurRec->getNameInit()); if (!CurRecName) { TokError("Record name is not typed!"); return 0; @@ -1050,20 +1049,20 @@ Init *TGParser::ParseOperation(Record *CurRec) { MHSTy = MHSt->getType(); if (BitsInit *MHSbits = dyn_cast(MHS)) MHSTy = BitsRecTy::get(MHSbits->getNumBits()); - if (dyn_cast(MHS)) + if (isa(MHS)) MHSTy = BitRecTy::get(); if (TypedInit *RHSt = dyn_cast(RHS)) RHSTy = RHSt->getType(); if (BitsInit *RHSbits = dyn_cast(RHS)) RHSTy = BitsRecTy::get(RHSbits->getNumBits()); - if (dyn_cast(RHS)) + if (isa(RHS)) RHSTy = BitRecTy::get(); // For UnsetInit, it's typed from the other hand. - if (dyn_cast(MHS)) + if (isa(MHS)) MHSTy = RHSTy; - if (dyn_cast(RHS)) + if (isa(RHS)) RHSTy = MHSTy; if (!MHSTy || !RHSTy) { @@ -2407,7 +2406,11 @@ bool TGParser::ParseDefm(MultiClass *CurMultiClass) { Init *DefmPrefix = 0; - if (Lex.Lex() == tgtok::Id) { // eat the defm. + Lex.Lex(); // eat the defm. + + // Note that tgtok::paste is here to allow starting with #NAME. + if (Lex.getCode() == tgtok::Id || + Lex.getCode() == tgtok::paste) { DefmPrefix = ParseObjectName(CurMultiClass); }