diff options
Diffstat (limited to 'clang/lib/AST/CommentSema.cpp')
-rw-r--r-- | clang/lib/AST/CommentSema.cpp | 48 |
1 files changed, 11 insertions, 37 deletions
diff --git a/clang/lib/AST/CommentSema.cpp b/clang/lib/AST/CommentSema.cpp index 087f103..9b0f034 100644 --- a/clang/lib/AST/CommentSema.cpp +++ b/clang/lib/AST/CommentSema.cpp @@ -265,10 +265,8 @@ void Sema::actOnParamCommandParamNameArg(ParamCommandComment *Command, // User didn't provide a direction argument. Command->setDirection(ParamCommandComment::In, /* Explicit = */ false); } - typedef BlockCommandComment::Argument Argument; - Argument *A = new (Allocator) Argument(SourceRange(ArgLocBegin, - ArgLocEnd), - Arg); + auto *A = new (Allocator) + Comment::Argument{SourceRange(ArgLocBegin, ArgLocEnd), Arg}; Command->setArgs(llvm::makeArrayRef(A, 1)); } @@ -303,10 +301,8 @@ void Sema::actOnTParamCommandParamNameArg(TParamCommandComment *Command, // Parser will not feed us more arguments than needed. assert(Command->getNumArgs() == 0); - typedef BlockCommandComment::Argument Argument; - Argument *A = new (Allocator) Argument(SourceRange(ArgLocBegin, - ArgLocEnd), - Arg); + auto *A = new (Allocator) + Comment::Argument{SourceRange(ArgLocBegin, ArgLocEnd), Arg}; Command->setArgs(llvm::makeArrayRef(A, 1)); if (!isTemplateOrSpecialization()) { @@ -361,37 +357,15 @@ void Sema::actOnTParamCommandFinish(TParamCommandComment *Command, checkBlockCommandEmptyParagraph(Command); } -InlineCommandComment *Sema::actOnInlineCommand(SourceLocation CommandLocBegin, - SourceLocation CommandLocEnd, - unsigned CommandID) { - ArrayRef<InlineCommandComment::Argument> Args; +InlineCommandComment * +Sema::actOnInlineCommand(SourceLocation CommandLocBegin, + SourceLocation CommandLocEnd, unsigned CommandID, + ArrayRef<Comment::Argument> Args) { StringRef CommandName = Traits.getCommandInfo(CommandID)->Name; - return new (Allocator) InlineCommandComment( - CommandLocBegin, - CommandLocEnd, - CommandID, - getInlineCommandRenderKind(CommandName), - Args); -} -InlineCommandComment *Sema::actOnInlineCommand(SourceLocation CommandLocBegin, - SourceLocation CommandLocEnd, - unsigned CommandID, - SourceLocation ArgLocBegin, - SourceLocation ArgLocEnd, - StringRef Arg) { - typedef InlineCommandComment::Argument Argument; - Argument *A = new (Allocator) Argument(SourceRange(ArgLocBegin, - ArgLocEnd), - Arg); - StringRef CommandName = Traits.getCommandInfo(CommandID)->Name; - - return new (Allocator) InlineCommandComment( - CommandLocBegin, - CommandLocEnd, - CommandID, - getInlineCommandRenderKind(CommandName), - llvm::makeArrayRef(A, 1)); + return new (Allocator) + InlineCommandComment(CommandLocBegin, CommandLocEnd, CommandID, + getInlineCommandRenderKind(CommandName), Args); } InlineContentComment *Sema::actOnUnknownCommand(SourceLocation LocBegin, |