11 #include "clang/AST/ASTContext.h" 19 SourceLocation AmpLocation = Var.getLocation();
21 AmpLocation, Context.getSourceManager(), Context.getLangOpts());
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 ");
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 &.