Example #1
0
/// Hook into the preprocessor and extract comments containing expected
/// errors and warnings.
void VerifyDiagnosticConsumer::handleComment(Lexer &L, SourceRange Comment) {
  const llvm::SourceMgr &SM = L.getSourceManager();
  SourceLocation CommentBegin = Comment.Start;

  const char *CommentRaw = CommentBegin.getPointer();
  StringRef C(CommentRaw, Comment.End.getPointer() - CommentRaw);

  if (C.empty())
    return;

  ParseDirective(C, &ED, SM, CommentBegin, L.getDiagnostics(), Status);
}