summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2014-11-04 01:12:21 +0000
committerReid Kleckner <reid@kleckner.net>2014-11-04 01:12:21 +0000
commite1e1df83f937e1169831137362e63572a7fcc612 (patch)
tree1047c7ea6b6c0d1a6dfcce0763194dbe5af060d6
parente839965faa22d6ed5dd41402c80bd806eb8f6c26 (diff)
downloadbcm5719-llvm-e1e1df83f937e1169831137362e63572a7fcc612.tar.gz
bcm5719-llvm-e1e1df83f937e1169831137362e63572a7fcc612.zip
Rename END_WITH_NULL to LLVM_END_WITH_NULL and move to Compiler.h
We shouldn't put this kind of attribute stuff in DataTypes.h. Leave the END_WITH_NULL name for now so I can update clang without making build spam. llvm-svn: 221215
-rw-r--r--llvm/include/llvm/IR/Constants.h2
-rw-r--r--llvm/include/llvm/IR/DerivedTypes.h6
-rw-r--r--llvm/include/llvm/IR/Module.h4
-rw-r--r--llvm/include/llvm/Support/CommandLine.h6
-rw-r--r--llvm/include/llvm/Support/Compiler.h8
-rw-r--r--llvm/include/llvm/Support/DataTypes.h.cmake6
-rw-r--r--llvm/include/llvm/Support/DataTypes.h.in6
7 files changed, 17 insertions, 21 deletions
diff --git a/llvm/include/llvm/IR/Constants.h b/llvm/include/llvm/IR/Constants.h
index 4823be00090..1b0e1b7e7b7 100644
--- a/llvm/include/llvm/IR/Constants.h
+++ b/llvm/include/llvm/IR/Constants.h
@@ -386,7 +386,7 @@ protected:
public:
// ConstantStruct accessors
static Constant *get(StructType *T, ArrayRef<Constant*> V);
- static Constant *get(StructType *T, ...) END_WITH_NULL;
+ static Constant *get(StructType *T, ...) LLVM_END_WITH_NULL;
/// getAnon - Return an anonymous struct that has the specified
/// elements. If the struct is possibly empty, then you must specify a
diff --git a/llvm/include/llvm/IR/DerivedTypes.h b/llvm/include/llvm/IR/DerivedTypes.h
index bad3beba493..534d1e54160 100644
--- a/llvm/include/llvm/IR/DerivedTypes.h
+++ b/llvm/include/llvm/IR/DerivedTypes.h
@@ -218,7 +218,7 @@ public:
StringRef Name,
bool isPacked = false);
static StructType *create(LLVMContext &Context, ArrayRef<Type*> Elements);
- static StructType *create(StringRef Name, Type *elt1, ...) END_WITH_NULL;
+ static StructType *create(StringRef Name, Type *elt1, ...) LLVM_END_WITH_NULL;
/// StructType::get - This static method is the primary way to create a
/// literal StructType.
@@ -233,7 +233,7 @@ public:
/// structure types by specifying the elements as arguments. Note that this
/// method always returns a non-packed struct, and requires at least one
/// element type.
- static StructType *get(Type *elt1, ...) END_WITH_NULL;
+ static StructType *get(Type *elt1, ...) LLVM_END_WITH_NULL;
bool isPacked() const { return (getSubclassData() & SCDB_Packed) != 0; }
@@ -263,7 +263,7 @@ public:
/// setBody - Specify a body for an opaque identified type.
void setBody(ArrayRef<Type*> Elements, bool isPacked = false);
- void setBody(Type *elt1, ...) END_WITH_NULL;
+ void setBody(Type *elt1, ...) LLVM_END_WITH_NULL;
/// isValidElementType - Return true if the specified type is valid as a
/// element type.
diff --git a/llvm/include/llvm/IR/Module.h b/llvm/include/llvm/IR/Module.h
index 70f47495153..8bf67a3efea 100644
--- a/llvm/include/llvm/IR/Module.h
+++ b/llvm/include/llvm/IR/Module.h
@@ -352,11 +352,11 @@ public:
/// function arguments, which makes it easier for clients to use.
Constant *getOrInsertFunction(StringRef Name,
AttributeSet AttributeList,
- Type *RetTy, ...) END_WITH_NULL;
+ Type *RetTy, ...) LLVM_END_WITH_NULL;
/// Same as above, but without the attributes.
Constant *getOrInsertFunction(StringRef Name, Type *RetTy, ...)
- END_WITH_NULL;
+ LLVM_END_WITH_NULL;
/// Look up the specified function in the module symbol table. If it does not
/// exist, return null.
diff --git a/llvm/include/llvm/Support/CommandLine.h b/llvm/include/llvm/Support/CommandLine.h
index 751a3c8bce9..2b5c9c52979 100644
--- a/llvm/include/llvm/Support/CommandLine.h
+++ b/llvm/include/llvm/Support/CommandLine.h
@@ -513,9 +513,9 @@ public:
}
};
-template<class DataType>
-ValuesClass<DataType> END_WITH_NULL values(const char *Arg, DataType Val,
- const char *Desc, ...) {
+template <class DataType>
+ValuesClass<DataType> LLVM_END_WITH_NULL
+values(const char *Arg, DataType Val, const char *Desc, ...) {
va_list ValueArgs;
va_start(ValueArgs, Desc);
ValuesClass<DataType> Vals(Arg, Val, Desc, ValueArgs);
diff --git a/llvm/include/llvm/Support/Compiler.h b/llvm/include/llvm/Support/Compiler.h
index 8a86ebdbf3a..19308f6f0a4 100644
--- a/llvm/include/llvm/Support/Compiler.h
+++ b/llvm/include/llvm/Support/Compiler.h
@@ -139,6 +139,14 @@
#define LLVM_LIBRARY_VISIBILITY
#endif
+#if __has_attribute(sentinel) || LLVM_GNUC_PREREQ(3, 0, 0)
+#define END_WITH_NULL __attribute__((sentinel))
+#define LLVM_END_WITH_NULL __attribute__((sentinel))
+#else
+#define END_WITH_NULL
+#define LLVM_END_WITH_NULL
+#endif
+
#if __has_attribute(used) || LLVM_GNUC_PREREQ(3, 1, 0)
#define LLVM_ATTRIBUTE_USED __attribute__((__used__))
#else
diff --git a/llvm/include/llvm/Support/DataTypes.h.cmake b/llvm/include/llvm/Support/DataTypes.h.cmake
index c0152451d95..c90bf51afae 100644
--- a/llvm/include/llvm/Support/DataTypes.h.cmake
+++ b/llvm/include/llvm/Support/DataTypes.h.cmake
@@ -123,12 +123,6 @@ typedef signed int ssize_t;
# define UINT64_MAX 0xffffffffffffffffULL
#endif
-#if __GNUC__ > 3
-#define END_WITH_NULL __attribute__((sentinel))
-#else
-#define END_WITH_NULL
-#endif
-
#ifndef HUGE_VALF
#define HUGE_VALF (float)HUGE_VAL
#endif
diff --git a/llvm/include/llvm/Support/DataTypes.h.in b/llvm/include/llvm/Support/DataTypes.h.in
index 09cfcdf3b56..b8b2ba56ff3 100644
--- a/llvm/include/llvm/Support/DataTypes.h.in
+++ b/llvm/include/llvm/Support/DataTypes.h.in
@@ -116,12 +116,6 @@ typedef signed int ssize_t;
# define UINT64_MAX 0xffffffffffffffffULL
#endif
-#if __GNUC__ > 3
-#define END_WITH_NULL __attribute__((sentinel))
-#else
-#define END_WITH_NULL
-#endif
-
#ifndef HUGE_VALF
#define HUGE_VALF (float)HUGE_VAL
#endif
OpenPOWER on IntegriCloud