aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm/lib/TableGen/Record.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-12-30 13:13:10 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-12-30 13:13:10 +0000
commit7d523365ff1a3cc95bc058b33102500f61e8166d (patch)
treeb466a4817f79516eb1df8eae92bccf62ecc84003 /contrib/llvm/lib/TableGen/Record.cpp
parente3b65fde506060bec5cd110fcf03b440bd0eea1d (diff)
parentdd58ef019b700900793a1eb48b52123db01b654e (diff)
Update llvm to trunk r256633.
Notes
Notes: svn path=/projects/clang380-import/; revision=292941
Diffstat (limited to 'contrib/llvm/lib/TableGen/Record.cpp')
-rw-r--r--contrib/llvm/lib/TableGen/Record.cpp10
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;