aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/TargetLowering.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2008-01-29 02:21:21 +0000
committerDale Johannesen <dalej@apple.com>2008-01-29 02:21:21 +0000
commitba2a0b960ea4c73d0f81557f63ae2ea126e08905 (patch)
tree3ab167b8e5d8524ae45f40e970d4c772cbb73da2 /lib/CodeGen/SelectionDAG/TargetLowering.cpp
parentc840da14c61ef336a530af8811a7268fccf3bd75 (diff)
Handle 'X' constraint in asm's better.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46485 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/TargetLowering.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/TargetLowering.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index 3ccfcfa2e8..bd0392e690 100644
--- a/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -1525,6 +1525,19 @@ TargetLowering::getConstraintType(const std::string &Constraint) const {
return C_Unknown;
}
+/// LowerXConstraint - try to replace an X constraint, which matches anything,
+/// with another that has more specific requirements based on the type of the
+/// corresponding operand.
+void TargetLowering::lowerXConstraint(MVT::ValueType ConstraintVT,
+ std::string& s) const {
+ if (MVT::isInteger(ConstraintVT))
+ s = "r";
+ else if (MVT::isFloatingPoint(ConstraintVT))
+ s = "f"; // works for many targets
+ else
+ s = "";
+}
+
/// LowerAsmOperandForConstraint - Lower the specified operand into the Ops
/// vector. If it is invalid, don't add anything to Ops.
void TargetLowering::LowerAsmOperandForConstraint(SDOperand Op,