================
@@ -2478,6 +2478,16 @@ extern const internal::VariadicDynCastAllOfMatcher<Stmt, 
NullStmt> nullStmt;
 ///   matches '__asm("mov al, 2")'
 extern const internal::VariadicDynCastAllOfMatcher<Stmt, AsmStmt> asmStmt;
 
+/// Matches top level asm declarations.
----------------
capitan-davide wrote:

> What is the difference between top-level and not top-level asm declarations?

You can find an example 
[here](https://en.cppreference.com/w/cpp/language/asm.html) of top-level vs non 
top-level (i.e., inline) assembly.

> The  `__asm isn't` top level?

Yes, but I had the following issues:

- `asm` C++ keyword is not supported by MSVC, also is not standard in C
- `__asm {}` MSVC extension, does not work on Clang/GCC
- `__asm ()` Failed on AArch64 build (not supported?)
- `__asm__`  GCC/Clang extension, but the most widely supported

> Could we provide here example of non-top level declaration which wouldn't 
> match

Yes, sure

https://github.com/llvm/llvm-project/pull/165319
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to