summaryrefslogtreecommitdiff
path: root/llvm/lib/TableGen/Record.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/TableGen/Record.cpp')
-rw-r--r--llvm/lib/TableGen/Record.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/TableGen/Record.cpp b/llvm/lib/TableGen/Record.cpp
index feef51f3d203..597ccb7ca144 100644
--- a/llvm/lib/TableGen/Record.cpp
+++ b/llvm/lib/TableGen/Record.cpp
@@ -917,6 +917,13 @@ const Init *UnOpInit::Fold(const Record *CurRec, bool IsFinal) const {
return NewInit;
break;
+ case INITIALIZED:
+ if (isa<UnsetInit>(LHS))
+ return IntInit::get(RK, 0);
+ if (LHS->isConcrete())
+ return IntInit::get(RK, 1);
+ break;
+
case NOT:
if (const auto *LHSi = dyn_cast_or_null<IntInit>(
LHS->convertInitializerTo(IntRecTy::get(RK))))
@@ -1052,6 +1059,9 @@ std::string UnOpInit::getAsString() const {
case TOUPPER:
Result = "!toupper";
break;
+ case INITIALIZED:
+ Result = "!initialized";
+ break;
}
return Result + "(" + LHS->getAsString() + ")";
}