aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-09-03 14:44:53 +0000
committerChris Lattner <sabre@nondot.org>2003-09-03 14:44:53 +0000
commita3ad5b21e89d7600cd70b669c8197375e6dcbd8b (patch)
tree163a96094346da5ae3f36512e693923337ce3974
parent43c2eb7def100ee9b3ea5b0603a86d0cef2239ce (diff)
No need to rescan types when they are created.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8339 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/VMCore/Type.cpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp
index 57c6e636ae..d52986df57 100644
--- a/lib/VMCore/Type.cpp
+++ b/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) {