summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenTypes.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-06-29 22:39:04 +0000
committerChris Lattner <sabre@nondot.org>2010-06-29 22:39:04 +0000
commitf1d5d8a7f217119063232f72f74cdba4bebbd714 (patch)
treeabf445a8f551e15603fb54bbaef27cb3e1db6056 /lib/CodeGen/CodeGenTypes.cpp
parentd7f7d0895dc43db20c43112a24684f11eed305de (diff)
downloadclang-f1d5d8a7f217119063232f72f74cdba4bebbd714.tar.gz
clang-f1d5d8a7f217119063232f72f74cdba4bebbd714.tar.bz2
clang-f1d5d8a7f217119063232f72f74cdba4bebbd714.tar.xz
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
Diffstat (limited to 'lib/CodeGen/CodeGenTypes.cpp')
-rw-r--r--lib/CodeGen/CodeGenTypes.cpp11
1 files changed, 8 insertions, 3 deletions
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: