summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-04-27 00:09:47 +0000
committerChris Lattner <sabre@nondot.org>2008-04-27 00:09:47 +0000
commit4376fea6631d41fff3f2a7c6186faed9eff59619 (patch)
tree1af25ffe029f0d7ad122e1a1c2eac23135fcdbd9 /include
parent5e764233f398b6929b67701672a5e78fec20ce2e (diff)
downloadllvm-4376fea6631d41fff3f2a7c6186faed9eff59619.tar.gz
llvm-4376fea6631d41fff3f2a7c6186faed9eff59619.tar.bz2
llvm-4376fea6631d41fff3f2a7c6186faed9eff59619.tar.xz
Move a bunch of inline asm code out of line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50313 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Target/TargetLowering.h71
1 files changed, 5 insertions, 66 deletions
diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h
index 0ff58eb91d..559f0387ac 100644
--- a/include/llvm/Target/TargetLowering.h
+++ b/include/llvm/Target/TargetLowering.h
@@ -1076,74 +1076,13 @@ public:
ConstraintType(TargetLowering::C_Unknown),
CallOperandVal(0), ConstraintVT(MVT::Other) {
}
-
- /// getConstraintGenerality - Return an integer indicating how general CT is.
- unsigned getConstraintGenerality(TargetLowering::ConstraintType CT) {
- switch (CT) {
- default: assert(0 && "Unknown constraint type!");
- case TargetLowering::C_Other:
- case TargetLowering::C_Unknown:
- return 0;
- case TargetLowering::C_Register:
- return 1;
- case TargetLowering::C_RegisterClass:
- return 2;
- case TargetLowering::C_Memory:
- return 3;
- }
- }
-
- /// ComputeConstraintToUse - Determines the constraint code and constraint
- /// type to use.
- void ComputeConstraintToUse(const TargetLowering &TLI) {
- assert(!Codes.empty() && "Must have at least one constraint");
-
- std::string *Current = &Codes[0];
- TargetLowering::ConstraintType CurType = TLI.getConstraintType(*Current);
- // Single-letter constraints ('r') are very common.
- if (Codes.size() == 1) {
- ConstraintCode = *Current;
- ConstraintType = CurType;
- } else {
- unsigned CurGenerality = getConstraintGenerality(CurType);
-
- // 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.
- for (unsigned j = 1, e = Codes.size(); j != e; ++j) {
- TargetLowering::ConstraintType ThisType =
- TLI.getConstraintType(Codes[j]);
- unsigned ThisGenerality = getConstraintGenerality(ThisType);
- if (ThisGenerality > CurGenerality) {
- // This constraint letter is more general than the previous one,
- // use it.
- CurType = ThisType;
- Current = &Codes[j];
- CurGenerality = ThisGenerality;
- }
- }
-
- ConstraintCode = *Current;
- ConstraintType = CurType;
- }
-
- // 'X' matches anything.
- if (ConstraintCode == "X" && CallOperandVal) {
- // Labels and constants are handled elsewhere ('X' is the only thing
- // that matches labels).
- if (isa<BasicBlock>(CallOperandVal) || isa<ConstantInt>(CallOperandVal))
- return;
-
- // Otherwise, try to resolve it to something we know about by looking at
- // the actual operand type.
- if (const char *Repl = TLI.LowerXConstraint(ConstraintVT)) {
- ConstraintCode = Repl;
- ConstraintType = TLI.getConstraintType(ConstraintCode);
- }
- }
- }
};
+ /// ComputeConstraintToUse - Determines the constraint code and constraint
+ /// type to use for the specific AsmOperandInfo, setting
+ /// OpInfo.ConstraintCode and OpInfo.ConstraintType.
+ virtual void ComputeConstraintToUse(AsmOperandInfo &OpInfo) const;
+
/// getConstraintType - Given a constraint, return the type of constraint it
/// is for this target.
virtual ConstraintType getConstraintType(const std::string &Constraint) const;