Added support for call comment directive to inject calls in comments (Fixes #196)

This commit is contained in:
Bartek Kryza
2023-10-21 21:47:04 +02:00
parent 4f43253c0d
commit 0d237fec0a
8 changed files with 92 additions and 18 deletions

View File

@@ -856,7 +856,8 @@ clang::RawComment *get_expression_raw_comment(const clang::SourceManager &sm,
auto expr_begin = stmt->getSourceRange().getBegin();
const auto expr_begin_line = sm.getSpellingLineNumber(expr_begin);
if (!context.Comments.empty())
if (!context.Comments.empty() &&
context.Comments.getCommentsInFile(sm.getFileID(expr_begin)) != nullptr)
for (const auto [offset, raw_comment] :
*context.Comments.getCommentsInFile(sm.getFileID(expr_begin))) {
const auto comment_end_line = sm.getSpellingLineNumber(