[cfe-commits] r160182 - in /cfe/trunk: include/clang/AST/Comment.h lib/AST/CommentDumper.cpp lib/AST/CommentSema.cpp unittests/AST/CommentParser.cpp

Dmitri Gribenko gribozavr at gmail.com
Fri Jul 13 12:02:42 PDT 2012


Author: gribozavr
Date: Fri Jul 13 14:02:42 2012
New Revision: 160182

URL: http://llvm.org/viewvc/llvm-project?rev=160182&view=rev
Log:
Comment AST nodes: rename getXXXCount() methods to getNumXXXs() to be in line with Statement AST nodes.

Modified:
    cfe/trunk/include/clang/AST/Comment.h
    cfe/trunk/lib/AST/CommentDumper.cpp
    cfe/trunk/lib/AST/CommentSema.cpp
    cfe/trunk/unittests/AST/CommentParser.cpp

Modified: cfe/trunk/include/clang/AST/Comment.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Comment.h?rev=160182&r1=160181&r2=160182&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Comment.h (original)
+++ cfe/trunk/include/clang/AST/Comment.h Fri Jul 13 14:02:42 2012
@@ -242,7 +242,7 @@
                        getLocEnd());
   }
 
-  unsigned getArgCount() const {
+  unsigned getNumArgs() const {
     return Args.size();
   }
 
@@ -354,7 +354,7 @@
 
   child_iterator child_end() const { return NULL; }
 
-  unsigned getAttrCount() const {
+  unsigned getNumAttrs() const {
     return Attributes.size();
   }
 
@@ -532,7 +532,7 @@
                        getLocStart().getLocWithOffset(1 + Name.size()));
   }
 
-  unsigned getArgCount() const {
+  unsigned getNumArgs() const {
     return Args.size();
   }
 
@@ -611,7 +611,7 @@
   }
 
   bool hasParamName() const {
-    return getArgCount() > 0;
+    return getNumArgs() > 0;
   }
 
   StringRef getParamName() const {
@@ -708,7 +708,7 @@
     return CloseName;
   }
 
-  unsigned getLineCount() const {
+  unsigned getNumLines() const {
     return Lines.size();
   }
 

Modified: cfe/trunk/lib/AST/CommentDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/CommentDumper.cpp?rev=160182&r1=160181&r2=160182&view=diff
==============================================================================
--- cfe/trunk/lib/AST/CommentDumper.cpp (original)
+++ cfe/trunk/lib/AST/CommentDumper.cpp Fri Jul 13 14:02:42 2012
@@ -106,7 +106,7 @@
 void CommentDumper::visitInlineCommandComment(const InlineCommandComment *C) {
   dumpComment(C);
 
-  for (unsigned i = 0, e = C->getArgCount(); i != e; ++i)
+  for (unsigned i = 0, e = C->getNumArgs(); i != e; ++i)
     OS << " Arg[" << i << "]=\"" << C->getArgText(i) << "\"";
 }
 
@@ -114,9 +114,9 @@
   dumpComment(C);
 
   OS << " Name=\"" << C->getTagName() << "\"";
-  if (C->getAttrCount() != 0) {
+  if (C->getNumAttrs() != 0) {
     OS << " Attrs: ";
-    for (unsigned i = 0, e = C->getAttrCount(); i != e; ++i) {
+    for (unsigned i = 0, e = C->getNumAttrs(); i != e; ++i) {
       const HTMLStartTagComment::Attribute &Attr = C->getAttr(i);
       OS << " \"" << Attr.Name << "=\"" << Attr.Value << "\"";
     }

Modified: cfe/trunk/lib/AST/CommentSema.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/CommentSema.cpp?rev=160182&r1=160181&r2=160182&view=diff
==============================================================================
--- cfe/trunk/lib/AST/CommentSema.cpp (original)
+++ cfe/trunk/lib/AST/CommentSema.cpp Fri Jul 13 14:02:42 2012
@@ -130,7 +130,7 @@
                                                 SourceLocation ArgLocEnd,
                                                 StringRef Arg) {
   // Parser will not feed us more arguments than needed.
-  assert(Command->getArgCount() == 0);
+  assert(Command->getNumArgs() == 0);
 
   if (!Command->isDirectionExplicit()) {
     // User didn't provide a direction argument.
@@ -362,8 +362,8 @@
   ParagraphComment *Paragraph = Command->getParagraph();
   if (Paragraph->isWhitespace()) {
     SourceLocation DiagLoc;
-    if (Command->getArgCount() > 0)
-      DiagLoc = Command->getArgRange(Command->getArgCount() - 1).getEnd();
+    if (Command->getNumArgs() > 0)
+      DiagLoc = Command->getArgRange(Command->getNumArgs() - 1).getEnd();
     if (!DiagLoc.isValid())
       DiagLoc = Command->getCommandNameRange().getEnd();
     Diag(DiagLoc, diag::warn_doc_block_command_empty_paragraph)

Modified: cfe/trunk/unittests/AST/CommentParser.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/AST/CommentParser.cpp?rev=160182&r1=160181&r2=160182&view=diff
==============================================================================
--- cfe/trunk/unittests/AST/CommentParser.cpp (original)
+++ cfe/trunk/unittests/AST/CommentParser.cpp Fri Jul 13 14:02:42 2012
@@ -244,9 +244,9 @@
   if (!AR)
     return AR;
 
-  if (ICC->getArgCount() != 0)
+  if (ICC->getNumArgs() != 0)
     return ::testing::AssertionFailure()
-        << "InlineCommandComment has " << ICC->getArgCount() << " arg(s), "
+        << "InlineCommandComment has " << ICC->getNumArgs() << " arg(s), "
            "expected 0";
 
   return ::testing::AssertionSuccess();
@@ -261,9 +261,9 @@
   if (!AR)
     return AR;
 
-  if (ICC->getArgCount() != 1)
+  if (ICC->getNumArgs() != 1)
     return ::testing::AssertionFailure()
-        << "InlineCommandComment has " << ICC->getArgCount() << " arg(s), "
+        << "InlineCommandComment has " << ICC->getNumArgs() << " arg(s), "
            "expected 1";
 
   StringRef ActualArg = ICC->getArgText(0);
@@ -326,9 +326,9 @@
     return ::testing::AssertionFailure()
         << "HTMLStartTagComment is self-closing";
 
-  if (HST->getAttrCount() != 0)
+  if (HST->getNumAttrs() != 0)
     return ::testing::AssertionFailure()
-        << "HTMLStartTagComment has " << HST->getAttrCount() << " attr(s), "
+        << "HTMLStartTagComment has " << HST->getNumAttrs() << " attr(s), "
            "expected 0";
 
   return ::testing::AssertionSuccess();
@@ -348,9 +348,9 @@
     return ::testing::AssertionFailure()
         << "HTMLStartTagComment is self-closing";
 
-  if (HST->getAttrCount() != 1)
+  if (HST->getNumAttrs() != 1)
     return ::testing::AssertionFailure()
-        << "HTMLStartTagComment has " << HST->getAttrCount() << " attr(s), "
+        << "HTMLStartTagComment has " << HST->getNumAttrs() << " attr(s), "
            "expected 1";
 
   StringRef ActualName = HST->getAttr(0).Name;
@@ -413,9 +413,9 @@
   if (!AR)
     return AR;
 
-  if (VBC->getLineCount() != 0)
+  if (VBC->getNumLines() != 0)
     return ::testing::AssertionFailure()
-        << "VerbatimBlockComment has " << VBC->getLineCount() << " lines(s), "
+        << "VerbatimBlockComment has " << VBC->getNumLines() << " lines(s), "
            "expected 0";
 
   return ::testing::AssertionSuccess();
@@ -430,9 +430,9 @@
   if (!AR)
     return AR;
 
-  if (VBC->getLineCount() != 1)
+  if (VBC->getNumLines() != 1)
     return ::testing::AssertionFailure()
-        << "VerbatimBlockComment has " << VBC->getLineCount() << " lines(s), "
+        << "VerbatimBlockComment has " << VBC->getNumLines() << " lines(s), "
            "expected 1";
 
   StringRef ActualLine0 = VBC->getText(0);
@@ -454,9 +454,9 @@
   if (!AR)
     return AR;
 
-  if (VBC->getLineCount() != 2)
+  if (VBC->getNumLines() != 2)
     return ::testing::AssertionFailure()
-        << "VerbatimBlockComment has " << VBC->getLineCount() << " lines(s), "
+        << "VerbatimBlockComment has " << VBC->getNumLines() << " lines(s), "
            "expected 2";
 
   StringRef ActualLine0 = VBC->getText(0);
@@ -1110,7 +1110,7 @@
   {
     VerbatimBlockComment *VBC;
     ASSERT_TRUE(HasVerbatimBlockAt(FC, 1, VBC, "verbatim"));
-    ASSERT_EQ(4U, VBC->getLineCount());
+    ASSERT_EQ(4U, VBC->getNumLines());
     ASSERT_EQ(" Aaa", VBC->getText(0));
     ASSERT_EQ("",     VBC->getText(1));
     ASSERT_EQ(" Bbb", VBC->getText(2));





More information about the cfe-commits mailing list