diff options
| author | Chris Lattner <sabre@nondot.org> | 2003-09-03 14:44:53 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2003-09-03 14:44:53 +0000 |
| commit | b89d2afab16cece17959324e5b57af24942b6f68 (patch) | |
| tree | 048b4e0328a792167f8cb18362fe088d8230efd3 | |
| parent | 9231e48de8152d404699f445f5e37bfdae314bab (diff) | |
| download | bcm5719-llvm-b89d2afab16cece17959324e5b57af24942b6f68.tar.gz bcm5719-llvm-b89d2afab16cece17959324e5b57af24942b6f68.zip | |
No need to rescan types when they are created.
llvm-svn: 8339
| -rw-r--r-- | llvm/lib/VMCore/Type.cpp | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/llvm/lib/VMCore/Type.cpp b/llvm/lib/VMCore/Type.cpp index 57c6e636aec..d52986df57c 100644 --- a/llvm/lib/VMCore/Type.cpp +++ b/llvm/lib/VMCore/Type.cpp @@ -343,35 +343,42 @@ FunctionType::FunctionType(const Type *Result, bool IsVarArgs) : DerivedType(FunctionTyID), ResultType(PATypeHandle(Result, this)), isVarArgs(IsVarArgs) { + bool isAbstract = Result->isAbstract(); ParamTys.reserve(Params.size()); - for (unsigned i = 0; i < Params.size(); ++i) + for (unsigned i = 0; i < Params.size(); ++i) { ParamTys.push_back(PATypeHandle(Params[i], this)); + isAbstract |= Params[i]->isAbstract(); + } - setAbstract(true); - setDerivedTypeProperties(); + // Calculate whether or not this type is abstract + setAbstract(isAbstract); } StructType::StructType(const std::vector<const Type*> &Types) : CompositeType(StructTyID) { ETypes.reserve(Types.size()); + bool isAbstract = false; for (unsigned i = 0; i < Types.size(); ++i) { assert(Types[i] != Type::VoidTy && "Void type in method prototype!!"); ETypes.push_back(PATypeHandle(Types[i], this)); + isAbstract |= Types[i]->isAbstract(); } - setAbstract(true); - setDerivedTypeProperties(); + + // Calculate whether or not this type is abstract + setAbstract(isAbstract); } ArrayType::ArrayType(const Type *ElType, unsigned NumEl) : SequentialType(ArrayTyID, ElType) { NumElements = NumEl; - setAbstract(true); - setDerivedTypeProperties(); + + // Calculate whether or not this type is abstract + setAbstract(ElType->isAbstract()); } PointerType::PointerType(const Type *E) : SequentialType(PointerTyID, E) { - setAbstract(true); - setDerivedTypeProperties(); + // Calculate whether or not this type is abstract + setAbstract(E->isAbstract()); } OpaqueType::OpaqueType() : DerivedType(OpaqueTyID) { |

