23 return !clang::Lexer::makeFileCharRange(
24 clang::CharSourceRange::getCharRange(Range),
25 *Result.SourceManager, Result.Context->getLangOpts())
31 callExpr(callee(functionDecl(DurationFactoryFunction())),
32 hasArgument(0, anyOf(cxxStaticCastExpr(hasDestinationType(
33 realFloatingPointType())),
34 cStyleCastExpr(hasDestinationType(
35 realFloatingPointType())),
36 cxxFunctionalCastExpr(hasDestinationType(
37 realFloatingPointType())),
44 const auto *MatchedCall = Result.Nodes.getNodeAs<CallExpr>(
"call");
50 const Expr *Arg = MatchedCall->getArg(0)->IgnoreImpCasts();
52 if (Arg->getBeginLoc().isMacroID())
55 std::optional<std::string> SimpleArg =
stripFloatCast(Result, *Arg);
60 diag(MatchedCall->getBeginLoc(),
"use the integer version of absl::%0")
61 << MatchedCall->getDirectCallee()->getName()
62 << FixItHint::CreateReplacement(Arg->getSourceRange(), *SimpleArg);