summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/RawCommentList.cpp
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2016-10-16 20:12:42 +0000
committerJustin Bogner <mail@justinbogner.com>2016-10-16 20:12:42 +0000
commit14994133bb86c038114b1ef906b2841e04add92d (patch)
tree48aee9cac5aa96b502e5e2c1797ed6c04c2421d0 /clang/lib/AST/RawCommentList.cpp
parenteeb8d20db46ef278ac91606f6e7c274f4852136a (diff)
downloadbcm5719-llvm-14994133bb86c038114b1ef906b2841e04add92d.tar.gz
bcm5719-llvm-14994133bb86c038114b1ef906b2841e04add92d.zip
AST: Improve a couple of comments and cast unused values to void
Make these comments a bit more explicit that they're initializing the RawText member, and explicitly cast the unused result of getRawText to void for clarity. llvm-svn: 284341
Diffstat (limited to 'clang/lib/AST/RawCommentList.cpp')
-rw-r--r--clang/lib/AST/RawCommentList.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/clang/lib/AST/RawCommentList.cpp b/clang/lib/AST/RawCommentList.cpp
index 8317f76b856..881a7d9c61b 100644
--- a/clang/lib/AST/RawCommentList.cpp
+++ b/clang/lib/AST/RawCommentList.cpp
@@ -175,8 +175,8 @@ StringRef RawComment::getRawTextSlow(const SourceManager &SourceMgr) const {
}
const char *RawComment::extractBriefText(const ASTContext &Context) const {
- // Make sure that RawText is valid.
- getRawText(Context.getSourceManager());
+ // Lazily initialize RawText using the accessor before using it.
+ (void)getRawText(Context.getSourceManager());
// Since we will be copying the resulting text, all allocations made during
// parsing are garbage after resulting string is formed. Thus we can use
@@ -202,8 +202,8 @@ const char *RawComment::extractBriefText(const ASTContext &Context) const {
comments::FullComment *RawComment::parse(const ASTContext &Context,
const Preprocessor *PP,
const Decl *D) const {
- // Make sure that RawText is valid.
- getRawText(Context.getSourceManager());
+ // Lazily initialize RawText using the accessor before using it.
+ (void)getRawText(Context.getSourceManager());
comments::Lexer L(Context.getAllocator(), Context.getDiagnostics(),
Context.getCommentCommandTraits(),
@@ -334,4 +334,3 @@ void RawCommentList::addDeserializedComments(ArrayRef<RawComment *> Deserialized
BeforeThanCompare<RawComment>(SourceMgr));
std::swap(Comments, MergedComments);
}
-
OpenPOWER on IntegriCloud