From: Jay Foad Date: Mon, 25 Jul 2011 10:32:27 +0000 (+0000) Subject: Remove uses of std::vector from TypeBuilder. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6d0ac80d5e0412fc2dae8566a272159042af0006;p=oota-llvm.git Remove uses of std::vector from TypeBuilder. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135906 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Support/TypeBuilder.h b/include/llvm/Support/TypeBuilder.h index 18007789736..c75606917c1 100644 --- a/include/llvm/Support/TypeBuilder.h +++ b/include/llvm/Support/TypeBuilder.h @@ -18,7 +18,6 @@ #include "llvm/DerivedTypes.h" #include "llvm/LLVMContext.h" #include -#include namespace llvm { @@ -254,9 +253,9 @@ public: template class TypeBuilder { public: static FunctionType *get(LLVMContext &Context) { - std::vector params; - params.reserve(1); - params.push_back(TypeBuilder::get(Context)); + Type *params[] = { + TypeBuilder::get(Context), + }; return FunctionType::get(TypeBuilder::get(Context), params, false); } @@ -265,10 +264,10 @@ template class TypeBuilder { public: static FunctionType *get(LLVMContext &Context) { - std::vector params; - params.reserve(2); - params.push_back(TypeBuilder::get(Context)); - params.push_back(TypeBuilder::get(Context)); + Type *params[] = { + TypeBuilder::get(Context), + TypeBuilder::get(Context), + }; return FunctionType::get(TypeBuilder::get(Context), params, false); } @@ -277,11 +276,11 @@ template class TypeBuilder { public: static FunctionType *get(LLVMContext &Context) { - std::vector params; - params.reserve(3); - params.push_back(TypeBuilder::get(Context)); - params.push_back(TypeBuilder::get(Context)); - params.push_back(TypeBuilder::get(Context)); + Type *params[] = { + TypeBuilder::get(Context), + TypeBuilder::get(Context), + TypeBuilder::get(Context), + }; return FunctionType::get(TypeBuilder::get(Context), params, false); } @@ -292,12 +291,12 @@ template { public: static FunctionType *get(LLVMContext &Context) { - std::vector params; - params.reserve(4); - params.push_back(TypeBuilder::get(Context)); - params.push_back(TypeBuilder::get(Context)); - params.push_back(TypeBuilder::get(Context)); - params.push_back(TypeBuilder::get(Context)); + Type *params[] = { + TypeBuilder::get(Context), + TypeBuilder::get(Context), + TypeBuilder::get(Context), + TypeBuilder::get(Context), + }; return FunctionType::get(TypeBuilder::get(Context), params, false); } @@ -308,13 +307,13 @@ template { public: static FunctionType *get(LLVMContext &Context) { - std::vector params; - params.reserve(5); - params.push_back(TypeBuilder::get(Context)); - params.push_back(TypeBuilder::get(Context)); - params.push_back(TypeBuilder::get(Context)); - params.push_back(TypeBuilder::get(Context)); - params.push_back(TypeBuilder::get(Context)); + Type *params[] = { + TypeBuilder::get(Context), + TypeBuilder::get(Context), + TypeBuilder::get(Context), + TypeBuilder::get(Context), + TypeBuilder::get(Context), + }; return FunctionType::get(TypeBuilder::get(Context), params, false); } @@ -330,9 +329,9 @@ template class TypeBuilder { public: static FunctionType *get(LLVMContext &Context) { - std::vector params; - params.reserve(1); - params.push_back(TypeBuilder::get(Context)); + Type *params[] = { + TypeBuilder::get(Context), + }; return FunctionType::get(TypeBuilder::get(Context), params, true); } }; @@ -340,10 +339,10 @@ template class TypeBuilder { public: static FunctionType *get(LLVMContext &Context) { - std::vector params; - params.reserve(2); - params.push_back(TypeBuilder::get(Context)); - params.push_back(TypeBuilder::get(Context)); + Type *params[] = { + TypeBuilder::get(Context), + TypeBuilder::get(Context), + }; return FunctionType::get(TypeBuilder::get(Context), params, true); } @@ -352,11 +351,11 @@ template class TypeBuilder { public: static FunctionType *get(LLVMContext &Context) { - std::vector params; - params.reserve(3); - params.push_back(TypeBuilder::get(Context)); - params.push_back(TypeBuilder::get(Context)); - params.push_back(TypeBuilder::get(Context)); + Type *params[] = { + TypeBuilder::get(Context), + TypeBuilder::get(Context), + TypeBuilder::get(Context), + }; return FunctionType::get(TypeBuilder::get(Context), params, true); } @@ -367,12 +366,12 @@ template { public: static FunctionType *get(LLVMContext &Context) { - std::vector params; - params.reserve(4); - params.push_back(TypeBuilder::get(Context)); - params.push_back(TypeBuilder::get(Context)); - params.push_back(TypeBuilder::get(Context)); - params.push_back(TypeBuilder::get(Context)); + Type *params[] = { + TypeBuilder::get(Context), + TypeBuilder::get(Context), + TypeBuilder::get(Context), + TypeBuilder::get(Context), + }; return FunctionType::get(TypeBuilder::get(Context), params, true); } @@ -383,13 +382,13 @@ template { public: static FunctionType *get(LLVMContext &Context) { - std::vector params; - params.reserve(5); - params.push_back(TypeBuilder::get(Context)); - params.push_back(TypeBuilder::get(Context)); - params.push_back(TypeBuilder::get(Context)); - params.push_back(TypeBuilder::get(Context)); - params.push_back(TypeBuilder::get(Context)); + Type *params[] = { + TypeBuilder::get(Context), + TypeBuilder::get(Context), + TypeBuilder::get(Context), + TypeBuilder::get(Context), + TypeBuilder::get(Context), + }; return FunctionType::get(TypeBuilder::get(Context), params, true); }