clang-tools 19.0.0git
Namespaces | Enumerations | Functions
DurationRewriter.h File Reference
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/ASTMatchers/ASTMatchers.h"
#include <cinttypes>
#include <optional>

Go to the source code of this file.

Namespaces

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

Enumerations

enum class  clang::tidy::abseil::DurationScale : std::uint8_t {
  clang::tidy::abseil::Hours = 0 , clang::tidy::abseil::Minutes , clang::tidy::abseil::Seconds , clang::tidy::abseil::Milliseconds ,
  clang::tidy::abseil::Microseconds , clang::tidy::abseil::Nanoseconds
}
 Duration factory and conversion scales. More...
 

Functions

llvm::StringRef clang::tidy::abseil::getDurationFactoryForScale (DurationScale Scale)
 Returns the factory function name for a given Scale.
 
llvm::StringRef clang::tidy::abseil::getTimeFactoryForScale (DurationScale Scale)
 Given a 'Scale', return the appropriate factory function call for constructing a Time for that scale.
 
bool clang::tidy::abseil::isLiteralZero (const ast_matchers::MatchFinder::MatchResult &Result, const Expr &Node)
 
std::optional< std::string > clang::tidy::abseil::stripFloatCast (const ast_matchers::MatchFinder::MatchResult &Result, const Expr &Node)
 Possibly strip a floating point cast expression.
 
std::optional< std::string > clang::tidy::abseil::stripFloatLiteralFraction (const ast_matchers::MatchFinder::MatchResult &Result, const Expr &Node)
 Possibly remove the fractional part of a floating point literal.
 
std::string clang::tidy::abseil::simplifyDurationFactoryArg (const ast_matchers::MatchFinder::MatchResult &Result, const Expr &Node)
 Possibly further simplify a duration factory function's argument, without changing the scale of the factory function.
 
std::optional< DurationScale > clang::tidy::abseil::getScaleForDurationInverse (llvm::StringRef Name)
 Given the name of an inverse Duration function (e.g., ToDoubleSeconds), return its DurationScale, or std::nullopt if a match is not found.
 
std::optional< DurationScale > clang::tidy::abseil::getScaleForTimeInverse (llvm::StringRef Name)
 Given the name of an inverse Time function (e.g., ToUnixSeconds), return its DurationScale, or std::nullopt if a match is not found.
 
const std::pair< llvm::StringRef, llvm::StringRef > & clang::tidy::abseil::getDurationInverseForScale (DurationScale Scale)
 Given a Scale return the fully qualified inverse functions for it.
 
llvm::StringRef clang::tidy::abseil::getTimeInverseForScale (DurationScale Scale)
 Returns the Time factory function name for a given Scale.
 
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.
 
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.
 
bool clang::tidy::abseil::isInMacro (const ast_matchers::MatchFinder::MatchResult &Result, const Expr *E)
 Return false if E is a either: not a macro at all; or an argument to one.
 
 clang::tidy::abseil::AST_MATCHER_FUNCTION (ast_matchers::internal::Matcher< FunctionDecl >, DurationConversionFunction)
 
 clang::tidy::abseil::AST_MATCHER_FUNCTION (ast_matchers::internal::Matcher< FunctionDecl >, DurationFactoryFunction)
 
 clang::tidy::abseil::AST_MATCHER_FUNCTION (ast_matchers::internal::Matcher< FunctionDecl >, TimeConversionFunction)
 
 clang::tidy::abseil::AST_MATCHER_FUNCTION_P (ast_matchers::internal::Matcher< Stmt >, comparisonOperatorWithCallee, ast_matchers::internal::Matcher< Decl >, funcDecl)