12 #include "clang/AST/ASTContext.h"
20 SourceLocation AmpLocation = Var.getLocation();
22 if (!Token.is(tok::unknown))
23 AmpLocation = Lexer::getLocForEndOfToken(Token.getLocation(), 0,
24 Context.getSourceManager(),
25 Context.getLangOpts());
26 return FixItHint::CreateInsertion(AmpLocation,
"&");
30 return FixItHint::CreateInsertion(Var.getTypeSpecStartLoc(),
"const ");
ClangTidyContext & Context
FixItHint changeVarDeclToConst(const VarDecl &Var)
Creates fix to make VarDecl const qualified.
Token getPreviousNonCommentToken(const ASTContext &Context, SourceLocation Location)
Returns previous non-comment token skipping over any comment text or tok::unknown if not found...
FixItHint changeVarDeclToReference(const VarDecl &Var, ASTContext &Context)
Creates fix to make VarDecl a reference by adding &.