diff options
author | Chris Lattner <sabre@nondot.org> | 2007-03-25 02:14:49 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-03-25 02:14:49 +0000 |
commit | 4234f57fa02b1f04a9f52a7b3c2aa22d32ac521c (patch) | |
tree | be85ddfcc73a327c28ecfa0d4d081a06a7467869 /lib/CodeGen | |
parent | 2b81207b4b2bafa912851e8935271aa2faf82cfe (diff) |
switch TargetLowering::getConstraintType to take the entire constraint,
not just the first letter. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35322 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 8 | ||||
-rw-r--r-- | lib/CodeGen/SelectionDAG/TargetLowering.cpp | 44 |
2 files changed, 28 insertions, 24 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 5a12aeb706..c41e00c0eb 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -2633,9 +2633,9 @@ static std::string GetMostGeneralConstraint(std::vector<std::string> &C, 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 @@ void SelectionDAGLowering::visitInlineAsm(CallInst &I) { 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 @@ void SelectionDAGLowering::visitInlineAsm(CallInst &I) { 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, diff --git a/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 718d983389..7436c1747a 100644 --- a/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -1828,28 +1828,32 @@ PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const { //===----------------------------------------------------------------------===// 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 |