Add a new parse hint for multi-letter constraints in inline asm.
authorEric Christopher <echristo@apple.com>
Thu, 2 Jun 2011 19:26:37 +0000 (19:26 +0000)
committerEric Christopher <echristo@apple.com>
Thu, 2 Jun 2011 19:26:37 +0000 (19:26 +0000)
Testcase will come when we use it.

Part of rdar://9119939

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132476 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/InlineAsm.cpp

index e4f99f09a5c2f97f41d695593715a12eb3b58c71..70d0e3881e8cdf54d4b00430fb3e6af853c88215 100644 (file)
@@ -181,6 +181,15 @@ bool InlineAsm::ConstraintInfo::Parse(StringRef Str,
       multipleAlternativeIndex++;
       pCodes = &multipleAlternatives[multipleAlternativeIndex].Codes;
       ++I;
+    } else if (*I == '^') {
+      // Multi-letter constraint
+      // These will only occur with the existing multiple alternative
+      // constraints and so we can use the isalpha loop below.
+      StringRef::iterator ConStart = I;
+      while (I != E && isalpha(*I))
+        ++I;
+      pCodes->push_back(std::string(ConStart, I));
+      ++I;
     } else {
       // Single letter constraint.
       pCodes->push_back(std::string(I, I+1));