summaryrefslogtreecommitdiffstats
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.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/llvm/lib/TableGen/Record.cpp b/llvm/lib/TableGen/Record.cpp
index 3fa78a61df7..471261f2607 100644
--- a/llvm/lib/TableGen/Record.cpp
+++ b/llvm/lib/TableGen/Record.cpp
@@ -393,6 +393,14 @@ BitsInit::convertInitializerBitRange(ArrayRef<unsigned> Bits) const {
return BitsInit::get(NewBits);
}
+bool BitsInit::isConcrete() const {
+ for (unsigned i = 0, e = getNumBits(); i != e; ++i) {
+ if (!getBit(i)->isConcrete())
+ return false;
+ }
+ return true;
+}
+
std::string BitsInit::getAsString() const {
std::string Result = "{ ";
for (unsigned i = 0, e = getNumBits(); i != e; ++i) {
@@ -641,6 +649,14 @@ Init *ListInit::resolveReferences(Resolver &R) const {
return const_cast<ListInit *>(this);
}
+bool ListInit::isConcrete() const {
+ for (Init *Element : *this) {
+ if (!Element->isConcrete())
+ return false;
+ }
+ return true;
+}
+
std::string ListInit::getAsString() const {
std::string Result = "[";
const char *sep = "";
@@ -1444,6 +1460,16 @@ Init *DagInit::resolveReferences(Resolver &R) const {
return const_cast<DagInit *>(this);
}
+bool DagInit::isConcrete() const {
+ if (!Val->isConcrete())
+ return false;
+ for (const Init *Elt : getArgs()) {
+ if (!Elt->isConcrete())
+ return false;
+ }
+ return true;
+}
+
std::string DagInit::getAsString() const {
std::string Result = "(" + Val->getAsString();
if (ValName)
OpenPOWER on IntegriCloud