Skip to content

Commit de9f673

Browse files
[clang-tidy] Update documentation for 'fileScopeAsmDecl'
1 parent e6ac98a commit de9f673

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

clang/docs/LibASTMatchersReference.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -828,9 +828,14 @@ <h2 id="decl-matchers">Node Matchers</h2>
828828
<tr><td>Matcher&lt;<a href="https://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>&gt;</td><td class="name" onclick="toggle('fileScopeAsmDecl0')"><a name="fileScopeAsmDecl0Anchor">fileScopeAsmDecl</a></td><td>Matcher&lt;<a href="https://clang.llvm.org/doxygen/classclang_1_1FileScopeAsmDecl.html">FileScopeAsmDecl</a>&gt;...</td></tr>
829829
<tr><td colspan="4" class="doc" id="fileScopeAsmDecl0"><pre>Matches top level asm declarations.
830830

831-
__asm__("nop");
831+
Given
832+
__asm("nop");
833+
void f() {
834+
__asm("mov al, 2");
835+
}
832836
fileScopeAsmDecl()
833-
matches '__asm__("nop")'
837+
matches '__asm("nop")',
838+
but not '__asm("mov al, 2")'.
834839
</pre></td></tr>
835840

836841

clang/include/clang/ASTMatchers/ASTMatchers.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2480,11 +2480,16 @@ extern const internal::VariadicDynCastAllOfMatcher<Stmt, AsmStmt> asmStmt;
24802480

24812481
/// Matches top level asm declarations.
24822482
///
2483+
/// Given
24832484
/// \code
2484-
/// __asm__("nop");
2485+
/// __asm("nop");
2486+
/// void f() {
2487+
/// __asm("mov al, 2");
2488+
/// }
24852489
/// \endcode
24862490
/// fileScopeAsmDecl()
2487-
/// matches '__asm__("nop")'
2491+
/// matches '__asm("nop")',
2492+
/// but not '__asm("mov al, 2")'.
24882493
extern const internal::VariadicDynCastAllOfMatcher<Decl, FileScopeAsmDecl>
24892494
fileScopeAsmDecl;
24902495

0 commit comments

Comments
 (0)