diff options
author | Chris Lattner <sabre@nondot.org> | 2009-12-10 00:44:03 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-12-10 00:44:03 +0000 |
commit | 570138662048bf4c5d3f4612a814fa132ac34eb2 (patch) | |
tree | 91c3502c6589717e27ad153c3991c7def4bdb626 /clang/lib/Parse/RAIIObjectsForParser.h | |
parent | 125c0ee5c7769c3db19838ac7184bb705d746aef (diff) | |
download | bcm5719-llvm-570138662048bf4c5d3f4612a814fa132ac34eb2.tar.gz bcm5719-llvm-570138662048bf4c5d3f4612a814fa132ac34eb2.zip |
move GreaterThanIsOperatorScope into RAIIObjectsForParser. Add some more
TODOs for other classes that could be moved out of Parser.h. I don't plan
to do these in the near term though.
llvm-svn: 91023
Diffstat (limited to 'clang/lib/Parse/RAIIObjectsForParser.h')
-rw-r--r-- | clang/lib/Parse/RAIIObjectsForParser.h | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/clang/lib/Parse/RAIIObjectsForParser.h b/clang/lib/Parse/RAIIObjectsForParser.h index bacdf29c8ae..93b9a82fdca 100644 --- a/clang/lib/Parse/RAIIObjectsForParser.h +++ b/clang/lib/Parse/RAIIObjectsForParser.h @@ -18,7 +18,11 @@ #include "clang/Parse/ParseDiagnostic.h" namespace clang { - + // TODO: move ParsingDeclRAIIObject here. + // TODO: move ParsingClassDefinition here. + // TODO: move TentativeParsingAction here. + + /// ExtensionRAIIObject - This saves the state of extension warnings when /// constructed and disables them. When destructed, it restores them back to /// the way they used to be. This is used to handle __extension__ in the @@ -37,8 +41,6 @@ namespace clang { } }; - // TODO: move GreaterThanIsOperatorScope here. - /// ColonProtectionRAIIObject - This sets the Parser::ColonIsSacred bool and /// restores it when destroyed. This says that "foo:" should not be /// considered a possible typo for "foo::" for error recovery purposes. @@ -61,6 +63,22 @@ namespace clang { } }; + /// \brief RAII object that makes '>' behave either as an operator + /// or as the closing angle bracket for a template argument list. + struct GreaterThanIsOperatorScope { + bool &GreaterThanIsOperator; + bool OldGreaterThanIsOperator; + + GreaterThanIsOperatorScope(bool >IO, bool Val) + : GreaterThanIsOperator(GTIO), OldGreaterThanIsOperator(GTIO) { + GreaterThanIsOperator = Val; + } + + ~GreaterThanIsOperatorScope() { + GreaterThanIsOperator = OldGreaterThanIsOperator; + } + }; + } // end namespace clang #endif |