aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/llvm/DerivedTypes.h15
-rw-r--r--include/llvm/Support/TypeBuilder.h6
2 files changed, 17 insertions, 4 deletions
diff --git a/include/llvm/DerivedTypes.h b/include/llvm/DerivedTypes.h
index b5824f8..053091b 100644
--- a/include/llvm/DerivedTypes.h
+++ b/include/llvm/DerivedTypes.h
@@ -159,6 +159,15 @@ public:
bool isVarArg ///< Whether this is a variable argument length function
);
+ /// FunctionType::get - Create a FunctionType taking no parameters.
+ ///
+ static FunctionType *get(
+ const Type *Result, ///< The result type
+ bool isVarArg ///< Whether this is a variable argument length function
+ ) {
+ return get(Result, std::vector<const Type *>(), isVarArg);
+ }
+
/// isValidReturnType - Return true if the specified type is valid as a return
/// type.
static bool isValidReturnType(const Type *RetTy);
@@ -234,6 +243,12 @@ public:
static StructType *get(const std::vector<const Type*> &Params,
bool isPacked=false);
+ /// StructType::get - Create an empty structure type.
+ ///
+ static StructType *get(bool isPacked=false) {
+ return get(std::vector<const Type*>(), isPacked);
+ }
+
/// StructType::get - This static method is a convenience method for
/// creating structure types by specifying the elements as arguments.
/// Note that this method always returns a non-packed struct. To get
diff --git a/include/llvm/Support/TypeBuilder.h b/include/llvm/Support/TypeBuilder.h
index 5198c81..b0ae516 100644
--- a/include/llvm/Support/TypeBuilder.h
+++ b/include/llvm/Support/TypeBuilder.h
@@ -253,8 +253,7 @@ public:
private:
static const FunctionType *create() {
- std::vector<const Type*> params;
- return FunctionType::get(TypeBuilder<R, cross>::get(), params, false);
+ return FunctionType::get(TypeBuilder<R, cross>::get(), false);
}
};
template<typename R, typename A1, bool cross> class TypeBuilder<R(A1), cross> {
@@ -360,8 +359,7 @@ public:
private:
static const FunctionType *create() {
- std::vector<const Type*> params;
- return FunctionType::get(TypeBuilder<R, cross>::get(), params, true);
+ return FunctionType::get(TypeBuilder<R, cross>::get(), true);
}
};
template<typename R, typename A1, bool cross>