<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote">On Tue, Aug 27, 2013 at 9:21 AM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: dblaikie<br>
Date: Tue Aug 27 00:21:11 2013<br>
New Revision: 189320<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=189320&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=189320&view=rev</a><br>
Log:<br>
PR14569: Omit debug info for thunks<br>
<br>
This was added in r166676 based on PR13942 on the basis that tools may<br>
need debug information for any executable code/function for some fairly<br>
broad/non-specific purposes. It seems to me (as noted in PR14569) that<br>
the major/only purpose is in backtraces, which should generally not<br>
apply to thunks as they won't appear in the stack themselves.</blockquote><div><br></div><div>Are you sure that thunks may not appear in backtraces? I think I saw them in stack traces,</div><div>more specifically - in stack traces produced by ThreadSanitizer.</div>
<div>It's possible that I'm wrong, though...</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">By<br>
removing them we fix PR14569 and reduce the size of Clang's debug info.<br>
<br>
Strangely enough this doesn't seem to have a substantial impact on<br>
Clang's self-hosted debug info (at least looking at DWO file size) size<br>
at all. Not sure if I failed to test this correctly but I only observed<br>
a 0.004% change in DWO file size over Clang+LLVM.<br>
<br>
With thanks to Dinesh Dwivedi for work on this PR.<br>
<br>
Modified:<br>
    cfe/trunk/lib/CodeGen/CGVTables.cpp<br>
    cfe/trunk/test/CodeGenCXX/debug-info-thunk.cpp<br>
<br>
Modified: cfe/trunk/lib/CodeGen/CGVTables.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGVTables.cpp?rev=189320&r1=189319&r2=189320&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGVTables.cpp?rev=189320&r1=189319&r2=189320&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/lib/CodeGen/CGVTables.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/CGVTables.cpp Tue Aug 27 00:21:11 2013<br>
@@ -292,6 +292,7 @@ void CodeGenFunction::GenerateVarArgsThu<br>
 void CodeGenFunction::GenerateThunk(llvm::Function *Fn,<br>
                                     const CGFunctionInfo &FnInfo,<br>
                                     GlobalDecl GD, const ThunkInfo &Thunk) {<br>
+  DebugInfo = NULL; // debug info for thunks is not required or desired<br>
   const CXXMethodDecl *MD = cast<CXXMethodDecl>(GD.getDecl());<br>
   const FunctionProtoType *FPT = MD->getType()->getAs<FunctionProtoType>();<br>
   QualType ThisType = MD->getThisType(getContext());<br>
<br>
Modified: cfe/trunk/test/CodeGenCXX/debug-info-thunk.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-thunk.cpp?rev=189320&r1=189319&r2=189320&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-thunk.cpp?rev=189320&r1=189319&r2=189320&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/test/CodeGenCXX/debug-info-thunk.cpp (original)<br>
+++ cfe/trunk/test/CodeGenCXX/debug-info-thunk.cpp Tue Aug 27 00:21:11 2013<br>
@@ -14,4 +14,4 @@ struct C : A, B {<br>
<br>
 void C::f() { }<br>
<br>
-// CHECK: [ DW_TAG_subprogram ] [line 15] [def] [_ZThn{{4|8}}_N1C1fEv]<br>
+// CHECK-NOT: [ DW_TAG_subprogram ] [line 15] [def] [_ZThn{{4|8}}_N1C1fEv]<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Alexey Samsonov, MSK</div>
</div></div>