clang-tools  14.0.0git
Classes | Namespaces | Functions
DurationRewriter.cpp File Reference
#include "DurationRewriter.h"
#include "clang/Tooling/FixIt.h"
#include "llvm/ADT/IndexedMap.h"
Include dependency graph for DurationRewriter.cpp:

Go to the source code of this file.

Classes

struct  clang::tidy::abseil::DurationScale2IndexFunctor
 

Namespaces

 clang
 ===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
 
 clang::tidy
 
 clang::tidy::abseil
 

Functions

static llvm::Optional< llvm::APSInt > clang::tidy::abseil::truncateIfIntegral (const FloatingLiteral &FloatLiteral)
 Returns an integer if the fractional part of a FloatingLiteral is 0. More...
 
const std::pair< llvm::StringRef, llvm::StringRef > & clang::tidy::abseil::getDurationInverseForScale (DurationScale Scale)
 Given a Scale return the fully qualified inverse functions for it. More...
 
static llvm::Optional< std::string > clang::tidy::abseil::rewriteInverseDurationCall (const MatchFinder::MatchResult &Result, DurationScale Scale, const Expr &Node)
 If Node is a call to the inverse of Scale, return that inverse's argument, otherwise None. More...
 
static llvm::Optional< std::string > clang::tidy::abseil::rewriteInverseTimeCall (const MatchFinder::MatchResult &Result, DurationScale Scale, const Expr &Node)
 If Node is a call to the inverse of Scale, return that inverse's argument, otherwise None. More...
 
llvm::StringRef clang::tidy::abseil::getDurationFactoryForScale (DurationScale Scale)
 Returns the factory function name for a given Scale. More...
 
llvm::StringRef clang::tidy::abseil::getTimeFactoryForScale (DurationScale Scale)
 Given a 'Scale', return the appropriate factory function call for constructing a Time for that scale. More...
 
llvm::StringRef clang::tidy::abseil::getTimeInverseForScale (DurationScale Scale)
 Returns the Time factory function name for a given Scale. More...
 
bool clang::tidy::abseil::isLiteralZero (const MatchFinder::MatchResult &Result, const Expr &Node)
 Returns true if Node is a value which evaluates to a literal 0. More...
 
llvm::Optional< std::string > clang::tidy::abseil::stripFloatCast (const ast_matchers::MatchFinder::MatchResult &Result, const Expr &Node)
 Possibly strip a floating point cast expression. More...
 
llvm::Optional< std::string > clang::tidy::abseil::stripFloatLiteralFraction (const MatchFinder::MatchResult &Result, const Expr &Node)
 
std::string clang::tidy::abseil::simplifyDurationFactoryArg (const MatchFinder::MatchResult &Result, const Expr &Node)
 
llvm::Optional< DurationScale > clang::tidy::abseil::getScaleForDurationInverse (llvm::StringRef Name)
 Given the name of an inverse Duration function (e.g., ToDoubleSeconds), return its DurationScale, or None if a match is not found. More...
 
llvm::Optional< DurationScale > clang::tidy::abseil::getScaleForTimeInverse (llvm::StringRef Name)
 Given the name of an inverse Time function (e.g., ToUnixSeconds), return its DurationScale, or None if a match is not found. More...
 
std::string clang::tidy::abseil::rewriteExprFromNumberToDuration (const ast_matchers::MatchFinder::MatchResult &Result, DurationScale Scale, const Expr *Node)
 Assuming Node has type double or int representing a time interval of Scale, return the expression to make it a suitable Duration. More...
 
std::string clang::tidy::abseil::rewriteExprFromNumberToTime (const ast_matchers::MatchFinder::MatchResult &Result, DurationScale Scale, const Expr *Node)
 Assuming Node has a type int representing a time instant of Scale since The Epoch, return the expression to make it a suitable Time. More...
 
bool clang::tidy::abseil::isInMacro (const MatchFinder::MatchResult &Result, const Expr *E)