diff options
author | dim <dim@FreeBSD.org> | 2013-06-10 20:45:12 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2013-06-10 20:45:12 +0000 |
commit | ea266cad53e3d49771fa38103913d3ec7a166694 (patch) | |
tree | 8f7776b7310bebaf415ac5b69e46e9f928c37144 /lib/AST/CommentParser.cpp | |
parent | c72c57c9e9b69944e3e009cd5e209634839581d3 (diff) | |
download | FreeBSD-src-ea266cad53e3d49771fa38103913d3ec7a166694.zip FreeBSD-src-ea266cad53e3d49771fa38103913d3ec7a166694.tar.gz |
Vendor import of clang tags/RELEASE_33/final r183502 (effectively, 3.3
release):
http://llvm.org/svn/llvm-project/cfe/tags/RELEASE_33/final@183502
Diffstat (limited to 'lib/AST/CommentParser.cpp')
-rw-r--r-- | lib/AST/CommentParser.cpp | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/lib/AST/CommentParser.cpp b/lib/AST/CommentParser.cpp index 09912c6..d89c79b 100644 --- a/lib/AST/CommentParser.cpp +++ b/lib/AST/CommentParser.cpp @@ -302,22 +302,18 @@ void Parser::parseBlockCommandArgs(BlockCommandComment *BC, BlockCommandComment *Parser::parseBlockCommand() { assert(Tok.is(tok::backslash_command) || Tok.is(tok::at_command)); - ParamCommandComment *PC; - TParamCommandComment *TPC; - BlockCommandComment *BC; - bool IsParam = false; - bool IsTParam = false; + ParamCommandComment *PC = 0; + TParamCommandComment *TPC = 0; + BlockCommandComment *BC = 0; const CommandInfo *Info = Traits.getCommandInfo(Tok.getCommandID()); CommandMarkerKind CommandMarker = Tok.is(tok::backslash_command) ? CMK_Backslash : CMK_At; if (Info->IsParamCommand) { - IsParam = true; PC = S.actOnParamCommandStart(Tok.getLocation(), Tok.getEndLocation(), Tok.getCommandID(), CommandMarker); } else if (Info->IsTParamCommand) { - IsTParam = true; TPC = S.actOnTParamCommandStart(Tok.getLocation(), Tok.getEndLocation(), Tok.getCommandID(), @@ -333,12 +329,11 @@ BlockCommandComment *Parser::parseBlockCommand() { if (isTokBlockCommand()) { // Block command ahead. We can't nest block commands, so pretend that this // command has an empty argument. - ParagraphComment *Paragraph = S.actOnParagraphComment( - ArrayRef<InlineContentComment *>()); - if (IsParam) { + ParagraphComment *Paragraph = S.actOnParagraphComment(None); + if (PC) { S.actOnParamCommandFinish(PC, Paragraph); return PC; - } else if (IsTParam) { + } else if (TPC) { S.actOnTParamCommandFinish(TPC, Paragraph); return TPC; } else { @@ -347,14 +342,14 @@ BlockCommandComment *Parser::parseBlockCommand() { } } - if (IsParam || IsTParam || Info->NumArgs > 0) { + if (PC || TPC || Info->NumArgs > 0) { // In order to parse command arguments we need to retokenize a few // following text tokens. TextTokenRetokenizer Retokenizer(Allocator, *this); - if (IsParam) + if (PC) parseParamCommandArgs(PC, Retokenizer); - else if (IsTParam) + else if (TPC) parseTParamCommandArgs(TPC, Retokenizer); else parseBlockCommandArgs(BC, Retokenizer, Info->NumArgs); @@ -376,7 +371,7 @@ BlockCommandComment *Parser::parseBlockCommand() { ParagraphComment *Paragraph; if (EmptyParagraph) - Paragraph = S.actOnParagraphComment(ArrayRef<InlineContentComment *>()); + Paragraph = S.actOnParagraphComment(None); else { BlockContentComment *Block = parseParagraphOrBlockCommand(); // Since we have checked for a block command, we should have parsed a @@ -384,10 +379,10 @@ BlockCommandComment *Parser::parseBlockCommand() { Paragraph = cast<ParagraphComment>(Block); } - if (IsParam) { + if (PC) { S.actOnParamCommandFinish(PC, Paragraph); return PC; - } else if (IsTParam) { + } else if (TPC) { S.actOnTParamCommandFinish(TPC, Paragraph); return TPC; } else { |