<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Nov 22, 2013 at 12:07 PM, Manman Ren <span dir="ltr"><<a href="mailto:manman.ren@gmail.com" target="_blank">manman.ren@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote"><div class="im">On Fri, Nov 22, 2013 at 11:59 AM, Eric Christopher <span dir="ltr"><<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div>On Fri, Nov 22, 2013 at 11:42 AM, Manman Ren <<a href="mailto:manman.ren@gmail.com" target="_blank">manman.ren@gmail.com</a>> wrote:<br>


> Author: mren<br>
> Date: Fri Nov 22 13:42:45 2013<br>
> New Revision: 195495<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=195495&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=195495&view=rev</a><br>
> Log:<br>
> Debug Info: add a "Debug Info Version" module flag to output the current debug<br>
> info version number.<br>
><br>
> Will error out when modules have different version numbers.<br>
><br>
<br>
</div>I don't think the commit message or comment are correct. We're going<br>
to strip debug info at module merge time if they have different<br>
versions, not error out at merge time.<br></blockquote><div><br></div></div><div>The commit message and the comment is for what is implemented in the patch. The module flag will be used to strip debug info later on.</div>
<div>
And I plan to talk about stripping debug info when the patch that actually strips debug info is committed.</div><div>The comment tries to explain why we choose the error mode and what will happen if the linker sees different versions. </div>

<div><br></div><div>Should we talk about how the module flag will be used when adding the module flag in the source code?</div><div>Maybe if we want to be verbose.</div></div></div></div></blockquote><div><br></div><div>
It's not uncommon to do that - providing a comment about where this work fits in the grand scheme of things either in the source or the commit message, or both.<br><br>- David</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="HOEnZb"><font color="#888888"><div><br></div><div>Manman</div></font></span><div><div class="h5"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">


<span><font color="#888888"><br>
-eric<br>
</font></span><div><div><br>
> Added:<br>
>     cfe/trunk/test/CodeGen/debug-info-version.c<br>
> Modified:<br>
>     cfe/trunk/lib/CodeGen/CodeGenModule.cpp<br>
><br>
> Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=195495&r1=195494&r2=195495&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=195495&r1=195494&r2=195495&view=diff</a><br>


> ==============================================================================<br>
> --- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)<br>
> +++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Fri Nov 22 13:42:45 2013<br>
> @@ -258,6 +258,11 @@ void CodeGenModule::Release() {<br>
>      // We can change from Warning to Latest if such mode is supported.<br>
>      getModule().addModuleFlag(llvm::Module::Warning, "Dwarf Version",<br>
>                                CodeGenOpts.DwarfVersion);<br>
> +  if (DebugInfo)<br>
> +    // We support a single version in the linked module: error out when<br>
> +    // modules do not have the same version.<br>
> +    getModule().addModuleFlag(llvm::Module::Error, "Debug Info Version",<br>
> +                              llvm::dwarf::DEBUG_INFO_VERSION);<br>
><br>
>    SimplifyPersonality();<br>
><br>
><br>
> Added: cfe/trunk/test/CodeGen/debug-info-version.c<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/debug-info-version.c?rev=195495&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/debug-info-version.c?rev=195495&view=auto</a><br>


> ==============================================================================<br>
> --- cfe/trunk/test/CodeGen/debug-info-version.c (added)<br>
> +++ cfe/trunk/test/CodeGen/debug-info-version.c Fri Nov 22 13:42:45 2013<br>
> @@ -0,0 +1,8 @@<br>
> +// RUN: %clang -g -S -emit-llvm -o - %s | FileCheck %s<br>
> +// RUN: %clang -S -emit-llvm -o - %s | FileCheck %s --check-prefix=NO_DEBUG<br>
> +int main (void) {<br>
> +  return 0;<br>
> +}<br>
> +<br>
> +// CHECK: metadata !{i32 1, metadata !"Debug Info Version", i32 1}<br>
> +// NO_DEBUG-NOT: metadata !"Debug Info Version"<br>
><br>
><br>
> _______________________________________________<br>
> cfe-commits mailing list<br>
> <a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">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>
</div></div></blockquote></div></div></div><br></div></div>
<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>
<br></blockquote></div><br></div></div>