aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Support/Compiler.h
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2009-11-16 15:28:17 +0000
committerDuncan Sands <baldrick@free.fr>2009-11-16 15:28:17 +0000
commita07e9ea3a1a0136632007d2cf93b70e3ebb4dc97 (patch)
treebaa2b16b6e23fa790758b3b2141371cfa70316a8 /include/llvm/Support/Compiler.h
parent2e7b993b008be1bcca4cec4803092d876b21595a (diff)
downloadexternal_llvm-a07e9ea3a1a0136632007d2cf93b70e3ebb4dc97.zip
external_llvm-a07e9ea3a1a0136632007d2cf93b70e3ebb4dc97.tar.gz
external_llvm-a07e9ea3a1a0136632007d2cf93b70e3ebb4dc97.tar.bz2
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*. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88913 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/Compiler.h')
-rw-r--r--include/llvm/Support/Compiler.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/llvm/Support/Compiler.h b/include/llvm/Support/Compiler.h
index da31f98..cce652f 100644
--- a/include/llvm/Support/Compiler.h
+++ b/include/llvm/Support/Compiler.h
@@ -78,4 +78,10 @@
#define NORETURN
#endif
+#ifdef __GNUC__
+#define ERROR_IF_USED __attribute__((error("wrong usage")))
+#else
+#define ERROR_IF_USED
+#endif
+
#endif