[PATCH] D18092: Swift Calling Convention: add swifterror attribute

John McCall via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 1 09:20:56 PDT 2016


rjmccall added inline comments.

================
Comment at: lib/IR/Verifier.cpp:1415
@@ +1414,3 @@
+             "Attribute 'swifterror' only applies to parameters "
+             "with pointer type that holds a pointer to the error object!",
+             V);
----------------
You probably don't need to be this explicit; just "with pointer to pointer type" would be fine.

================
Comment at: lib/IR/Verifier.cpp:1909
@@ +1908,3 @@
+               "swifterror argument can only be loaded and stored from!",
+               &Arg, U);
+      }
----------------
For StoreInst, you should check that it's the second operand.

You might also want to check that the operation isn't atomic or volatile.

And you should impose a similar restriction on swifterror allocas, I think, although there you also want to permit it to be passed as a swifterror argument.  (Maybe that should be allowed here, too?)


http://reviews.llvm.org/D18092





More information about the llvm-commits mailing list