[PATCH] Allow sret on the second parameter as well as the first

Rafael Ávila de Espíndola rafael.espindola at gmail.com
Fri May 9 12:18:57 PDT 2014


================
Comment at: lib/Target/X86/X86ISelLowering.cpp:2307
@@ +2306,3 @@
+    AttributeSet Attrs = MF.getFunction()->getAttributes();
+    for (; I != E; ++I)
+      if (Attrs.hasAttribute(I + 1, Attribute::StructRet))
----------------
Why the loop? If the rest of the code assumes that it is the first or second, it seems better to check only those too, or at least assert that I is 0 or 1.

http://reviews.llvm.org/D3617






More information about the llvm-commits mailing list