aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/AST/CommentCommandTraits.cpp1
-rw-r--r--lib/AST/CommentParser.cpp7
-rw-r--r--lib/AST/CommentSema.cpp10
3 files changed, 16 insertions, 2 deletions
diff --git a/lib/AST/CommentCommandTraits.cpp b/lib/AST/CommentCommandTraits.cpp
index ba0aa9ae12..e7e40fd109 100644
--- a/lib/AST/CommentCommandTraits.cpp
+++ b/lib/AST/CommentCommandTraits.cpp
@@ -40,6 +40,7 @@ const CommandInfo *CommandTraits::registerUnknownCommand(StringRef CommandName)
CommandInfo *Info = new (Allocator) CommandInfo();
Info->Name = Name;
Info->ID = NextID++;
+ Info->IsUnknownCommand = true;
RegisteredCommands.push_back(Info);
diff --git a/lib/AST/CommentParser.cpp b/lib/AST/CommentParser.cpp
index f6acd9645f..d053dc0f18 100644
--- a/lib/AST/CommentParser.cpp
+++ b/lib/AST/CommentParser.cpp
@@ -554,6 +554,13 @@ BlockContentComment *Parser::parseParagraphOrBlockCommand() {
return parseBlockCommand();
break; // Block command ahead, finish this parapgaph.
}
+ if (Info->IsUnknownCommand) {
+ Content.push_back(S.actOnUnknownCommand(Tok.getLocation(),
+ Tok.getEndLocation(),
+ Info->getID()));
+ consumeToken();
+ continue;
+ }
assert(Info->IsInlineCommand);
Content.push_back(parseInlineCommand());
continue;
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,