diff options
author | Dmitri Gribenko <gribozavr@gmail.com> | 2013-03-04 23:06:15 +0000 |
---|---|---|
committer | Dmitri Gribenko <gribozavr@gmail.com> | 2013-03-04 23:06:15 +0000 |
commit | bcf7f4d3bbd920d29a8e1ebca998ea9e21fe716d (patch) | |
tree | 1d2975f918c89343f48b071ac16b85cb930a08cf /clang/lib/AST/CommentParser.cpp | |
parent | 208b5beb60862ab7fd3dde5de77950ceb29290c4 (diff) | |
download | llvm-bcf7f4d3bbd920d29a8e1ebca998ea9e21fe716d.zip llvm-bcf7f4d3bbd920d29a8e1ebca998ea9e21fe716d.tar.gz llvm-bcf7f4d3bbd920d29a8e1ebca998ea9e21fe716d.tar.bz2 |
Comment parsing: refactor handling of command markers in AST
* Use the term 'command marker', because the semantics of 'backslash' and 'at'
commands are the same. (Talking about 'at commands' makes them look like a
special entity.)
* Sink the flag down into bitfields, reducing the size of AST nodes.
* Change the flag into an enum for clarity. Boolean function parameters are
not very clear.
* Add unittests for new tok::at_command tokens.
llvm-svn: 176461
Diffstat (limited to 'clang/lib/AST/CommentParser.cpp')
-rw-r--r-- | clang/lib/AST/CommentParser.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/AST/CommentParser.cpp b/clang/lib/AST/CommentParser.cpp index c6bd922..09912c6 100644 --- a/clang/lib/AST/CommentParser.cpp +++ b/clang/lib/AST/CommentParser.cpp @@ -308,23 +308,25 @@ BlockCommandComment *Parser::parseBlockCommand() { bool IsParam = false; bool IsTParam = false; 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(), - Tok.is(tok::at_command)); + CommandMarker); } else if (Info->IsTParamCommand) { IsTParam = true; TPC = S.actOnTParamCommandStart(Tok.getLocation(), Tok.getEndLocation(), Tok.getCommandID(), - Tok.is(tok::at_command)); + CommandMarker); } else { BC = S.actOnBlockCommandStart(Tok.getLocation(), Tok.getEndLocation(), Tok.getCommandID(), - Tok.is(tok::at_command)); + CommandMarker); } consumeToken(); |