================ @@ -316,5 +319,26 @@ std::string getReturnType(const CodeCompletionString &CCS) { return ""; } +comments::FullComment *parseComment(llvm::StringRef Comment, + llvm::BumpPtrAllocator &Allocator, + comments::CommandTraits &Traits) { + // The comment lexer expects markers, so add them back + auto CommentWithMarkers = "/*" + Comment.str() + "*/"; + + SourceManagerForFile SourceMgrForFile("mock_file.cpp", CommentWithMarkers); + SourceManager &SourceMgr = SourceMgrForFile.get(); + + comments::Lexer L(Allocator, SourceMgr.getDiagnostics(), Traits, + SourceMgr.getLocForStartOfFile(SourceMgr.getMainFileID()), + CommentWithMarkers.data(), + CommentWithMarkers.data() + CommentWithMarkers.size()); + comments::Sema S(Allocator, SourceMgr, SourceMgr.getDiagnostics(), Traits, + nullptr); ---------------- erichkeane wrote:
we need a `/*stuff=*/` style comment for the `nullptr` here. https://github.com/llvm/llvm-project/pull/78491 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits