12 #include "clang/AST/ASTContext.h" 20 SourceLocation AmpLocation = Var.getLocation();
22 AmpLocation, Context.getSourceManager(), Context.getLangOpts());
23 if (!Token.is(tok::unknown))
24 AmpLocation = Lexer::getLocForEndOfToken(Token.getLocation(), 0,
25 Context.getSourceManager(),
26 Context.getLangOpts());
27 return FixItHint::CreateInsertion(AmpLocation,
"&");
31 return FixItHint::CreateInsertion(Var.getTypeSpecStartLoc(),
"const ");
Token getPreviousToken(SourceLocation Location, const SourceManager &SM, const LangOptions &LangOpts, bool SkipComments)
Returns previous token or tok::unknown if not found.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
FixItHint changeVarDeclToConst(const VarDecl &Var)
Creates fix to make VarDecl const qualified.
FixItHint changeVarDeclToReference(const VarDecl &Var, ASTContext &Context)
Creates fix to make VarDecl a reference by adding &.