summaryrefslogtreecommitdiff
path: root/include/llvm/IR/Constants.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-05-16 19:46:52 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-05-16 19:46:52 +0000
commit6b3f41ed88e8e440e11a4fbf20b6600529f80049 (patch)
tree928b056f24a634d628c80238dbbf10d41b1a71d5 /include/llvm/IR/Constants.h
parentc46e6a5940c50058e00c0c5f9123fd82e338d29a (diff)
Diffstat (limited to 'include/llvm/IR/Constants.h')
-rw-r--r--include/llvm/IR/Constants.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/llvm/IR/Constants.h b/include/llvm/IR/Constants.h
index ad83b21c7bf3..5db9b3bb5048 100644
--- a/include/llvm/IR/Constants.h
+++ b/include/llvm/IR/Constants.h
@@ -26,6 +26,7 @@
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/None.h"
#include "llvm/ADT/Optional.h"
+#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/IR/Constant.h"
#include "llvm/IR/DerivedTypes.h"
@@ -452,7 +453,14 @@ class ConstantStruct final : public ConstantAggregate {
public:
// ConstantStruct accessors
static Constant *get(StructType *T, ArrayRef<Constant*> V);
- static Constant *get(StructType *T, ...) LLVM_END_WITH_NULL;
+
+ template <typename... Csts>
+ static typename std::enable_if<are_base_of<Constant, Csts...>::value,
+ Constant *>::type
+ get(StructType *T, Csts *... Vs) {
+ SmallVector<Constant *, 8> Values({Vs...});
+ return get(T, Values);
+ }
/// Return an anonymous struct that has the specified elements.
/// If the struct is possibly empty, then you must specify a context.