forked from OSchip/llvm-project
[clang-tidy] Export the abseil duration inverse lookup function, NFC
This allows other tools to use this function. llvm-svn: 350133
This commit is contained in:
parent
1c6dbd6921
commit
4ce05801c7
|
@ -37,8 +37,7 @@ truncateIfIntegral(const FloatingLiteral &FloatLiteral) {
|
|||
return llvm::None;
|
||||
}
|
||||
|
||||
/// Given a `Scale` return the inverse functions for it.
|
||||
static const std::pair<llvm::StringRef, llvm::StringRef> &
|
||||
const std::pair<llvm::StringRef, llvm::StringRef> &
|
||||
getInverseForScale(DurationScale Scale) {
|
||||
static const llvm::IndexedMap<std::pair<llvm::StringRef, llvm::StringRef>,
|
||||
DurationScale2IndexFunctor>
|
||||
|
|
|
@ -63,6 +63,12 @@ simplifyDurationFactoryArg(const ast_matchers::MatchFinder::MatchResult &Result,
|
|||
/// return its `DurationScale`, or `None` if a match is not found.
|
||||
llvm::Optional<DurationScale> getScaleForInverse(llvm::StringRef Name);
|
||||
|
||||
/// Given a `Scale` return the fully qualified inverse functions for it.
|
||||
/// The first returned value is the inverse for `double`, and the second
|
||||
/// returned value is the inverse for `int64`.
|
||||
const std::pair<llvm::StringRef, llvm::StringRef> &
|
||||
getInverseForScale(DurationScale Scale);
|
||||
|
||||
/// Assuming `Node` has type `double` or `int` representing a time interval of
|
||||
/// `Scale`, return the expression to make it a suitable `Duration`.
|
||||
std::string rewriteExprFromNumberToDuration(
|
||||
|
|
Loading…
Reference in New Issue