<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Nov 16, 2009, at 7:28 AM, Duncan Sands wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Author: baldrick<br>Date: Mon Nov 16 09:28:17 2009<br>New Revision: 88913<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=88913&view=rev">http://llvm.org/viewvc/llvm-project?rev=88913&view=rev</a><br>Log:<br>Make sure that if anyone passes a name by accident for the isSigned<br>parameter of CreateIntCast then they get an error from the compiler<br>(or from the linker with a non-gcc compiler).  Another possibility<br>is to flip the order of the DestTy and isSigned parameters, since you<br>should then get a compiler warning if you try to use a char* for a<br>Type*.<br><br>Modified:<br>    llvm/trunk/include/llvm/Support/Compiler.h<br>    llvm/trunk/include/llvm/Support/IRBuilder.h<br><br>Modified: llvm/trunk/include/llvm/Support/Compiler.h<br>URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Compiler.h?rev=88913&r1=88912&r2=88913&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Compiler.h?rev=88913&r1=88912&r2=88913&view=diff</a><br><br>==============================================================================<br>--- llvm/trunk/include/llvm/Support/Compiler.h (original)<br>+++ llvm/trunk/include/llvm/Support/Compiler.h Mon Nov 16 09:28:17 2009<br>@@ -78,4 +78,10 @@<br> #define NORETURN<br> #endif<br><br>+#ifdef __GNUC__<br>+#define ERROR_IF_USED __attribute__((error("wrong usage")))<br>+#else<br>+#define ERROR_IF_USED<br>+#endif<br>+<br> #endif<font class="Apple-style-span" color="#000000"><font class="Apple-style-span" color="#144FAE"><br></font></font></div></blockquote><br></div><div>I'm getting a bunch of warnings now, since the "error" attribute is only available on GCC >= 4.3. Patch coming to conditionalize this more appropriately...</div><div><br></div><div>  - Doug</div></body></html>