diff options
author | Devang Patel <dpatel@apple.com> | 2011-10-28 21:12:13 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2011-10-28 21:12:13 +0000 |
commit | fa59ac363ef4747fdb142d993326c43d832629bb (patch) | |
tree | 85088f7be9421305b1753c8690b490e22a36a618 /clang/lib/CodeGen/CGDebugInfo.cpp | |
parent | d4436412913ba2a00ae2772402cd03c3028fef21 (diff) | |
download | bcm5719-llvm-fa59ac363ef4747fdb142d993326c43d832629bb.tar.gz bcm5719-llvm-fa59ac363ef4747fdb142d993326c43d832629bb.zip |
In case of template specialization, do not try to delay emitting debug info for concrete type in -flimit-debug-info mode. This fixes some of the failures from bs15503.exp tests in gdb testsuite.
llvm-svn: 143227
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 4448153591f..b7107d5883a 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -745,11 +745,27 @@ CGDebugInfo::getOrCreateMethodType(const CXXMethodDecl *Method, if (!Method->isStatic()) { // "this" pointer is always first argument. QualType ThisPtr = Method->getThisType(CGM.getContext()); - llvm::DIType ThisPtrType = - DBuilder.createArtificialType(getOrCreateType(ThisPtr, Unit)); - - TypeCache[ThisPtr.getAsOpaquePtr()] = ThisPtrType; - Elts.push_back(ThisPtrType); + + const CXXRecordDecl *RD = Method->getParent(); + if (isa<ClassTemplateSpecializationDecl>(RD)) { + // Create pointer type directly in this case. + const PointerType *ThisPtrTy = cast<PointerType>(ThisPtr); + QualType PointeeTy = ThisPtrTy->getPointeeType(); + unsigned AS = CGM.getContext().getTargetAddressSpace(PointeeTy); + 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)); + TypeCache[ThisPtr.getAsOpaquePtr()] = ThisPtrType; + Elts.push_back(ThisPtrType); + } else { + llvm::DIType ThisPtrType = + DBuilder.createArtificialType(getOrCreateType(ThisPtr, Unit)); + TypeCache[ThisPtr.getAsOpaquePtr()] = ThisPtrType; + Elts.push_back(ThisPtrType); + } } // Copy rest of the arguments. |