aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/SelectionDAG/TargetLowering.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-10-17 16:21:11 +0000
committerChris Lattner <sabre@nondot.org>2008-10-17 16:21:11 +0000
commit01f5354c1dfcc0d172b341aa8d9aeeb0dccd9065 (patch)
tree309dadc5cff02d4f392b98672ebd99dc512a3a5d /lib/CodeGen/SelectionDAG/TargetLowering.cpp
parent3babf015d4d64a994181d801092bd155a9f73ae4 (diff)
downloadexternal_llvm-01f5354c1dfcc0d172b341aa8d9aeeb0dccd9065.zip
external_llvm-01f5354c1dfcc0d172b341aa8d9aeeb0dccd9065.tar.gz
external_llvm-01f5354c1dfcc0d172b341aa8d9aeeb0dccd9065.tar.bz2
add an assert so that PR2356 explodes instead of running off an
array. Improve some minor comments, refactor some helpers in AsmOperandInfo. No functionality change for valid code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57686 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/TargetLowering.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/TargetLowering.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index 4e4fd2b..664e06d 100644
--- a/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -1962,6 +1962,21 @@ getRegForInlineAsmConstraint(const std::string &Constraint,
//===----------------------------------------------------------------------===//
// Constraint Selection.
+/// isMatchingConstraint - Return true of this is an input operand that is a
+/// matching constraint like "4".
+bool TargetLowering::AsmOperandInfo::isMatchingConstraint() const {
+ assert(!ConstraintCode.empty() && "No known constraint!");
+ return isdigit(ConstraintCode[0]);
+}
+
+/// getMatchedOperand - If this is an input matching constraint, this method
+/// returns the output operand it matches.
+unsigned TargetLowering::AsmOperandInfo::getMatchedOperand() const {
+ assert(!ConstraintCode.empty() && "No known constraint!");
+ return atoi(ConstraintCode.c_str());
+}
+
+
/// getConstraintGenerality - Return an integer indicating how general CT
/// is.
static unsigned getConstraintGenerality(TargetLowering::ConstraintType CT) {