[llvm-commits] [llvm] r88913 - in /llvm/trunk/include/llvm/Support: Compiler.h IRBuilder.h

Douglas Gregor dgregor at apple.com
Mon Nov 16 08:28:56 PST 2009


On Nov 16, 2009, at 7:28 AM, Duncan Sands wrote:

> Author: baldrick
> Date: Mon Nov 16 09:28:17 2009
> New Revision: 88913
>
> URL: http://llvm.org/viewvc/llvm-project?rev=88913&view=rev
> Log:
> Make sure that if anyone passes a name by accident for the isSigned
> parameter of CreateIntCast then they get an error from the compiler
> (or from the linker with a non-gcc compiler).  Another possibility
> is to flip the order of the DestTy and isSigned parameters, since you
> should then get a compiler warning if you try to use a char* for a
> Type*.
>
> Modified:
>    llvm/trunk/include/llvm/Support/Compiler.h
>    llvm/trunk/include/llvm/Support/IRBuilder.h
>
> Modified: llvm/trunk/include/llvm/Support/Compiler.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Compiler.h?rev=88913&r1=88912&r2=88913&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/include/llvm/Support/Compiler.h (original)
> +++ llvm/trunk/include/llvm/Support/Compiler.h Mon Nov 16 09:28:17  
> 2009
> @@ -78,4 +78,10 @@
> #define NORETURN
> #endif
>
> +#ifdef __GNUC__
> +#define ERROR_IF_USED __attribute__((error("wrong usage")))
> +#else
> +#define ERROR_IF_USED
> +#endif
> +
> #endif

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...

   - Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20091116/1ee2775e/attachment.html>


More information about the llvm-commits mailing list