diff options
author | Devang Patel <dpatel@apple.com> | 2011-05-31 20:46:46 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2011-05-31 20:46:46 +0000 |
commit | 1c29652fbcd097aa6c21511c9f4f886bb3f3a8af (patch) | |
tree | 13058e6b7d82c35903064b2a30eadf99fb25dbf7 /lib/CodeGen/CGDebugInfo.cpp | |
parent | eea06c609b73afc7bcfdf3e101efb8d9e7b3560c (diff) |
List c++ class type as public type in dwarf debug info output.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132357 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | lib/CodeGen/CGDebugInfo.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 6c73865c3c..d1b4aad7fa 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -1621,6 +1621,16 @@ llvm::DISubprogram CGDebugInfo::getFunctionDeclaration(const Decl *D) { return llvm::DISubprogram(); } +// getOrCreateFunctionType - Construct DIType. If it is a c++ method, include +// implicit parameter "this". +llvm::DIType CGDebugInfo::getOrCreateFunctionType(const Decl * D, QualType FnType, + llvm::DIFile F) { + if (const CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(D)) + return getOrCreateMethodType(Method, F); + + return getOrCreateType(FnType, F); +} + /// EmitFunctionStart - Constructs the debug code for entering a function - /// "llvm.dbg.func.start.". void CGDebugInfo::EmitFunctionStart(GlobalDecl GD, QualType FnType, @@ -1685,11 +1695,10 @@ void CGDebugInfo::EmitFunctionStart(GlobalDecl GD, QualType FnType, unsigned LineNo = getLineNumber(CurLoc); if (D->isImplicit()) Flags |= llvm::DIDescriptor::FlagArtificial; - llvm::DIType SPTy = getOrCreateType(FnType, Unit); llvm::DISubprogram SPDecl = getFunctionDeclaration(D); llvm::DISubprogram SP = DBuilder.createFunction(FDContext, Name, LinkageName, Unit, - LineNo, SPTy, + LineNo, getOrCreateFunctionType(D, FnType, Unit), Fn->hasInternalLinkage(), true/*definition*/, Flags, CGM.getLangOptions().Optimize, Fn, TParamsArray, SPDecl); |