diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-01-02 19:18:08 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-01-02 19:18:08 +0000 |
commit | bab175ec4b075c8076ba14c762900392533f6ee4 (patch) | |
tree | 01f4f29419a2cb10abe13c1e63cd2a66068b0137 /lib/AST/RawCommentList.cpp | |
parent | 8b7a8012d223fac5d17d16a66bb39168a9a1dfc0 (diff) |
Notes
Diffstat (limited to 'lib/AST/RawCommentList.cpp')
-rw-r--r-- | lib/AST/RawCommentList.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/AST/RawCommentList.cpp b/lib/AST/RawCommentList.cpp index 8317f76b8569..881a7d9c61be 100644 --- a/lib/AST/RawCommentList.cpp +++ b/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); } - |