r185640 - Fixed typo: NoneComment -> NonComment, no other changes.

Alexander Kornienko alexfh at google.com
Thu Jul 4 07:47:51 PDT 2013


Author: alexfh
Date: Thu Jul  4 09:47:51 2013
New Revision: 185640

URL: http://llvm.org/viewvc/llvm-project?rev=185640&view=rev
Log:
Fixed typo: NoneComment -> NonComment, no other changes.

Modified:
    cfe/trunk/lib/Format/Format.cpp
    cfe/trunk/lib/Format/FormatToken.h
    cfe/trunk/lib/Format/TokenAnnotator.cpp

Modified: cfe/trunk/lib/Format/Format.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/Format.cpp?rev=185640&r1=185639&r2=185640&view=diff
==============================================================================
--- cfe/trunk/lib/Format/Format.cpp (original)
+++ cfe/trunk/lib/Format/Format.cpp Thu Jul  4 09:47:51 2013
@@ -587,7 +587,7 @@ private:
       for (unsigned i = 0, e = State.Stack.size() - 1; i != e; ++i) {
         State.Stack[i].BreakBeforeParameter = true;
       }
-      const FormatToken *TokenBefore = Current.getPreviousNoneComment();
+      const FormatToken *TokenBefore = Current.getPreviousNonComment();
       if (TokenBefore && !TokenBefore->isOneOf(tok::comma, tok::semi) &&
           TokenBefore->Type != TT_TemplateCloser &&
           TokenBefore->Type != TT_BinaryOperator && !TokenBefore->opensScope())
@@ -714,7 +714,7 @@ private:
       State.Stack.back().Indent += 4;
 
     // Insert scopes created by fake parenthesis.
-    const FormatToken *Previous = Current.getPreviousNoneComment();
+    const FormatToken *Previous = Current.getPreviousNonComment();
     // Don't add extra indentation for the first fake parenthesis after
     // 'return', assignements or opening <({[. The indentation for these cases
     // is special cased.
@@ -753,7 +753,7 @@ private:
       bool AvoidBinPacking;
       if (Current.is(tok::l_brace)) {
         NewIndent = Style.IndentWidth + LastSpace;
-        const FormatToken *NextNoComment = Current.getNextNoneComment();
+        const FormatToken *NextNoComment = Current.getNextNonComment();
         AvoidBinPacking = NextNoComment &&
                           NextNoComment->Type == TT_DesignatedInitializerPeriod;
       } else {
@@ -1275,13 +1275,13 @@ public:
 
     // Adapt level to the next line if this is a comment.
     // FIXME: Can/should this be done in the UnwrappedLineParser?
-    const AnnotatedLine *NextNoneCommentLine = NULL;
+    const AnnotatedLine *NextNonCommentLine = NULL;
     for (unsigned i = AnnotatedLines.size() - 1; i > 0; --i) {
-      if (NextNoneCommentLine && AnnotatedLines[i].First->is(tok::comment) &&
+      if (NextNonCommentLine && AnnotatedLines[i].First->is(tok::comment) &&
           !AnnotatedLines[i].First->Next)
-        AnnotatedLines[i].Level = NextNoneCommentLine->Level;
+        AnnotatedLines[i].Level = NextNonCommentLine->Level;
       else
-        NextNoneCommentLine =
+        NextNonCommentLine =
             AnnotatedLines[i].First->isNot(tok::r_brace) ? &AnnotatedLines[i]
                                                          : NULL;
     }
@@ -1531,8 +1531,8 @@ private:
 
     FormatToken *Tok = (I + 1)->First;
     if (Tok->is(tok::r_brace) && !Tok->MustBreakBefore &&
-        (Tok->getNextNoneComment() == NULL ||
-         Tok->getNextNoneComment()->is(tok::semi))) {
+        (Tok->getNextNonComment() == NULL ||
+         Tok->getNextNonComment()->is(tok::semi))) {
       // We merge empty blocks even if the line exceeds the column limit.
       Tok->SpacesRequiredBefore = 0;
       Tok->CanBreakBefore = true;
@@ -1556,7 +1556,7 @@ private:
 
       // Last, check that the third line contains a single closing brace.
       Tok = (I + 2)->First;
-      if (Tok->getNextNoneComment() != NULL || Tok->isNot(tok::r_brace) ||
+      if (Tok->getNextNonComment() != NULL || Tok->isNot(tok::r_brace) ||
           Tok->MustBreakBefore)
         return;
 

Modified: cfe/trunk/lib/Format/FormatToken.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/FormatToken.h?rev=185640&r1=185639&r2=185640&view=diff
==============================================================================
--- cfe/trunk/lib/Format/FormatToken.h (original)
+++ cfe/trunk/lib/Format/FormatToken.h Thu Jul  4 09:47:51 2013
@@ -248,7 +248,7 @@ struct FormatToken {
   }
 
   /// \brief Returns the previous token ignoring comments.
-  FormatToken *getPreviousNoneComment() const {
+  FormatToken *getPreviousNonComment() const {
     FormatToken *Tok = Previous;
     while (Tok != NULL && Tok->is(tok::comment))
       Tok = Tok->Previous;
@@ -256,7 +256,7 @@ struct FormatToken {
   }
 
   /// \brief Returns the next token ignoring comments.
-  const FormatToken *getNextNoneComment() const {
+  const FormatToken *getNextNonComment() const {
     const FormatToken *Tok = Next;
     while (Tok != NULL && Tok->is(tok::comment))
       Tok = Tok->Next;

Modified: cfe/trunk/lib/Format/TokenAnnotator.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/TokenAnnotator.cpp?rev=185640&r1=185639&r2=185640&view=diff
==============================================================================
--- cfe/trunk/lib/Format/TokenAnnotator.cpp (original)
+++ cfe/trunk/lib/Format/TokenAnnotator.cpp Thu Jul  4 09:47:51 2013
@@ -105,9 +105,9 @@ private:
       // '*' has to be a binary operator but determineStarAmpUsage() will
       // categorize it as an unary operator, so set the right type here.
       if (LookForDecls && CurrentToken->Next) {
-        FormatToken *Prev = CurrentToken->getPreviousNoneComment();
+        FormatToken *Prev = CurrentToken->getPreviousNonComment();
         if (Prev) {
-          FormatToken *PrevPrev = Prev->getPreviousNoneComment();
+          FormatToken *PrevPrev = Prev->getPreviousNonComment();
           FormatToken *Next = CurrentToken->Next;
           if (PrevPrev && PrevPrev->is(tok::identifier) &&
               Prev->isOneOf(tok::star, tok::amp, tok::ampamp) &&
@@ -157,7 +157,7 @@ private:
     // ')' or ']'), it could be the start of an Objective-C method
     // expression, or it could the the start of an Objective-C array literal.
     FormatToken *Left = CurrentToken->Previous;
-    FormatToken *Parent = Left->getPreviousNoneComment();
+    FormatToken *Parent = Left->getPreviousNonComment();
     bool StartsObjCMethodExpr =
         Contexts.back().CanBeExpression &&
         (!Parent || Parent->isOneOf(tok::colon, tok::l_square, tok::l_paren,
@@ -216,7 +216,7 @@ private:
       ScopedContextCreator ContextCreator(*this, tok::l_brace, 1);
       FormatToken *Left = CurrentToken->Previous;
 
-      FormatToken *Parent = Left->getPreviousNoneComment();
+      FormatToken *Parent = Left->getPreviousNonComment();
       bool StartsObjCDictLiteral = Parent && Parent->is(tok::at);
       if (StartsObjCDictLiteral) {
         Contexts.back().ColonIsObjCDictLiteral = true;
@@ -608,7 +608,7 @@ private:
       } else if (Current.is(tok::r_paren)) {
         FormatToken *LeftOfParens = NULL;
         if (Current.MatchingParen)
-          LeftOfParens = Current.MatchingParen->getPreviousNoneComment();
+          LeftOfParens = Current.MatchingParen->getPreviousNonComment();
         bool IsCast = false;
         bool ParensAreEmpty = Current.Previous == Current.MatchingParen;
         bool ParensAreType = !Current.Previous ||
@@ -652,7 +652,7 @@ private:
           break;
         }
       } else if (Current.is(tok::period)) {
-        FormatToken *PreviousNoComment = Current.getPreviousNoneComment();
+        FormatToken *PreviousNoComment = Current.getPreviousNonComment();
         if (PreviousNoComment &&
             PreviousNoComment->isOneOf(tok::comma, tok::l_brace))
           Current.Type = TT_DesignatedInitializerPeriod;
@@ -689,11 +689,11 @@ private:
 
   /// \brief Return the type of the given token assuming it is * or &.
   TokenType determineStarAmpUsage(const FormatToken &Tok, bool IsExpression) {
-    const FormatToken *PrevToken = Tok.getPreviousNoneComment();
+    const FormatToken *PrevToken = Tok.getPreviousNonComment();
     if (PrevToken == NULL)
       return TT_UnaryOperator;
 
-    const FormatToken *NextToken = Tok.getNextNoneComment();
+    const FormatToken *NextToken = Tok.getNextNonComment();
     if (NextToken == NULL)
       return TT_Unknown;
 
@@ -725,7 +725,7 @@ private:
   }
 
   TokenType determinePlusMinusCaretUsage(const FormatToken &Tok) {
-    const FormatToken *PrevToken = Tok.getPreviousNoneComment();
+    const FormatToken *PrevToken = Tok.getPreviousNonComment();
     if (PrevToken == NULL || PrevToken->Type == TT_CastRParen)
       return TT_UnaryOperator;
 
@@ -745,7 +745,7 @@ private:
 
   /// \brief Determine whether ++/-- are pre- or post-increments/-decrements.
   TokenType determineIncrementUsage(const FormatToken &Tok) {
-    const FormatToken *PrevToken = Tok.getPreviousNoneComment();
+    const FormatToken *PrevToken = Tok.getPreviousNonComment();
     if (PrevToken == NULL || PrevToken->Type == TT_CastRParen)
       return TT_UnaryOperator;
     if (PrevToken->isOneOf(tok::r_paren, tok::r_square, tok::identifier))
@@ -940,8 +940,8 @@ void TokenAnnotator::calculateFormatting
                Current->is(tok::string_literal) &&
                Current->Previous->isNot(tok::lessless) &&
                Current->Previous->Type != TT_InlineASMColon &&
-               Current->getNextNoneComment() &&
-               Current->getNextNoneComment()->is(tok::string_literal)) {
+               Current->getNextNonComment() &&
+               Current->getNextNonComment()->is(tok::string_literal)) {
       Current->MustBreakBefore = true;
     } else {
       Current->MustBreakBefore = false;
@@ -1138,7 +1138,7 @@ bool TokenAnnotator::spaceRequiredBetwee
     return !Left.isOneOf(tok::l_paren, tok::l_square, tok::at) &&
            (Left.isNot(tok::colon) || Left.Type != TT_ObjCMethodExpr);
   if (Left.isOneOf(tok::identifier, tok::greater, tok::r_square) &&
-      Right.is(tok::l_brace) && Right.getNextNoneComment())
+      Right.is(tok::l_brace) && Right.getNextNonComment())
     return false;
   if (Left.is(tok::period) || Right.is(tok::period))
     return false;
@@ -1174,7 +1174,7 @@ bool TokenAnnotator::spaceRequiredBefore
     return false;
   if (Tok.is(tok::colon))
     return !Line.First->isOneOf(tok::kw_case, tok::kw_default) &&
-           Tok.getNextNoneComment() != NULL && Tok.Type != TT_ObjCMethodExpr;
+           Tok.getNextNonComment() != NULL && Tok.Type != TT_ObjCMethodExpr;
   if (Tok.Previous->Type == TT_UnaryOperator ||
       Tok.Previous->Type == TT_CastRParen)
     return false;





More information about the cfe-commits mailing list