[llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp

Chris Lattner lattner at cs.uiuc.edu
Fri Oct 28 15:43:37 PDT 2005



Changes in directory llvm/utils/TableGen:

DAGISelEmitter.cpp updated: 1.68 -> 1.69
---
Log message:

Use the new interface Jim added


---
Diffs of the changes:  (+7 -15)

 DAGISelEmitter.cpp |   22 +++++++---------------
 1 files changed, 7 insertions(+), 15 deletions(-)


Index: llvm/utils/TableGen/DAGISelEmitter.cpp
diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.68 llvm/utils/TableGen/DAGISelEmitter.cpp:1.69
--- llvm/utils/TableGen/DAGISelEmitter.cpp:1.68	Wed Oct 26 12:02:02 2005
+++ llvm/utils/TableGen/DAGISelEmitter.cpp	Fri Oct 28 17:43:25 2005
@@ -228,16 +228,14 @@
   
   // Parse the properties.
   Properties = 0;
-  ListInit *LI = R->getValueAsListInit("Properties");
-  for (unsigned i = 0, e = LI->getSize(); i != e; ++i) {
-    DefInit *DI = dynamic_cast<DefInit*>(LI->getElement(i));
-    assert(DI && "Properties list must be list of defs!");
-    if (DI->getDef()->getName() == "SDNPCommutative") {
+  std::vector<Record*> PropList = R->getValueAsListDef("Properties");
+  for (unsigned i = 0, e = PropList.size(); i != e; ++i) {
+    if (PropList[i]->getName() == "SDNPCommutative") {
       Properties |= 1 << SDNPCommutative;
-    } else if (DI->getDef()->getName() == "SDNPAssociative") {
+    } else if (PropList[i]->getName() == "SDNPAssociative") {
       Properties |= 1 << SDNPAssociative;
     } else {
-      std::cerr << "Unknown SD Node property '" << DI->getDef()->getName()
+      std::cerr << "Unknown SD Node property '" << PropList[i]->getName()
                 << "' on node '" << R->getName() << "'!\n";
       exit(1);
     }
@@ -245,14 +243,8 @@
   
   
   // Parse the type constraints.
-  ListInit *Constraints = TypeProfile->getValueAsListInit("Constraints");
-  for (unsigned i = 0, e = Constraints->getSize(); i != e; ++i) {
-    assert(dynamic_cast<DefInit*>(Constraints->getElement(i)) &&
-           "Constraints list should contain constraint definitions!");
-    Record *Constraint = 
-      static_cast<DefInit*>(Constraints->getElement(i))->getDef();
-    TypeConstraints.push_back(Constraint);
-  }
+  std::vector<Record*> ConstList =TypeProfile->getValueAsListDef("Constraints");
+  TypeConstraints.assign(ConstList.begin(), ConstList.end());
 }
 
 //===----------------------------------------------------------------------===//






More information about the llvm-commits mailing list