From f1d5d8a7f217119063232f72f74cdba4bebbd714 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 29 Jun 2010 22:39:04 +0000 Subject: fix PR7523, which was caused by the ABI code calling ConvertType instead of ConvertTypeRecursive when it needed to in a few cases, causing pointer types to get resolved at the wrong time. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107216 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenTypes.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'lib/CodeGen/CodeGenTypes.cpp') diff --git a/lib/CodeGen/CodeGenTypes.cpp b/lib/CodeGen/CodeGenTypes.cpp index 6ff394e03c..5c474d557a 100644 --- a/lib/CodeGen/CodeGenTypes.cpp +++ b/lib/CodeGen/CodeGenTypes.cpp @@ -43,9 +43,14 @@ CodeGenTypes::~CodeGenTypes() { } /// ConvertType - Convert the specified type to its LLVM form. -const llvm::Type *CodeGenTypes::ConvertType(QualType T) { - llvm::PATypeHolder Result = ConvertTypeRecursive(T); +const llvm::Type *CodeGenTypes::ConvertType(QualType T, bool IsRecursive) { + const llvm::Type *RawResult = ConvertTypeRecursive(T); + + if (IsRecursive || PointersToResolve.empty()) + return RawResult; + llvm::PATypeHolder Result = RawResult; + // Any pointers that were converted deferred 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 @@ -332,7 +337,7 @@ const llvm::Type *CodeGenTypes::ConvertNewType(QualType T) { isVariadic = true; } - return GetFunctionType(*FI, isVariadic); + return GetFunctionType(*FI, isVariadic, true); } case Type::ObjCObject: -- cgit v1.2.3