[PATCH] cpp11-migrate: Add override specifier before comments on inline methods
Edwin Vane
edwin.vane at intel.com
Mon May 13 06:37:31 PDT 2013
Few small things to fix.
================
Comment at: cpp11-migrate/AddOverride/AddOverrideActions.cpp:43
@@ +42,3 @@
+ Lexer::GetBeginningOfToken(Loc, SM, Context.getLangOpts());
+ if (Lexer::getRawToken(Beginning, Tok, SM, Context.getLangOpts()) ||
+ Tok.getKind() != tok::comment)
----------------
I would call getRawToken() and assert it's return value is true. I can't imagine failures being a good thing. Just don't call the function within the assert itself.
================
Comment at: cpp11-migrate/AddOverride/AddOverrideActions.cpp:53
@@ -30,2 +52,3 @@
SourceManager &SM = *Result.SourceManager;
+ const ASTContext &Context = *Result.Context;
----------------
Variables should be declared as close to where they are used as possible. In this case, Context is not needed until the call to backwardSkipWhitespacesAndComments(). In this case you can just avoid the variable completely.
http://llvm-reviews.chandlerc.com/D782
More information about the cfe-commits
mailing list