<div dir="ltr">Turns out this doesn't actually work: -fdump-records-layout is a cc1 option, not a clang driver option. The correct td entry would be<div><br></div><div>def _SLASH_d1reportAllClassLayout : CLFlag<"d1reportAllClassLayout">,<br>  HelpText<"Dump record layout information">,<br>  Alias<Xclang>, AliasArgs<["-fdump-record-layouts"]>;<br></div><div><br></div><div>But if nobody ever noticed since this was added, maybe we should just remove it again? It doesn't seem like anyone ever used it. (Also, the current fdump-record-layouts output with ast layout, irgen layout, and cgrecordlayout looks very very wordy – I remember the output being more readable at some point.)</div><div><br></div><div><br></div><div>Why does the test pass if this doesn't work? Because clang prints "argument unused during compilation: '-fdump-record-layouts'" which happens to match the lit check line, which only asks for -fdump-record-layouts</div><div><br></div><div><br></div><div>I tried fixing the test, but it's surprisingly tricky: Adding `/c /WX` makes clang emit "error: argument unused..." instead of just "warning:", but -### apparently causes clang to not set $? even if it prints an error. And having a CHECK-NOT for "error:" seems pretty one-off-y. Maybe there should be some way to make -### still set `$?`? cl-options.c kind of looks like it expects -### to behave that way.</div><div><br></div><div>(I noticed because I'm trying to print unaliased options in diags, so the diag changed to "argument unused during compilation: /d1reportAllClassLayout", which made the test fail. I'm happy with any outcome that makes the d1reportAllClassLayout test behave – either removing the flag, or making it work and fixing the test to actually check what it's trying to check.)</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 27, 2017 at 7:32 PM Hans Wennborg via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Author: hans<br>
Date: Thu Apr 27 12:19:07 2017<br>
New Revision: 301567<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=301567&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=301567&view=rev</a><br>
Log:<br>
clang-cl: Alias /d1reportAllClassLayout to -fdump-record-layouts (PR32826)<br>
<br>
Modified:<br>
    cfe/trunk/include/clang/Driver/CLCompatOptions.td<br>
    cfe/trunk/test/Driver/cl-options.c<br>
<br>
Modified: cfe/trunk/include/clang/Driver/CLCompatOptions.td<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/CLCompatOptions.td?rev=301567&r1=301566&r2=301567&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/CLCompatOptions.td?rev=301567&r1=301566&r2=301567&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/Driver/CLCompatOptions.td (original)<br>
+++ cfe/trunk/include/clang/Driver/CLCompatOptions.td Thu Apr 27 12:19:07 2017<br>
@@ -61,6 +61,8 @@ def _SLASH_Brepro_ : CLFlag<"Brepro-">,<br>
 def _SLASH_C : CLFlag<"C">,<br>
   HelpText<"Don't discard comments when preprocessing">, Alias<C>;<br>
 def _SLASH_c : CLFlag<"c">, HelpText<"Compile only">, Alias<c>;<br>
+def _SLASH_d1reportAllClassLayout : CLFlag<"d1reportAllClassLayout">,<br>
+  HelpText<"Dump record layout information">, Alias<fdump_record_layouts>;<br>
 def _SLASH_D : CLJoinedOrSeparate<"D">, HelpText<"Define macro">,<br>
   MetaVarName<"<macro[=value]>">, Alias<D>;<br>
 def _SLASH_E : CLFlag<"E">, HelpText<"Preprocess to stdout">, Alias<E>;<br>
<br>
Modified: cfe/trunk/test/Driver/cl-options.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/cl-options.c?rev=301567&r1=301566&r2=301567&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/cl-options.c?rev=301567&r1=301566&r2=301567&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/Driver/cl-options.c (original)<br>
+++ cfe/trunk/test/Driver/cl-options.c Thu Apr 27 12:19:07 2017<br>
@@ -14,6 +14,9 @@<br>
 // C_P: "-E"<br>
 // C_P: "-C"<br>
<br>
+// RUN: %clang_cl /d1reportAllClassLayout -### -- %s 2>&1 | FileCheck -check-prefix=d1reportAllClassLayout %s<br>
+// d1reportAllClassLayout: -fdump-record-layouts<br>
+<br>
 // RUN: %clang_cl /Dfoo=bar /D bar=baz /DMYDEF#value /DMYDEF2=foo#bar /DMYDEF3#a=b /DMYDEF4# \<br>
 // RUN:    -### -- %s 2>&1 | FileCheck -check-prefix=D %s<br>
 // D: "-D" "foo=bar"<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div>