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

Daniel Dunbar daniel at zuster.org
Mon Nov 16 11:06:11 PST 2009


Couldn't this extra function also just be private with a DO NOT
IMPLEMENT marker?

- Daniel

On Mon, Nov 16, 2009 at 9:28 AM, Douglas Gregor <dgregor at apple.com> wrote:
>
> 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
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>




More information about the llvm-commits mailing list