File tree Expand file tree Collapse file tree 2 files changed +4
-15
lines changed Expand file tree Collapse file tree 2 files changed +4
-15
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ AST_MATCHER(FloatingLiteral, isFLValidAndNotInMacro) {
2828
2929AST_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
4141AST_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
6362void RuntimeFloatCheck::check (const MatchFinder::MatchResult &Result) {
Original file line number Diff line number Diff line change 1-
21// ===----------------------------------------------------------------------===//
32//
43// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
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
You can’t perform that action at this time.
0 commit comments