clang-tools 22.0.0git
clang::tidy::abseil::DurationFactoryScaleCheck Class Reference

This check finds cases where the incorrect Duration factory function is being used by looking for scaling constants inside the factory argument and suggesting a more appropriate factory. More...

#include <DurationFactoryScaleCheck.h>

Inheritance diagram for clang::tidy::abseil::DurationFactoryScaleCheck:
[legend]

Public Member Functions

 DurationFactoryScaleCheck (StringRef Name, ClangTidyContext *Context)
bool isLanguageVersionSupported (const LangOptions &LangOpts) const override
void registerMatchers (ast_matchers::MatchFinder *Finder) override
void check (const ast_matchers::MatchFinder::MatchResult &Result) override

Detailed Description

This check finds cases where the incorrect Duration factory function is being used by looking for scaling constants inside the factory argument and suggesting a more appropriate factory.

It also looks for the special case of zero and suggests ZeroDuration().

For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/abseil/duration-factory-scale.html

Definition at line 23 of file DurationFactoryScaleCheck.h.

Constructor & Destructor Documentation

◆ DurationFactoryScaleCheck()

clang::tidy::abseil::DurationFactoryScaleCheck::DurationFactoryScaleCheck ( StringRef Name,
ClangTidyContext * Context )
inline

Definition at line 25 of file DurationFactoryScaleCheck.h.

Member Function Documentation

◆ check()

void clang::tidy::abseil::DurationFactoryScaleCheck::check ( const ast_matchers::MatchFinder::MatchResult & Result)
override

◆ isLanguageVersionSupported()

bool clang::tidy::abseil::DurationFactoryScaleCheck::isLanguageVersionSupported ( const LangOptions & LangOpts) const
inlineoverride

Definition at line 27 of file DurationFactoryScaleCheck.h.

◆ registerMatchers()

void clang::tidy::abseil::DurationFactoryScaleCheck::registerMatchers ( ast_matchers::MatchFinder * Finder)
override

Definition at line 112 of file DurationFactoryScaleCheck.cpp.


The documentation for this class was generated from the following files: