parent
df17d64881
commit
5c8897d37d
|
@ -155,6 +155,8 @@ const RawComment *ASTContext::getRawCommentForDecl(const Decl *D) const {
|
||||||
return Pos->second;
|
return Pos->second;
|
||||||
|
|
||||||
const RawComment *RC = getRawCommentForDeclNoCache(D);
|
const RawComment *RC = getRawCommentForDeclNoCache(D);
|
||||||
|
// If we found a comment, it should be a documentation comment.
|
||||||
|
assert(!RC || RC->isDocumentation());
|
||||||
DeclComments[D] = RC;
|
DeclComments[D] = RC;
|
||||||
return RC;
|
return RC;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5715,7 +5715,7 @@ CXString clang_Cursor_getBriefCommentText(CXCursor C) {
|
||||||
const ASTContext &Context = getCursorContext(C);
|
const ASTContext &Context = getCursorContext(C);
|
||||||
const RawComment *RC = Context.getRawCommentForDecl(D);
|
const RawComment *RC = Context.getRawCommentForDecl(D);
|
||||||
|
|
||||||
if (RC && RC->isDocumentation()) {
|
if (RC) {
|
||||||
StringRef BriefText = RC->getBriefText(Context);
|
StringRef BriefText = RC->getBriefText(Context);
|
||||||
|
|
||||||
// Don't duplicate the string because RawComment ensures that this memory
|
// Don't duplicate the string because RawComment ensures that this memory
|
||||||
|
|
Loading…
Reference in New Issue