From 1083e52e5a3e3c5d410816ba75077f49e96dfe1c Mon Sep 17 00:00:00 2001 From: Malcolm Parsons Date: Sat, 24 Dec 2016 13:22:26 +0000 Subject: [PATCH] [ASTMatchers] Fix doc for hasBitWidth git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290491 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/LibASTMatchersReference.html | 5 +++-- include/clang/ASTMatchers/ASTMatchers.h | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/LibASTMatchersReference.html b/docs/LibASTMatchersReference.html index 2a8d864c3c..7745480c44 100644 --- a/docs/LibASTMatchersReference.html +++ b/docs/LibASTMatchersReference.html @@ -2430,7 +2430,8 @@ designatorCountIs(2) Matcher<FieldDecl>hasBitWidthunsigned Width -
Matches non-static data members that are bit-fields.
+
Matches non-static data members that are bit-fields of the specified
+bit width.
 
 Given
   class C {
@@ -2438,7 +2439,7 @@ Given
     int b : 4;
     int c : 2;
   };
-fieldDecl(isBitField())
+fieldDecl(hasBitWidth(2))
   matches 'int a;' and 'int c;' but not 'int b;'.
 
diff --git a/include/clang/ASTMatchers/ASTMatchers.h b/include/clang/ASTMatchers/ASTMatchers.h index f2c649aca0..efa606262b 100644 --- a/include/clang/ASTMatchers/ASTMatchers.h +++ b/include/clang/ASTMatchers/ASTMatchers.h @@ -533,7 +533,8 @@ AST_MATCHER(FieldDecl, isBitField) { return Node.isBitField(); } -/// \brief Matches non-static data members that are bit-fields. +/// \brief Matches non-static data members that are bit-fields of the specified +/// bit width. /// /// Given /// \code @@ -543,7 +544,7 @@ AST_MATCHER(FieldDecl, isBitField) { /// int c : 2; /// }; /// \endcode -/// fieldDecl(isBitField()) +/// fieldDecl(hasBitWidth(2)) /// matches 'int a;' and 'int c;' but not 'int b;'. AST_MATCHER_P(FieldDecl, hasBitWidth, unsigned, Width) { return Node.isBitField() && -- 2.40.0