aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2009-11-17 08:34:52 +0000
committerDuncan Sands <baldrick@free.fr>2009-11-17 08:34:52 +0000
commit26459c2bf024b2a7dc92ab376679ebc4abf47e61 (patch)
tree8e883176448a697851693aba331698b02bf4143e /include
parentee68f45fe77ad7ce3079eb9e8222075dee099f08 (diff)
downloadexternal_llvm-26459c2bf024b2a7dc92ab376679ebc4abf47e61.zip
external_llvm-26459c2bf024b2a7dc92ab376679ebc4abf47e61.tar.gz
external_llvm-26459c2bf024b2a7dc92ab376679ebc4abf47e61.tar.bz2
Following a suggestion of Daniel Dunbar, stop people passing the name
as the isSigned bool to CreateIntCast by having this resolve to a call to a private method, rather than by using a gcc attribute. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89067 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Support/Compiler.h8
-rw-r--r--include/llvm/Support/IRBuilder.h8
2 files changed, 5 insertions, 11 deletions
diff --git a/include/llvm/Support/Compiler.h b/include/llvm/Support/Compiler.h
index 5c414f8..da31f98 100644
--- a/include/llvm/Support/Compiler.h
+++ b/include/llvm/Support/Compiler.h
@@ -78,12 +78,4 @@
#define NORETURN
#endif
-#if defined(__GNUC__) && ((__GNUC__ > 4)||(__GNUC__ == 4 && __GNUC_MINOR__ > 2))
-#define ERROR_IF_USED __attribute__((error("wrong usage")))
-#elif defined(__APPLE__)
-#define ERROR_IF_USED __attribute__((unavailable))
-#else
-#define ERROR_IF_USED
-#endif
-
#endif
diff --git a/include/llvm/Support/IRBuilder.h b/include/llvm/Support/IRBuilder.h
index 1d3c08c..2db2477 100644
--- a/include/llvm/Support/IRBuilder.h
+++ b/include/llvm/Support/IRBuilder.h
@@ -709,9 +709,11 @@ public:
return Folder.CreateIntCast(VC, DestTy, isSigned);
return Insert(CastInst::CreateIntegerCast(V, DestTy, isSigned), Name);
}
- // Provided to resolve 'CreateIntCast(Ptr, Ptr, "...")', instead of converting
- // the string to 'bool' for the isSigned parameter.
- ERROR_IF_USED Value *CreateIntCast(Value *, const Type *, const char *);
+private:
+ // Provided to resolve 'CreateIntCast(Ptr, Ptr, "...")', giving a compile time
+ // error, instead of converting the string to bool for the isSigned parameter.
+ Value *CreateIntCast(Value *, const Type *, const char *); // DO NOT IMPLEMENT
+public:
Value *CreateFPCast(Value *V, const Type *DestTy, const Twine &Name = "") {
if (V->getType() == DestTy)
return V;