[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp TargetLowering.cpp

Chris Lattner sabre at nondot.org
Sat Mar 24 19:15:17 PDT 2007



Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAGISel.cpp updated: 1.391 -> 1.392
TargetLowering.cpp updated: 1.99 -> 1.100
---
Log message:

switch TargetLowering::getConstraintType to take the entire constraint,
not just the first letter.  No functionality change.


---
Diffs of the changes:  (+28 -24)

 SelectionDAGISel.cpp |    8 ++++----
 TargetLowering.cpp   |   44 ++++++++++++++++++++++++--------------------
 2 files changed, 28 insertions(+), 24 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.391 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.392
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.391	Thu Mar 22 11:38:57 2007
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp	Sat Mar 24 21:14:49 2007
@@ -2633,9 +2633,9 @@
   std::string *Current = &C[0];
   // If we have multiple constraints, try to pick the most general one ahead
   // of time.  This isn't a wonderful solution, but handles common cases.
-  TargetLowering::ConstraintType Flavor = TLI.getConstraintType(Current[0][0]);
+  TargetLowering::ConstraintType Flavor = TLI.getConstraintType(Current[0]);
   for (unsigned j = 1, e = C.size(); j != e; ++j) {
-    TargetLowering::ConstraintType ThisFlavor = TLI.getConstraintType(C[j][0]);
+    TargetLowering::ConstraintType ThisFlavor = TLI.getConstraintType(C[j]);
     if (getConstraintGenerality(ThisFlavor) > 
         getConstraintGenerality(Flavor)) {
       // This constraint letter is more general than the previous one,
@@ -2748,7 +2748,7 @@
     case InlineAsm::isOutput: {
       TargetLowering::ConstraintType CTy = TargetLowering::C_RegisterClass;
       if (ConstraintCode.size() == 1)   // not a physreg name.
-        CTy = TLI.getConstraintType(ConstraintCode[0]);
+        CTy = TLI.getConstraintType(ConstraintCode);
       
       if (CTy == TargetLowering::C_Memory) {
         // Memory output.
@@ -2863,7 +2863,7 @@
       
       TargetLowering::ConstraintType CTy = TargetLowering::C_RegisterClass;
       if (ConstraintCode.size() == 1)   // not a physreg name.
-        CTy = TLI.getConstraintType(ConstraintCode[0]);
+        CTy = TLI.getConstraintType(ConstraintCode);
         
       if (CTy == TargetLowering::C_Other) {
         InOperandVal = TLI.isOperandValidForConstraint(InOperandVal,


Index: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.99 llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.100
--- llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.99	Wed Mar 21 16:51:52 2007
+++ llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp	Sat Mar 24 21:14:49 2007
@@ -1828,28 +1828,32 @@
 //===----------------------------------------------------------------------===//
 
 TargetLowering::ConstraintType
-TargetLowering::getConstraintType(char ConstraintLetter) const {
+TargetLowering::getConstraintType(const std::string &Constraint) const {
   // FIXME: lots more standard ones to handle.
-  switch (ConstraintLetter) {
-  default: return C_Unknown;
-  case 'r': return C_RegisterClass;
-  case 'm':    // memory
-  case 'o':    // offsetable
-  case 'V':    // not offsetable
-    return C_Memory;
-  case 'i':    // Simple Integer or Relocatable Constant
-  case 'n':    // Simple Integer
-  case 's':    // Relocatable Constant
-  case 'I':    // Target registers.
-  case 'J':
-  case 'K':
-  case 'L':
-  case 'M':
-  case 'N':
-  case 'O':
-  case 'P':
-    return C_Other;
+  if (Constraint.size() == 1) {
+    switch (Constraint[0]) {
+    default: break;
+    case 'r': return C_RegisterClass;
+    case 'm':    // memory
+    case 'o':    // offsetable
+    case 'V':    // not offsetable
+      return C_Memory;
+    case 'i':    // Simple Integer or Relocatable Constant
+    case 'n':    // Simple Integer
+    case 's':    // Relocatable Constant
+    case 'I':    // Target registers.
+    case 'J':
+    case 'K':
+    case 'L':
+    case 'M':
+    case 'N':
+    case 'O':
+    case 'P':
+      return C_Other;
+    }
   }
+  // TODO: Handle registers.
+  return C_Unknown;
 }
 
 /// isOperandValidForConstraint - Return the specified operand (possibly






More information about the llvm-commits mailing list