[PATCH] D46000: [AST] Added a helper to extract a user-friendly text of a comment.

Eric Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 26 06:55:17 PDT 2018


ioeric added a comment.

Looks good. We still need tests though :)



================
Comment at: lib/AST/RawCommentList.cpp:376
+        SourceMgr.getSpellingColumnNumber(Tok.getLocation(), &LocInvalid);
+    if (LocInvalid)
+      TokColumn = 0;
----------------
This is a bit confusing... Could you please add comments about the behavior here (as chatted offline)?


================
Comment at: lib/AST/RawCommentList.cpp:394
+            : std::min(WhitespaceLen,
+                       (size_t)std::max((int)IndentColumn - (int)TokColumn, 0));
+    llvm::StringRef Trimmed = TokText.drop_front(SkipLen);
----------------
use `static_cast` instead of conversions.


================
Comment at: lib/AST/RawCommentList.cpp:405
+    }
+    // We've reached the end of the line.
+    return false;
----------------
I think it's end of file?


Repository:
  rC Clang

https://reviews.llvm.org/D46000





More information about the cfe-commits mailing list