[cfe-dev] Error parsing files with AST Matcher tool

Manuel Klimek klimek at google.com
Mon Jul 13 04:11:54 PDT 2015


On Mon, Jul 13, 2015 at 12:25 PM Han Wang <wanghan02 at gmail.com> wrote:

> Hi,
>
> I have a simple file containing some Microsoft style inline asm. I can
> compile this file with -fms-extensions.
>
> clang++ -fms-extensions -c test.cpp
>
> No problem for this.
>
> But when I write a simple AST Matcher tool (foo.out) to parse this file, I
> got errors.
>
> ./foo.out test.cpp -- clang++ -fms-extensions -c test.cpp
> test.cpp:19:3: error: MS-style inline assembly is not available: Unable to
> find target for this triple (no targets are registered)
>   __asm {
>   ^
> test.cpp:28:3: error: MS-style inline assembly is not available: Unable to
> find target for this triple (no targets are registered)
>   __asm mov a1, 2
>   ^
> 2 errors generated.
> Error while processing test.cpp.
>

This seems to want an actual compilation triple to compile. Clang tools
currently apparently don't provide one. No idea why though.


> There are also some other problems when parsing test.cpp. For example if I
> #include <string>, I have to use -- clang++ -I<path-to-string> to identify
> the system header file path. I'm not sure what makes it different then the
> normal clang compile.
>

This definitely works on linux. I have no idea what the Windows system path
logic is / should be in the clang driver. Adding Hans, who might have an
idea...


>
> Best regards,
> Han
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150713/faa17e04/attachment.html>


More information about the cfe-dev mailing list