Sema: Relax parsing of '#' in constraints
authorDavid Majnemer <david.majnemer@gmail.com>
Wed, 14 Jan 2015 05:11:09 +0000 (05:11 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Wed, 14 Jan 2015 05:11:09 +0000 (05:11 +0000)
llvm-svn: 225942

clang/lib/Basic/TargetInfo.cpp
clang/test/Sema/asm.c

index 84cdaab..6987cd7 100644 (file)
@@ -489,8 +489,6 @@ bool TargetInfo::validateOutputConstraint(ConstraintInfo &Info) const {
     case '#': // Ignore as constraint.
       while (Name[1] && Name[1] != ',')
         Name++;
-      if (Name[1] != ',')
-        return false;
       break;
     case '?': // Disparage slightly code.
     case '!': // Disparage severely.
@@ -637,8 +635,6 @@ bool TargetInfo::validateInputConstraint(ConstraintInfo *OutputConstraints,
     case '#': // Ignore as constraint.
       while (Name[1] && Name[1] != ',')
         Name++;
-      if (Name[1] != ',')
-        return false;
       break;
     case '?': // Disparage slightly code.
     case '!': // Disparage severely.
index 41a8265..6c6f3f3 100644 (file)
@@ -188,7 +188,7 @@ void fn4() {
   int l;
  __asm__(""
           : "=r"(l)
-          : "#m"(l)); // expected-error {{invalid input constraint '#m' in asm}}
+          : "m#"(l));
 }
 
 void fn5() {