aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/TargetLowering.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-08-25 00:47:38 +0000
committerChris Lattner <sabre@nondot.org>2007-08-25 00:47:38 +0000
commit48884cd80b52be1528618f2e9b3425ac24e7b5ca (patch)
tree4748d599a094f208addfbbf19ce0589a2d53ad4a /lib/CodeGen/SelectionDAG/TargetLowering.cpp
parent21dcae17f580678c452eac73e01424c924d2f994 (diff)
rename isOperandValidForConstraint to LowerAsmOperandForConstraint,
changing the interface to allow for future changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41384 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/TargetLowering.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/TargetLowering.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index 2e91359b43..9597696d2d 100644
--- a/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -1354,12 +1354,12 @@ TargetLowering::getConstraintType(const std::string &Constraint) const {
return C_Unknown;
}
-/// isOperandValidForConstraint - Return the specified operand (possibly
-/// modified) if the specified SDOperand is valid for the specified target
-/// constraint letter, otherwise return null.
-SDOperand TargetLowering::isOperandValidForConstraint(SDOperand Op,
- char ConstraintLetter,
- SelectionDAG &DAG) {
+/// LowerAsmOperandForConstraint - Lower the specified operand into the Ops
+/// vector. If it is invalid, don't add anything to Ops.
+void TargetLowering::LowerAsmOperandForConstraint(SDOperand Op,
+ char ConstraintLetter,
+ std::vector<SDOperand> &Ops,
+ SelectionDAG &DAG) {
switch (ConstraintLetter) {
default: break;
case 'i': // Simple Integer or Relocatable Constant
@@ -1390,19 +1390,21 @@ SDOperand TargetLowering::isOperandValidForConstraint(SDOperand Op,
if (ConstraintLetter != 'n') {
int64_t Offs = GA->getOffset();
if (C) Offs += C->getValue();
- return DAG.getTargetGlobalAddress(GA->getGlobal(), Op.getValueType(),
- Offs);
+ Ops.push_back(DAG.getTargetGlobalAddress(GA->getGlobal(),
+ Op.getValueType(), Offs));
+ return;
}
}
if (C) { // just C, no GV.
// Simple constants are not allowed for 's'.
- if (ConstraintLetter != 's')
- return DAG.getTargetConstant(C->getValue(), Op.getValueType());
+ if (ConstraintLetter != 's') {
+ Ops.push_back(DAG.getTargetConstant(C->getValue(), Op.getValueType()));
+ return;
+ }
}
break;
}
}
- return SDOperand(0,0);
}
std::vector<unsigned> TargetLowering::