diff options
Diffstat (limited to 'contrib/llvm/lib/TableGen/Record.cpp')
-rw-r--r-- | contrib/llvm/lib/TableGen/Record.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/contrib/llvm/lib/TableGen/Record.cpp b/contrib/llvm/lib/TableGen/Record.cpp index c9a31b64cfd3..87a3422b32ab 100644 --- a/contrib/llvm/lib/TableGen/Record.cpp +++ b/contrib/llvm/lib/TableGen/Record.cpp @@ -673,6 +673,14 @@ Init *UnOpInit::Fold(Record *CurRec, MultiClass *CurMultiClass) const { PrintFatalError(CurRec->getLoc(), "Undefined reference:'" + Name + "'\n"); } + + if (isa<IntRecTy>(getType())) { + if (BitsInit *BI = dyn_cast<BitsInit>(LHS)) { + if (Init *NewInit = BI->convertInitializerTo(IntRecTy::get())) + return NewInit; + break; + } + } } break; } @@ -1633,7 +1641,7 @@ void Record::dump() const { errs() << *this; } raw_ostream &llvm::operator<<(raw_ostream &OS, const Record &R) { OS << R.getNameInitAsString(); - const std::vector<Init *> &TArgs = R.getTemplateArgs(); + ArrayRef<Init *> TArgs = R.getTemplateArgs(); if (!TArgs.empty()) { OS << "<"; bool NeedComma = false; |