diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-06-30 00:22:35 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-06-30 00:22:35 +0000 |
commit | 7bbe03d8ae0772d89f6539d073dd43e49268a42c (patch) | |
tree | 0ed96be92a9eb82609592aecb62ec5d46cd064ab /lib/CodeGen/CodeGenTypes.cpp | |
parent | a9e05156438dc3f0ef1067ffce80037d9333e022 (diff) |
Revert r107173, "fix PR7519: after thrashing around and remembering how all this stuff", it broke bootstrap.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107232 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenTypes.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenTypes.cpp | 37 |
1 files changed, 12 insertions, 25 deletions
diff --git a/lib/CodeGen/CodeGenTypes.cpp b/lib/CodeGen/CodeGenTypes.cpp index 6ff394e03c..cf23c07394 100644 --- a/lib/CodeGen/CodeGenTypes.cpp +++ b/lib/CodeGen/CodeGenTypes.cpp @@ -46,7 +46,7 @@ CodeGenTypes::~CodeGenTypes() { const llvm::Type *CodeGenTypes::ConvertType(QualType T) { llvm::PATypeHolder Result = ConvertTypeRecursive(T); - // Any pointers that were converted deferred evaluation of their pointee type, + // Any pointers that were converted defered evaluation of their pointee type, // creating an opaque type instead. This is in order to avoid problems with // circular types. Loop through all these defered pointees, if any, and // resolve them now. @@ -284,8 +284,7 @@ const llvm::Type *CodeGenTypes::ConvertNewType(QualType T) { assert(A.getIndexTypeCVRQualifiers() == 0 && "FIXME: We only handle trivial array types so far!"); // int X[] -> [0 x int] - return llvm::ArrayType::get(ConvertTypeForMemRecursive(A.getElementType()), - 0); + return llvm::ArrayType::get(ConvertTypeForMemRecursive(A.getElementType()), 0); } case Type::ConstantArray: { const ConstantArrayType &A = cast<ConstantArrayType>(Ty); @@ -300,11 +299,7 @@ const llvm::Type *CodeGenTypes::ConvertNewType(QualType T) { } case Type::FunctionNoProto: case Type::FunctionProto: { - // First, check whether we can build the full function type. If the - // function type depends on an incomplete type (e.g. a struct or enum), we - // cannot lower the function type. Instead, turn it into an Opaque pointer - // and have UpdateCompletedType revisit the function type when/if the opaque - // argument type is defined. + // First, check whether we can build the full function type. if (const TagType *TT = VerifyFuncTypeComplete(&Ty)) { // This function's type depends on an incomplete tag type; make sure // we have an opaque type corresponding to the tag type. @@ -314,25 +309,17 @@ const llvm::Type *CodeGenTypes::ConvertNewType(QualType T) { FunctionTypes.insert(std::make_pair(&Ty, ResultType)); return ResultType; } - // The function type can be built; call the appropriate routines to // build it. - const CGFunctionInfo *FI; - bool isVariadic; - if (const FunctionProtoType *FPT = dyn_cast<FunctionProtoType>(&Ty)) { - FI = &getFunctionInfo( - CanQual<FunctionProtoType>::CreateUnsafe(QualType(FPT, 0)), - true /*Recursive*/); - isVariadic = FPT->isVariadic(); - } else { - const FunctionNoProtoType *FNPT = cast<FunctionNoProtoType>(&Ty); - FI = &getFunctionInfo( - CanQual<FunctionNoProtoType>::CreateUnsafe(QualType(FNPT, 0)), - true /*Recursive*/); - isVariadic = true; - } - - return GetFunctionType(*FI, isVariadic); + if (const FunctionProtoType *FPT = dyn_cast<FunctionProtoType>(&Ty)) + return GetFunctionType(getFunctionInfo( + CanQual<FunctionProtoType>::CreateUnsafe(QualType(FPT,0))), + FPT->isVariadic()); + + const FunctionNoProtoType *FNPT = cast<FunctionNoProtoType>(&Ty); + return GetFunctionType(getFunctionInfo( + CanQual<FunctionNoProtoType>::CreateUnsafe(QualType(FNPT,0))), + true); } case Type::ObjCObject: |