<div dir="ltr">I sent another email about the -ast-dump, but basically the Python clang bindings aren't able to read it from disk after it's been saved.<div><br></div><div>Details in this stackoverflow question:</div><div><a href="https://stackoverflow.com/questions/34162906/parsing-ast-generated-by-clang-with-clang-python-bindings">https://stackoverflow.com/questions/34162906/parsing-ast-generated-by-clang-with-clang-python-bindings</a><br></div><div><br></div><div>I will get started with implementing exposing the flag. Hopefully I'll have a patch in the next few days :)</div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, 8 Dec 2015 at 16:53 Hans Wennborg <<a href="mailto:hans@chromium.org">hans@chromium.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">If you just want to look at the AST, you can use -Xclang -ast-dump.<br>
<br>
If you really need -emit-ast from clang-cl, the way to expose it would<br>
be add Flags<[CoreOption]> to emit_ast in<br>
include/clang/Driver/Options.td, and check that it works. If it does,<br>
you can send a patch for it :-)<br>
<br>
 - Hans<br>
<br>
On Tue, Dec 8, 2015 at 1:42 PM, Daniel Kats <<a href="mailto:dbkats@gmail.com" target="_blank">dbkats@gmail.com</a>> wrote:<br>
> I'm using clang on Windows to generate an AST from header files for some<br>
> driver research I'm doing for my Ph.D. I found setting environment flags to<br>
> be a pain. What would be necessary to expose this flag from clang-cl?<br>
><br>
> On Tue, 8 Dec 2015 at 16:17 Hans Wennborg <<a href="mailto:hans@chromium.org" target="_blank">hans@chromium.org</a>> wrote:<br>
>><br>
>> Hi Daniel,<br>
>><br>
>> On Tue, Dec 8, 2015 at 11:46 AM, Daniel Kats via cfe-dev<br>
>> <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br>
>> > How to call clang-cl with -emit-ast command-line argument? I tried<br>
>> > -Xclang<br>
>> > -emit-ast and got "unknown argument: -emit-ast"<br>
>><br>
>> It doesn't work with -Xclang, because -emit-ast is a driver flag, not<br>
>> a frontend flag.<br>
>><br>
>> clang-cl could probably expose this flag if it's useful, but in<br>
>> general its focus is on MSVC-compatible flags. What do you need it<br>
>> for?<br>
>><br>
>>  - Hans<br>
</blockquote></div>