[Stackmaps] Enable invoking the patchpoint intrinsic.
[oota-llvm.git] / lib / IR / InlineAsm.cpp
index 62d191dbce396513eb00c5c952c56c6a9db026f6..16d874f32fc39a76eb684d9a9cfe9e484822f05f 100644 (file)
@@ -91,6 +91,10 @@ bool InlineAsm::ConstraintInfo::Parse(StringRef Str,
   if (*I == '~') {
     Type = isClobber;
     ++I;
+
+    // '{' must immediately follow '~'.
+    if (I != E && *I != '{')
+      return true;
   } else if (*I == '=') {
     ++I;
     Type = isOutput;
@@ -274,7 +278,7 @@ bool InlineAsm::Verify(FunctionType *Ty, StringRef ConstStr) {
     break;
   default:
     StructType *STy = dyn_cast<StructType>(Ty->getReturnType());
-    if (STy == 0 || STy->getNumElements() != NumOutputs)
+    if (!STy || STy->getNumElements() != NumOutputs)
       return false;
     break;
   }