summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-06-16 21:37:15 +0000
committerChris Lattner <sabre@nondot.org>2011-06-16 21:37:15 +0000
commit9f7c0657d25d60b9da8aafdf8b23159453a7dfb0 (patch)
treeefdace498847cea2143447eb1d7a9d90f7f40c46 /llvm
parent701fb36b95157b4e65b3cad1724f157ed081ef14 (diff)
downloadbcm5719-llvm-9f7c0657d25d60b9da8aafdf8b23159453a7dfb0.tar.gz
bcm5719-llvm-9f7c0657d25d60b9da8aafdf8b23159453a7dfb0.zip
change Type.h to forward declare ArrayRef instead of #including it.
llvm-svn: 133197
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/DerivedTypes.h14
-rw-r--r--llvm/lib/VMCore/Type.cpp10
2 files changed, 14 insertions, 10 deletions
diff --git a/llvm/include/llvm/DerivedTypes.h b/llvm/include/llvm/DerivedTypes.h
index 25b5978914e..9e79339f4a2 100644
--- a/llvm/include/llvm/DerivedTypes.h
+++ b/llvm/include/llvm/DerivedTypes.h
@@ -19,7 +19,6 @@
#define LLVM_DERIVED_TYPES_H
#include "llvm/Type.h"
-#include "llvm/ADT/ArrayRef.h"
#include "llvm/Support/DataTypes.h"
namespace llvm {
@@ -34,6 +33,7 @@ class VectorValType;
class IntegerValType;
class APInt;
class LLVMContext;
+template<typename T> class ArrayRef;
class DerivedType : public Type {
friend class Type;
@@ -158,10 +158,8 @@ public:
/// FunctionType::get - Create a FunctionType taking no parameters.
///
- static FunctionType *get(const Type *Result, bool isVarArg) {
- return get(Result, ArrayRef<const Type *>(), isVarArg);
- }
-
+ static FunctionType *get(const Type *Result, bool isVarArg);
+
/// isValidReturnType - Return true if the specified type is valid as a return
/// type.
static bool isValidReturnType(const Type *RetTy);
@@ -239,10 +237,8 @@ public:
/// StructType::get - Create an empty structure type.
///
- static StructType *get(LLVMContext &Context, bool isPacked=false) {
- return get(Context, llvm::ArrayRef<const Type*>(), isPacked);
- }
-
+ static StructType *get(LLVMContext &Context, bool isPacked=false);
+
/// 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/llvm/lib/VMCore/Type.cpp b/llvm/lib/VMCore/Type.cpp
index 5188e5f0f83..566bb28c4a4 100644
--- a/llvm/lib/VMCore/Type.cpp
+++ b/llvm/lib/VMCore/Type.cpp
@@ -832,6 +832,9 @@ FunctionValType FunctionValType::get(const FunctionType *FT) {
return FunctionValType(FT->getReturnType(), ParamTypes, FT->isVarArg());
}
+FunctionType *FunctionType::get(const Type *Result, bool isVarArg) {
+ return get(Result, ArrayRef<const Type *>(), isVarArg);
+}
// FunctionType::get - The factory function for the FunctionType class...
FunctionType *FunctionType::get(const Type *ReturnType,
@@ -908,9 +911,14 @@ bool VectorType::isValidElementType(const Type *ElemTy) {
}
//===----------------------------------------------------------------------===//
-// Struct Type Factory...
+// Struct Type Factory.
//
+StructType *StructType::get(LLVMContext &Context, bool isPacked) {
+ return get(Context, llvm::ArrayRef<const Type*>(), isPacked);
+}
+
+
StructType *StructType::get(LLVMContext &Context,
ArrayRef<const Type*> ETypes,
bool isPacked) {
OpenPOWER on IntegriCloud