<div dir="ltr">I spent an hour on this today, and returning an StmtEmpty from ParseMicrosoftAsmStatement seems to work just fine. Note that parsing happens in two phases, asm line collection and actual MC stuff and I bail out right after first phase ends. Does this make sense and if so what should be the condition to check?. I guess we need something that doesn't exist right now, like IsTooling? We could use SourceManager::isInSystemHeader(AsmLoc) in addition, tools would still error out if client code uses inline asm, but at least it wouldn't allow the tool to break anything.</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 25, 2014 at 3:43 PM, Kim Gräsman <span dir="ltr"><<a href="mailto:kim.grasman@gmail.com" target="_blank">kim.grasman@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Mon, Nov 24, 2014 at 11:41 PM, Reid Kleckner <<a href="mailto:rnk@google.com">rnk@google.com</a>> wrote:<br>
><br>
> Your proposed fix only works for clang-modernize, but not clang-tidy or<br>
> libclang clients. I'm saying it'd be nice if we could make it easy for tools<br>
> to recover from this error instead of trying to fix it by pulling in the<br>
> whole LLVM x86 backend. None of these tools should attempt to refactor<br>
> system headers, for example, so ignoring functions with __asm blocks is<br>
> probably good enough.<br>
<br>
</span>Topical: <a href="http://clang-developers.42468.n3.nabble.com/libclang-crash-when-parsing-MS-style-inline-assembly-td4035432.html#a4035754" target="_blank">http://clang-developers.42468.n3.nabble.com/libclang-crash-when-parsing-MS-style-inline-assembly-td4035432.html#a4035754</a><br>
<br>
I never got around to checking if LLVMInitialize* do fail silently in<br>
the absence of X86 target support, so I can't tell what happens there.<br>
Actual asm parsing seems to be short-circuited if target info is not<br>
available.<br>
<span class="HOEnZb"><font color="#888888"><br>
- Kim<br>
</font></span></blockquote></div><br></div>