r189320 - PR14569: Omit debug info for thunks

David Blaikie dblaikie at gmail.com
Mon Aug 26 22:21:11 PDT 2013


Author: dblaikie
Date: Tue Aug 27 00:21:11 2013
New Revision: 189320

URL: http://llvm.org/viewvc/llvm-project?rev=189320&view=rev
Log:
PR14569: Omit debug info for thunks

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.

Modified:
    cfe/trunk/lib/CodeGen/CGVTables.cpp
    cfe/trunk/test/CodeGenCXX/debug-info-thunk.cpp

Modified: cfe/trunk/lib/CodeGen/CGVTables.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGVTables.cpp?rev=189320&r1=189319&r2=189320&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGVTables.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGVTables.cpp Tue Aug 27 00:21:11 2013
@@ -292,6 +292,7 @@ void CodeGenFunction::GenerateVarArgsThu
 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());

Modified: cfe/trunk/test/CodeGenCXX/debug-info-thunk.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-thunk.cpp?rev=189320&r1=189319&r2=189320&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/debug-info-thunk.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/debug-info-thunk.cpp Tue Aug 27 00:21:11 2013
@@ -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]





More information about the cfe-commits mailing list