aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/TableGen/Error.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/TableGen/Error.cpp')
-rw-r--r--llvm/lib/TableGen/Error.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/TableGen/Error.cpp b/llvm/lib/TableGen/Error.cpp
index 6104573b4b25..ebe9129ebaeb 100644
--- a/llvm/lib/TableGen/Error.cpp
+++ b/llvm/lib/TableGen/Error.cpp
@@ -157,8 +157,8 @@ void PrintFatalError(const RecordVal *RecVal, const Twine &Msg) {
// Check an assertion: Obtain the condition value and be sure it is true.
// If not, print a nonfatal error along with the message.
void CheckAssert(SMLoc Loc, Init *Condition, Init *Message) {
- auto *CondValue = dyn_cast_or_null<IntInit>(
- Condition->convertInitializerTo(IntRecTy::get()));
+ auto *CondValue = dyn_cast_or_null<IntInit>(Condition->convertInitializerTo(
+ IntRecTy::get(Condition->getRecordKeeper())));
if (!CondValue)
PrintError(Loc, "assert condition must of type bit, bits, or int.");
else if (!CondValue->getValue()) {