summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/RawCommentList.cpp
diff options
context:
space:
mode:
authorDmitri Gribenko <gribozavr@gmail.com>2012-07-27 20:37:06 +0000
committerDmitri Gribenko <gribozavr@gmail.com>2012-07-27 20:37:06 +0000
commit4586df765e927de6eb2d21ee849f7b847b3e91ec (patch)
treedc303ac77fa15920ad2df19a25550aa803ff9ef6 /clang/lib/AST/RawCommentList.cpp
parentce675c52ba250661b18771d8841040683836e3d5 (diff)
downloadbcm5719-llvm-4586df765e927de6eb2d21ee849f7b847b3e91ec.tar.gz
bcm5719-llvm-4586df765e927de6eb2d21ee849f7b847b3e91ec.zip
Implement resolving of HTML character references (named: &amp;, decimal: &#42;,
hex: &#x1a;) during comment parsing. Now internal representation of plain text in comment AST does not contain character references, but the characters themselves. llvm-svn: 160891
Diffstat (limited to 'clang/lib/AST/RawCommentList.cpp')
-rw-r--r--clang/lib/AST/RawCommentList.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/AST/RawCommentList.cpp b/clang/lib/AST/RawCommentList.cpp
index 7e183e2f2d3..41866cf03f1 100644
--- a/clang/lib/AST/RawCommentList.cpp
+++ b/clang/lib/AST/RawCommentList.cpp
@@ -134,7 +134,13 @@ const char *RawComment::extractBriefText(const ASTContext &Context) const {
// Make sure that RawText is valid.
getRawText(Context.getSourceManager());
- comments::Lexer L(Range.getBegin(), comments::CommentOptions(),
+ // Since we will be copying the resulting text, all allocations made during
+ // parsing are garbage after resulting string is formed. Thus we can use
+ // a separate allocator for all temporary stuff.
+ llvm::BumpPtrAllocator Allocator;
+
+ comments::Lexer L(Allocator,
+ Range.getBegin(), comments::CommentOptions(),
RawText.begin(), RawText.end());
comments::BriefParser P(L);
OpenPOWER on IntegriCloud