Example #1
0
void CommentToXMLConverter::convertCommentToXML(const FullComment *FC,
                                                SmallVectorImpl<char> &XML,
                                                const ASTContext &Context) {
  CommentASTToXMLConverter Converter(FC, XML, Context.getCommentCommandTraits(),
                                     Context.getSourceManager());
  Converter.visit(FC);
}
Example #2
0
void CommentToXMLConverter::convertHTMLTagNodeToText(
    const comments::HTMLTagComment *HTC, SmallVectorImpl<char> &Text,
    const ASTContext &Context) {
  CommentASTToHTMLConverter Converter(nullptr, Text,
                                      Context.getCommentCommandTraits());
  Converter.visit(HTC);
}
Example #3
0
void CommentToXMLConverter::convertCommentToXML(const FullComment *FC,
                                                SmallVectorImpl<char> &XML,
                                                const ASTContext &Context) {
  if (!FormatContext || (FormatInMemoryUniqueId % 1000) == 0) {
    // Create a new format context, or re-create it after some number of
    // iterations, so the buffers don't grow too large.
    FormatContext.reset(new SimpleFormatContext(Context.getLangOpts()));
  }

  CommentASTToXMLConverter Converter(FC, XML, Context.getCommentCommandTraits(),
                                     Context.getSourceManager(), *FormatContext,
                                     FormatInMemoryUniqueId++);
  Converter.visit(FC);
}
void CommentToXMLConverter::convertCommentToXML(const FullComment *FC,
                                                SmallVectorImpl<char> &XML,
                                                const ASTContext &Context) {
  if (!FormatContext) {
    FormatContext = new SimpleFormatContext(Context.getLangOpts());
  } else if ((FormatInMemoryUniqueId % 1000) == 0) {
    // Delete after some number of iterations, so the buffers don't grow
    // too large.
    delete FormatContext;
    FormatContext = new SimpleFormatContext(Context.getLangOpts());
  }

  CommentASTToXMLConverter Converter(FC, XML, Context.getCommentCommandTraits(),
                                     Context.getSourceManager(), *FormatContext,
                                     FormatInMemoryUniqueId++);
  Converter.visit(FC);
}
Example #5
0
void Comment::dump(const ASTContext &Context) const {
  dump(llvm::errs(), &Context.getCommentCommandTraits(),
       &Context.getSourceManager());
}