]> granicus.if.org Git - clang/commitdiff
PR14569: Omit debug info for thunks
authorDavid Blaikie <dblaikie@gmail.com>
Tue, 27 Aug 2013 05:21:11 +0000 (05:21 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Tue, 27 Aug 2013 05:21:11 +0000 (05:21 +0000)
This was added in r166676 based on PR13942 on the basis that tools may
need debug information for any executable code/function for some fairly
broad/non-specific purposes. It seems to me (as noted in PR14569) that
the major/only purpose is in backtraces, which should generally not
apply to thunks as they won't appear in the stack themselves. By
removing them we fix PR14569 and reduce the size of Clang's debug info.

Strangely enough this doesn't seem to have a substantial impact on
Clang's self-hosted debug info (at least looking at DWO file size) size
at all. Not sure if I failed to test this correctly but I only observed
a 0.004% change in DWO file size over Clang+LLVM.

With thanks to Dinesh Dwivedi for work on this PR.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189320 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGVTables.cpp
test/CodeGenCXX/debug-info-thunk.cpp

index 26ebf913a9b684c8f7a3e1b7512e07ec268f7721..6eb3e89d27332bb107d9fdbcce235e38064f6dcf 100644 (file)
@@ -292,6 +292,7 @@ void CodeGenFunction::GenerateVarArgsThunk(
 void CodeGenFunction::GenerateThunk(llvm::Function *Fn,
                                     const CGFunctionInfo &FnInfo,
                                     GlobalDecl GD, const ThunkInfo &Thunk) {
+  DebugInfo = NULL; // debug info for thunks is not required or desired
   const CXXMethodDecl *MD = cast<CXXMethodDecl>(GD.getDecl());
   const FunctionProtoType *FPT = MD->getType()->getAs<FunctionProtoType>();
   QualType ThisType = MD->getThisType(getContext());
index 394ebd829188d5e2f84bd8fdd2e8d67c26628b18..b2bb5a9e39f7a1669d098f7f8ec1a07b0e65cf78 100644 (file)
@@ -14,4 +14,4 @@ struct C : A, B {
 
 void C::f() { }
 
-// CHECK: [ DW_TAG_subprogram ] [line 15] [def] [_ZThn{{4|8}}_N1C1fEv]
+// CHECK-NOT: [ DW_TAG_subprogram ] [line 15] [def] [_ZThn{{4|8}}_N1C1fEv]