Skip to content

Commit 26369d1

Browse files
committed
const-qualify values and remove unused member
1 parent 8ef1f30 commit 26369d1

File tree

2 files changed

+4
-15
lines changed

2 files changed

+4
-15
lines changed

clang-tools-extra/clang-tidy/google/FloatTypesCheck.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ AST_MATCHER(FloatingLiteral, isFLValidAndNotInMacro) {
2828

2929
AST_MATCHER(TypeLoc, isLongDoubleType) {
3030
TypeLoc TL = Node;
31-
if (auto QualLoc = Node.getAs<QualifiedTypeLoc>())
31+
if (const auto QualLoc = Node.getAs<QualifiedTypeLoc>())
3232
TL = QualLoc.getUnqualifiedLoc();
3333

3434
const auto BuiltinLoc = TL.getAs<BuiltinTypeLoc>();
@@ -39,7 +39,7 @@ AST_MATCHER(TypeLoc, isLongDoubleType) {
3939
}
4040

4141
AST_MATCHER(FloatingLiteral, isLongDoubleLiteral) {
42-
if (auto *BT = dyn_cast<BuiltinType>(Node.getType().getTypePtr()))
42+
if (const auto *BT = dyn_cast<BuiltinType>(Node.getType().getTypePtr()))
4343
return BT->getKind() == BuiltinType::LongDouble;
4444
return false;
4545
}
@@ -57,7 +57,6 @@ void RuntimeFloatCheck::registerMatchers(MatchFinder *Finder) {
5757
floatLiteral(isFLValidAndNotInMacro(), isLongDoubleLiteral())
5858
.bind("longDoubleFloatLiteral"),
5959
this);
60-
IdentTable = std::make_unique<IdentifierTable>(getLangOpts());
6160
}
6261

6362
void RuntimeFloatCheck::check(const MatchFinder::MatchResult &Result) {

clang-tools-extra/clang-tidy/google/FloatTypesCheck.h

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
//===----------------------------------------------------------------------===//
32
//
43
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
@@ -12,11 +11,7 @@
1211

1312
#include "../ClangTidyCheck.h"
1413

15-
namespace clang {
16-
17-
class IdentifierTable;
18-
19-
namespace tidy::google::runtime {
14+
namespace clang::tidy::google::runtime {
2015

2116
/// Finds usages of `long double` and suggests replacing them with other
2217
/// floating-point types.
@@ -32,13 +27,8 @@ class RuntimeFloatCheck : public ClangTidyCheck {
3227
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
3328
return LangOpts.CPlusPlus && !LangOpts.ObjC;
3429
}
35-
36-
private:
37-
std::unique_ptr<IdentifierTable> IdentTable;
3830
};
3931

40-
} // namespace tidy::google::runtime
41-
42-
} // namespace clang
32+
} // namespace clang::tidy::google::runtime
4333

4434
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_FLOATTYPESCHECK_H

0 commit comments

Comments
 (0)