aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/InlineAsm.h
diff options
context:
space:
mode:
authorJohn Thompson <John.Thompson.JTSoftware@gmail.com>2010-09-13 18:15:37 +0000
committerJohn Thompson <John.Thompson.JTSoftware@gmail.com>2010-09-13 18:15:37 +0000
commiteac6e1d0c748afc3d1496be0753ffbe5f5a4279b (patch)
tree94079e066b7fbaf541433ad07e9453331d09b7ba /include/llvm/InlineAsm.h
parentc32a2260a6145000581a74fd61ba57bdcc4cb951 (diff)
downloadexternal_llvm-eac6e1d0c748afc3d1496be0753ffbe5f5a4279b.zip
external_llvm-eac6e1d0c748afc3d1496be0753ffbe5f5a4279b.tar.gz
external_llvm-eac6e1d0c748afc3d1496be0753ffbe5f5a4279b.tar.bz2
Added skeleton for inline asm multiple alternative constraint support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113766 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/InlineAsm.h')
-rw-r--r--include/llvm/InlineAsm.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/include/llvm/InlineAsm.h b/include/llvm/InlineAsm.h
index 105b1bc..0cb55b7 100644
--- a/include/llvm/InlineAsm.h
+++ b/include/llvm/InlineAsm.h
@@ -87,6 +87,19 @@ public:
isClobber // '~x'
};
+ struct SubConstraintInfo {
+ /// MatchingInput - If this is not -1, this is an output constraint where an
+ /// input constraint is required to match it (e.g. "0"). The value is the
+ /// constraint number that matches this one (for example, if this is
+ /// constraint #0 and constraint #4 has the value "0", this will be 4).
+ signed char MatchingInput;
+ /// Code - The constraint code, either the register name (in braces) or the
+ /// constraint letter/number.
+ std::vector<std::string> Codes;
+ /// Default constructor.
+ SubConstraintInfo() : MatchingInput(-1) {}
+ };
+
struct ConstraintInfo {
/// Type - The basic type of the constraint: input/output/clobber
///
@@ -120,11 +133,31 @@ public:
/// constraint letter/number.
std::vector<std::string> Codes;
+ /// isMultipleAlternative - '|': has multiple-alternative constraints.
+ bool isMultipleAlternative;
+
+ /// multipleAlternatives - If there are multiple alternative constraints,
+ /// this array will contain them. Otherwise it will be empty.
+ std::vector<SubConstraintInfo> multipleAlternatives;
+
+ /// The currently selected alternative constraint index.
+ unsigned currentAlternativeIndex;
+
+ ///Default constructor.
+ ConstraintInfo();
+
+ /// Copy constructor.
+ ConstraintInfo(const ConstraintInfo &other);
+
/// Parse - Analyze the specified string (e.g. "=*&{eax}") and fill in the
/// fields in this structure. If the constraint string is not understood,
/// return true, otherwise return false.
bool Parse(StringRef Str,
std::vector<InlineAsm::ConstraintInfo> &ConstraintsSoFar);
+
+ /// selectAlternative - Point this constraint to the alternative constraint
+ /// indicated by the index.
+ void selectAlternative(unsigned index);
};
/// ParseConstraints - Split up the constraint string into the specific