aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2012-02-09 07:26:21 +0000
committerEric Christopher <echristo@apple.com>2012-02-09 07:26:21 +0000
commit3b8e197bbfd2c9a1a5fc3ab6509f89cc274e77f8 (patch)
treecfdf5ed519ada2b94a767d7aa8b5b4f70460f2b7 /lib/CodeGen/CGDebugInfo.cpp
parentf8c17b79ab55d633567a151da5eb596b6001fa30 (diff)
Don't cache the artificial type for the this pointer, there's no
difference in the qual type. This is a workaround for the fact that the type isn't artificial but the this decl is, however, we don't have any way of representing it in the current metadata. For now, however, just don't cache the full type. Fixes rdar://10831526 and probably a couple of others. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150159 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index 1392091e66..ab8f5fdbf6 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -829,15 +829,17 @@ CGDebugInfo::getOrCreateMethodType(const CXXMethodDecl *Method,
uint64_t Size = CGM.getContext().getTargetInfo().getPointerWidth(AS);
uint64_t Align = CGM.getContext().getTypeAlign(ThisPtrTy);
llvm::DIType PointeeType = getOrCreateType(PointeeTy, Unit);
- llvm::DIType ThisPtrType =
- DBuilder.createArtificialType
- (DBuilder.createPointerType(PointeeType, Size, Align));
+ llvm::DIType ThisPtrType = DBuilder.createPointerType(PointeeType, Size, Align);
TypeCache[ThisPtr.getAsOpaquePtr()] = ThisPtrType;
+ // TODO: This and the artificial type below are misleading, the
+ // types aren't artificial the argument is, but the current
+ // metadata doesn't represent that.
+ ThisPtrType = DBuilder.createArtificialType(ThisPtrType);
Elts.push_back(ThisPtrType);
} else {
- llvm::DIType ThisPtrType =
- DBuilder.createArtificialType(getOrCreateType(ThisPtr, Unit));
+ llvm::DIType ThisPtrType = getOrCreateType(ThisPtr, Unit);
TypeCache[ThisPtr.getAsOpaquePtr()] = ThisPtrType;
+ ThisPtrType = DBuilder.createArtificialType(ThisPtrType);
Elts.push_back(ThisPtrType);
}
}