<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><br></div>Thanks Chad, I will update the testing case.<div><br></div><div>Manman</div><div><br><div><div>On Jul 3, 2013, at 9:55 AM, Chad Rosier <<a href="mailto:mcrosier@apple.com">mcrosier@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Manman,<br>Inline comments below.<br><br>On Jul 2, 2013, at 4:15 PM, Manman Ren <<a href="mailto:mren@apple.com">mren@apple.com</a>> wrote:<br><br><blockquote type="cite">Author: mren<br>Date: Tue Jul  2 18:15:25 2013<br>New Revision: 185483<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=185483&view=rev">http://llvm.org/viewvc/llvm-project?rev=185483&view=rev</a><br>Log:<br>Debug Info: set default to gdwarf-2 for Darwin.<br><br>Darwin systems currently do not support dwarf version 3 or above. When we are<br>ready, we can bump the default to gdwarf-4 for Darwin.<br><br>For other systems, the default is dwarf version 3, if everything goes smoothly,<br>we can bump the version to 4.<br><br><a href="rdar://13591116">rdar://13591116</a><br><br>Modified:<br>  cfe/trunk/lib/Driver/Tools.cpp<br>  cfe/trunk/test/CodeGen/dwarf-version.c<br>  cfe/trunk/test/Driver/clang-g-opts.c<br>  cfe/trunk/test/Driver/debug-options.c<br><br>Modified: cfe/trunk/lib/Driver/Tools.cpp<br>URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=185483&r1=185482&r2=185483&view=diff<br>==============================================================================<br>--- cfe/trunk/lib/Driver/Tools.cpp (original)<br>+++ cfe/trunk/lib/Driver/Tools.cpp Tue Jul  2 18:15:25 2013<br>@@ -2521,8 +2521,13 @@ void Clang::ConstructJob(Compilation &C,<br>   else if (A->getOption().matches(options::OPT_gdwarf_4))<br>     CmdArgs.push_back("-gdwarf-4");<br>   else if (!A->getOption().matches(options::OPT_g0) &&<br>-             !A->getOption().matches(options::OPT_ggdb0))<br>-      CmdArgs.push_back("-g");<br>+             !A->getOption().matches(options::OPT_ggdb0)) {<br>+      // Default is dwarf-2 for darwin.<br>+      if (getToolChain().getTriple().isOSDarwin())<br>+        CmdArgs.push_back("-gdwarf-2");<br>+      else<br>+        CmdArgs.push_back("-g");<br>+    }<br> }<br><br> // We ignore flags -gstrict-dwarf and -grecord-gcc-switches for now.<br><br>Modified: cfe/trunk/test/CodeGen/dwarf-version.c<br>URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/dwarf-version.c?rev=185483&r1=185482&r2=185483&view=diff<br>==============================================================================<br>--- cfe/trunk/test/CodeGen/dwarf-version.c (original)<br>+++ cfe/trunk/test/CodeGen/dwarf-version.c Tue Jul  2 18:15:25 2013<br>@@ -1,6 +1,8 @@<br>// RUN: %clang -target x86_64-linux-gnu -gdwarf-2 -S -emit-llvm -o - %s | FileCheck %s<br>// RUN: %clang -target x86_64-linux-gnu -gdwarf-3 -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER3<br>// RUN: %clang -target x86_64-linux-gnu -gdwarf-4 -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER4<br>+// RUN: %clang -target x86_64-linux-gnu -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=LINUX<br>+// RUN: %clang -target x86_64-apple-darwin -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=DARWIN<br>int main (void) {<br> return 0;<br>}<br>@@ -8,3 +10,5 @@ int main (void) {<br>// CHECK: metadata !{i32 2, metadata !"Dwarf Version", i32 2}<br>// VER3: metadata !{i32 2, metadata !"Dwarf Version", i32 3}<br>// VER4: metadata !{i32 2, metadata !"Dwarf Version", i32 4}<br>+// LINUX: metadata !{i32 2, metadata !"Dwarf Version", i32 3}<br>+// DARWIN: metadata !{i32 2, metadata !"Dwarf Version", i32 2}<br><br>Modified: cfe/trunk/test/Driver/clang-g-opts.c<br>URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/clang-g-opts.c?rev=185483&r1=185482&r2=185483&view=diff<br>==============================================================================<br>--- cfe/trunk/test/Driver/clang-g-opts.c (original)<br>+++ cfe/trunk/test/Driver/clang-g-opts.c Tue Jul  2 18:15:25 2013<br>@@ -5,5 +5,6 @@<br>// RUN: %clang -### -S %s -g0 -g 2>&1 | FileCheck --check-prefix=CHECK-WITH-G    %s<br><br>// CHECK-WITHOUT-G-NOT: "-g"<br>-// CHECK-WITH-G: "-g"<br>+// Can be -gdwarf.<br>+// CHECK-WITH-G: "-g<br></blockquote><br>You should be able to better express this with a regular expression.  Something like {{"-g"|"-gdwarf"}}.  You'll need to verify the RE syntax yourself.<br><br>Alternatively, (and perhaps the better choice) you could have two checks, one for Darwin and the other for non-Darwin.<br><br><blockquote type="cite"><br>Modified: cfe/trunk/test/Driver/debug-options.c<br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/debug-options.c?rev=185483&r1=185482&r2=185483&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/debug-options.c?rev=185483&r1=185482&r2=185483&view=diff</a><br>==============================================================================<br>--- cfe/trunk/test/Driver/debug-options.c (original)<br>+++ cfe/trunk/test/Driver/debug-options.c Tue Jul  2 18:15:25 2013<br>@@ -26,7 +26,8 @@<br>// RUN:        | FileCheck -check-prefix=GIGNORE %s<br>//<br>// G: "-cc1"<br>-// G: "-g"<br>+// Can be -gdwarf.<br>+// G: "-g<br></blockquote><br>Ditto.<br><br><blockquote type="cite">//<span class="Apple-converted-space"> </span><br>// G_D2: "-cc1"<br>// G_D2: "-gdwarf-2"<br>@@ -41,7 +42,7 @@<br>//<br>// G_ONLY: "-cc1"<br>// G_ONLY-NOT: "-gline-tables-only"<br>-// G_ONLY: "-g"<br>+// G_ONLY: "-g<br></blockquote><br>Again.<br><br><blockquote type="cite">// G_ONLY-NOT: "-gline-tables-only"<br>//<br>// GLTO_NO: "-cc1"<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">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a></blockquote></div></blockquote></div><br></div></body></html>