aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-02-23 23:36:53 +0000
committerChris Lattner <sabre@nondot.org>2006-02-23 23:36:53 +0000
commitfe3db46fe073ecaf0e1dc4b5be899e335f4e83a8 (patch)
tree1c064abd213269b9fca135a9a617641fa3c50a95 /lib/VMCore
parent7ef24f977341a404b536510c5d400109ebffd39e (diff)
downloadexternal_llvm-fe3db46fe073ecaf0e1dc4b5be899e335f4e83a8.zip
external_llvm-fe3db46fe073ecaf0e1dc4b5be899e335f4e83a8.tar.gz
external_llvm-fe3db46fe073ecaf0e1dc4b5be899e335f4e83a8.tar.bz2
Parse the %*# constraint modifiers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26341 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/InlineAsm.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/VMCore/InlineAsm.cpp b/lib/VMCore/InlineAsm.cpp
index cdb8c46..b36d212 100644
--- a/lib/VMCore/InlineAsm.cpp
+++ b/lib/VMCore/InlineAsm.cpp
@@ -51,6 +51,7 @@ bool InlineAsm::ConstraintInfo::Parse(const std::string &Str,
isEarlyClobber = false;
isIndirectOutput = false;
hasMatchingInput = false;
+ isCommutative = false;
// Parse the prefix.
if (*I == '~') {
@@ -74,12 +75,21 @@ bool InlineAsm::ConstraintInfo::Parse(const std::string &Str,
default:
DoneWithModifiers = true;
break;
- case '&':
+ case '&': // Early clobber.
if (Type != isOutput || // Cannot early clobber anything but output.
isEarlyClobber) // Reject &&&&&&
return true;
isEarlyClobber = true;
break;
+ case '%': // Commutative.
+ if (Type == isClobber || // Cannot commute clobbers.
+ isCommutative) // Reject %%%%%
+ return true;
+ isCommutative = true;
+ break;
+ case '#': // Comment.
+ case '*': // Register preferencing.
+ return true; // Not supported.
}
if (!DoneWithModifiers) {