[llvm-commits] [llvm] r135906 - /llvm/trunk/include/llvm/Support/TypeBuilder.h
Jay Foad
jay.foad at gmail.com
Mon Jul 25 03:32:27 PDT 2011
Author: foad
Date: Mon Jul 25 05:32:27 2011
New Revision: 135906
URL: http://llvm.org/viewvc/llvm-project?rev=135906&view=rev
Log:
Remove uses of std::vector from TypeBuilder.
Modified:
llvm/trunk/include/llvm/Support/TypeBuilder.h
Modified: llvm/trunk/include/llvm/Support/TypeBuilder.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/TypeBuilder.h?rev=135906&r1=135905&r2=135906&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/TypeBuilder.h (original)
+++ llvm/trunk/include/llvm/Support/TypeBuilder.h Mon Jul 25 05:32:27 2011
@@ -18,7 +18,6 @@
#include "llvm/DerivedTypes.h"
#include "llvm/LLVMContext.h"
#include <limits.h>
-#include <vector>
namespace llvm {
@@ -254,9 +253,9 @@
template<typename R, typename A1, bool cross> class TypeBuilder<R(A1), cross> {
public:
static FunctionType *get(LLVMContext &Context) {
- std::vector<Type*> params;
- params.reserve(1);
- params.push_back(TypeBuilder<A1, cross>::get(Context));
+ Type *params[] = {
+ TypeBuilder<A1, cross>::get(Context),
+ };
return FunctionType::get(TypeBuilder<R, cross>::get(Context),
params, false);
}
@@ -265,10 +264,10 @@
class TypeBuilder<R(A1, A2), cross> {
public:
static FunctionType *get(LLVMContext &Context) {
- std::vector<Type*> params;
- params.reserve(2);
- params.push_back(TypeBuilder<A1, cross>::get(Context));
- params.push_back(TypeBuilder<A2, cross>::get(Context));
+ Type *params[] = {
+ TypeBuilder<A1, cross>::get(Context),
+ TypeBuilder<A2, cross>::get(Context),
+ };
return FunctionType::get(TypeBuilder<R, cross>::get(Context),
params, false);
}
@@ -277,11 +276,11 @@
class TypeBuilder<R(A1, A2, A3), cross> {
public:
static FunctionType *get(LLVMContext &Context) {
- std::vector<Type*> params;
- params.reserve(3);
- params.push_back(TypeBuilder<A1, cross>::get(Context));
- params.push_back(TypeBuilder<A2, cross>::get(Context));
- params.push_back(TypeBuilder<A3, cross>::get(Context));
+ Type *params[] = {
+ TypeBuilder<A1, cross>::get(Context),
+ TypeBuilder<A2, cross>::get(Context),
+ TypeBuilder<A3, cross>::get(Context),
+ };
return FunctionType::get(TypeBuilder<R, cross>::get(Context),
params, false);
}
@@ -292,12 +291,12 @@
class TypeBuilder<R(A1, A2, A3, A4), cross> {
public:
static FunctionType *get(LLVMContext &Context) {
- std::vector<Type*> params;
- params.reserve(4);
- params.push_back(TypeBuilder<A1, cross>::get(Context));
- params.push_back(TypeBuilder<A2, cross>::get(Context));
- params.push_back(TypeBuilder<A3, cross>::get(Context));
- params.push_back(TypeBuilder<A4, cross>::get(Context));
+ Type *params[] = {
+ TypeBuilder<A1, cross>::get(Context),
+ TypeBuilder<A2, cross>::get(Context),
+ TypeBuilder<A3, cross>::get(Context),
+ TypeBuilder<A4, cross>::get(Context),
+ };
return FunctionType::get(TypeBuilder<R, cross>::get(Context),
params, false);
}
@@ -308,13 +307,13 @@
class TypeBuilder<R(A1, A2, A3, A4, A5), cross> {
public:
static FunctionType *get(LLVMContext &Context) {
- std::vector<Type*> params;
- params.reserve(5);
- params.push_back(TypeBuilder<A1, cross>::get(Context));
- params.push_back(TypeBuilder<A2, cross>::get(Context));
- params.push_back(TypeBuilder<A3, cross>::get(Context));
- params.push_back(TypeBuilder<A4, cross>::get(Context));
- params.push_back(TypeBuilder<A5, cross>::get(Context));
+ Type *params[] = {
+ TypeBuilder<A1, cross>::get(Context),
+ TypeBuilder<A2, cross>::get(Context),
+ TypeBuilder<A3, cross>::get(Context),
+ TypeBuilder<A4, cross>::get(Context),
+ TypeBuilder<A5, cross>::get(Context),
+ };
return FunctionType::get(TypeBuilder<R, cross>::get(Context),
params, false);
}
@@ -330,9 +329,9 @@
class TypeBuilder<R(A1, ...), cross> {
public:
static FunctionType *get(LLVMContext &Context) {
- std::vector<Type*> params;
- params.reserve(1);
- params.push_back(TypeBuilder<A1, cross>::get(Context));
+ Type *params[] = {
+ TypeBuilder<A1, cross>::get(Context),
+ };
return FunctionType::get(TypeBuilder<R, cross>::get(Context), params, true);
}
};
@@ -340,10 +339,10 @@
class TypeBuilder<R(A1, A2, ...), cross> {
public:
static FunctionType *get(LLVMContext &Context) {
- std::vector<Type*> params;
- params.reserve(2);
- params.push_back(TypeBuilder<A1, cross>::get(Context));
- params.push_back(TypeBuilder<A2, cross>::get(Context));
+ Type *params[] = {
+ TypeBuilder<A1, cross>::get(Context),
+ TypeBuilder<A2, cross>::get(Context),
+ };
return FunctionType::get(TypeBuilder<R, cross>::get(Context),
params, true);
}
@@ -352,11 +351,11 @@
class TypeBuilder<R(A1, A2, A3, ...), cross> {
public:
static FunctionType *get(LLVMContext &Context) {
- std::vector<Type*> params;
- params.reserve(3);
- params.push_back(TypeBuilder<A1, cross>::get(Context));
- params.push_back(TypeBuilder<A2, cross>::get(Context));
- params.push_back(TypeBuilder<A3, cross>::get(Context));
+ Type *params[] = {
+ TypeBuilder<A1, cross>::get(Context),
+ TypeBuilder<A2, cross>::get(Context),
+ TypeBuilder<A3, cross>::get(Context),
+ };
return FunctionType::get(TypeBuilder<R, cross>::get(Context),
params, true);
}
@@ -367,12 +366,12 @@
class TypeBuilder<R(A1, A2, A3, A4, ...), cross> {
public:
static FunctionType *get(LLVMContext &Context) {
- std::vector<Type*> params;
- params.reserve(4);
- params.push_back(TypeBuilder<A1, cross>::get(Context));
- params.push_back(TypeBuilder<A2, cross>::get(Context));
- params.push_back(TypeBuilder<A3, cross>::get(Context));
- params.push_back(TypeBuilder<A4, cross>::get(Context));
+ Type *params[] = {
+ TypeBuilder<A1, cross>::get(Context),
+ TypeBuilder<A2, cross>::get(Context),
+ TypeBuilder<A3, cross>::get(Context),
+ TypeBuilder<A4, cross>::get(Context),
+ };
return FunctionType::get(TypeBuilder<R, cross>::get(Context),
params, true);
}
@@ -383,13 +382,13 @@
class TypeBuilder<R(A1, A2, A3, A4, A5, ...), cross> {
public:
static FunctionType *get(LLVMContext &Context) {
- std::vector<Type*> params;
- params.reserve(5);
- params.push_back(TypeBuilder<A1, cross>::get(Context));
- params.push_back(TypeBuilder<A2, cross>::get(Context));
- params.push_back(TypeBuilder<A3, cross>::get(Context));
- params.push_back(TypeBuilder<A4, cross>::get(Context));
- params.push_back(TypeBuilder<A5, cross>::get(Context));
+ Type *params[] = {
+ TypeBuilder<A1, cross>::get(Context),
+ TypeBuilder<A2, cross>::get(Context),
+ TypeBuilder<A3, cross>::get(Context),
+ TypeBuilder<A4, cross>::get(Context),
+ TypeBuilder<A5, cross>::get(Context),
+ };
return FunctionType::get(TypeBuilder<R, cross>::get(Context),
params, true);
}
More information about the llvm-commits
mailing list