#include <cmath>
#include <optional>
#include "DurationRewriter.h"
#include "clang/Tooling/FixIt.h"
#include "llvm/ADT/IndexedMap.h"
usingnamespaceclang::ast_matchers;
namespace clang::tidy::abseil {
struct DurationScale2IndexFunctor { … };
static std::optional<llvm::APSInt>
truncateIfIntegral(const FloatingLiteral &FloatLiteral) { … }
const std::pair<llvm::StringRef, llvm::StringRef> &
getDurationInverseForScale(DurationScale Scale) { … }
static std::optional<std::string>
rewriteInverseDurationCall(const MatchFinder::MatchResult &Result,
DurationScale Scale, const Expr &Node) { … }
static std::optional<std::string>
rewriteInverseTimeCall(const MatchFinder::MatchResult &Result,
DurationScale Scale, const Expr &Node) { … }
llvm::StringRef getDurationFactoryForScale(DurationScale Scale) { … }
llvm::StringRef getTimeFactoryForScale(DurationScale Scale) { … }
llvm::StringRef getTimeInverseForScale(DurationScale Scale) { … }
bool isLiteralZero(const MatchFinder::MatchResult &Result, const Expr &Node) { … }
std::optional<std::string>
stripFloatCast(const ast_matchers::MatchFinder::MatchResult &Result,
const Expr &Node) { … }
std::optional<std::string>
stripFloatLiteralFraction(const MatchFinder::MatchResult &Result,
const Expr &Node) { … }
std::string simplifyDurationFactoryArg(const MatchFinder::MatchResult &Result,
const Expr &Node) { … }
std::optional<DurationScale> getScaleForDurationInverse(llvm::StringRef Name) { … }
std::optional<DurationScale> getScaleForTimeInverse(llvm::StringRef Name) { … }
std::string rewriteExprFromNumberToDuration(
const ast_matchers::MatchFinder::MatchResult &Result, DurationScale Scale,
const Expr *Node) { … }
std::string rewriteExprFromNumberToTime(
const ast_matchers::MatchFinder::MatchResult &Result, DurationScale Scale,
const Expr *Node) { … }
bool isInMacro(const MatchFinder::MatchResult &Result, const Expr *E) { … }
}