aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/CommentSema.cpp
diff options
context:
space:
mode:
authorDmitri Gribenko <gribozavr@gmail.com>2012-09-11 19:22:03 +0000
committerDmitri Gribenko <gribozavr@gmail.com>2012-09-11 19:22:03 +0000
commitb0b8a96df25660cbdbf35d23c3ff5887c33f82f9 (patch)
treeb936890d845c62646b71b250e1fa405f215b8b40 /lib/AST/CommentSema.cpp
parent19d5886d1704e24282c86217b09d5c6d35ba604d (diff)
Comment parsing: handle non-builtin commands correctly. After semantic
analysis registers a command, it becomes a "known" command for the lexer, since it has an ID. Having this freedom of choice to register a command is a good thing since BriefParser does not need this. But the parser should still invoke the correct semantic analysis method (actOnUnknownCommand) in this case. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163646 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/CommentSema.cpp')
-rw-r--r--lib/AST/CommentSema.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/AST/CommentSema.cpp b/lib/AST/CommentSema.cpp
index e57dac7104..477717f735 100644
--- a/lib/AST/CommentSema.cpp
+++ b/lib/AST/CommentSema.cpp
@@ -272,9 +272,15 @@ InlineCommandComment *Sema::actOnInlineCommand(SourceLocation CommandLocBegin,
InlineContentComment *Sema::actOnUnknownCommand(SourceLocation LocBegin,
SourceLocation LocEnd,
- StringRef Name) {
+ StringRef CommandName) {
+ unsigned CommandID = Traits.registerUnknownCommand(CommandName)->getID();
+ return actOnUnknownCommand(LocBegin, LocEnd, CommandID);
+}
+
+InlineContentComment *Sema::actOnUnknownCommand(SourceLocation LocBegin,
+ SourceLocation LocEnd,
+ unsigned CommandID) {
ArrayRef<InlineCommandComment::Argument> Args;
- unsigned CommandID = Traits.registerUnknownCommand(Name)->getID();
return new (Allocator) InlineCommandComment(
LocBegin, LocEnd, CommandID,
InlineCommandComment::RenderNormal,