summaryrefslogtreecommitdiffstats
path: root/llvm/lib/TableGen
diff options
context:
space:
mode:
authorValery Pykhtin <Valery.Pykhtin@amd.com>2018-10-10 10:52:57 +0000
committerValery Pykhtin <Valery.Pykhtin@amd.com>2018-10-10 10:52:57 +0000
commit52391ea0b3af40a2e7b2232e1c8b2a37cd1c0680 (patch)
treeb581bb2e29d876b98b5c1226915205c17fccff23 /llvm/lib/TableGen
parentaeb4b3e6324bfcce4b997204e54b8a0bf63efd5d (diff)
downloadbcm5719-llvm-52391ea0b3af40a2e7b2232e1c8b2a37cd1c0680.tar.gz
bcm5719-llvm-52391ea0b3af40a2e7b2232e1c8b2a37cd1c0680.zip
[TableGen] fix assert in !cast when used out of definition in a multiclass
Differential Revision: https://reviews.llvm.org/D53068 llvm-svn: 344134
Diffstat (limited to 'llvm/lib/TableGen')
-rw-r--r--llvm/lib/TableGen/Record.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/TableGen/Record.cpp b/llvm/lib/TableGen/Record.cpp
index 0aa0944aeef..cf1685a2e8c 100644
--- a/llvm/lib/TableGen/Record.cpp
+++ b/llvm/lib/TableGen/Record.cpp
@@ -709,6 +709,8 @@ Init *UnOpInit::Fold(Record *CurRec, bool IsFinal) const {
return StringInit::get(LHSi->getAsString());
} else if (isa<RecordRecTy>(getType())) {
if (StringInit *Name = dyn_cast<StringInit>(LHS)) {
+ if (!CurRec && !IsFinal)
+ break;
assert(CurRec && "NULL pointer");
Record *D;
OpenPOWER on IntegriCloud