Skip to content

Commit 25425cc

Browse files
committed
Other renaming for portability change
1 parent d5fd2e7 commit 25425cc

File tree

9 files changed

+52
-52
lines changed

9 files changed

+52
-52
lines changed

clang-tools-extra/clang-tidy/modernize/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ set(LLVM_LINK_COMPONENTS
66
add_clang_library(clangTidyModernizeModule STATIC
77
AvoidBindCheck.cpp
88
AvoidCArraysCheck.cpp
9-
AvoidFundamentalIntegerTypesCheck.cpp
109
ConcatNestedNamespacesCheck.cpp
1110
DeprecatedHeadersCheck.cpp
1211
DeprecatedIosBaseAliasesCheck.cpp

clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include "../ClangTidyModuleRegistry.h"
1212
#include "AvoidBindCheck.h"
1313
#include "AvoidCArraysCheck.h"
14-
#include "AvoidFundamentalIntegerTypesCheck.h"
1514
#include "ConcatNestedNamespacesCheck.h"
1615
#include "DeprecatedHeadersCheck.h"
1716
#include "DeprecatedIosBaseAliasesCheck.h"
@@ -64,8 +63,6 @@ class ModernizeModule : public ClangTidyModule {
6463
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
6564
CheckFactories.registerCheck<AvoidBindCheck>("modernize-avoid-bind");
6665
CheckFactories.registerCheck<AvoidCArraysCheck>("modernize-avoid-c-arrays");
67-
CheckFactories.registerCheck<AvoidFundamentalIntegerTypesCheck>(
68-
"modernize-avoid-fundamental-integer-types");
6966
CheckFactories.registerCheck<ConcatNestedNamespacesCheck>(
7067
"modernize-concat-nested-namespaces");
7168
CheckFactories.registerCheck<DeprecatedHeadersCheck>(

clang-tools-extra/clang-tidy/portability/AvoidPlatformSpecificFundamentalTypesCheck.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
//===--- AvoidFundamentalIntegerTypesCheck.cpp - clang-tidy ---------------===//
1+
//===--- AvoidPlatformSpecificFundamentalTypesCheck.cpp - clang-tidy ---------------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include "AvoidFundamentalIntegerTypesCheck.h"
9+
#include "AvoidPlatformSpecificFundamentalTypesCheck.h"
1010
#include "clang/AST/ASTContext.h"
1111
#include "clang/ASTMatchers/ASTMatchFinder.h"
1212
#include "clang/ASTMatchers/ASTMatchers.h"
1313

1414
using namespace clang::ast_matchers;
1515

16-
namespace clang::tidy::modernize {
16+
namespace clang::tidy::portability {
1717

1818
namespace {
1919

@@ -31,11 +31,11 @@ AST_MATCHER_P(clang::TypeLoc, hasType,
3131

3232
} // namespace
3333

34-
AvoidFundamentalIntegerTypesCheck::AvoidFundamentalIntegerTypesCheck(
34+
AvoidPlatformSpecificFundamentalTypesCheck::AvoidPlatformSpecificFundamentalTypesCheck(
3535
StringRef Name, ClangTidyContext *Context)
3636
: ClangTidyCheck(Name, Context) {}
3737

38-
bool AvoidFundamentalIntegerTypesCheck::isFundamentalIntegerType(
38+
bool AvoidPlatformSpecificFundamentalTypesCheck::isFundamentalIntegerType(
3939
const Type *T) const {
4040
if (!T->isBuiltinType())
4141
return false;
@@ -59,7 +59,7 @@ bool AvoidFundamentalIntegerTypesCheck::isFundamentalIntegerType(
5959
}
6060
}
6161

62-
bool AvoidFundamentalIntegerTypesCheck::isSemanticType(const Type *T) const {
62+
bool AvoidPlatformSpecificFundamentalTypesCheck::isSemanticType(const Type *T) const {
6363
if (!T->isBuiltinType())
6464
return false;
6565

@@ -84,7 +84,7 @@ bool AvoidFundamentalIntegerTypesCheck::isSemanticType(const Type *T) const {
8484
}
8585
}
8686

87-
void AvoidFundamentalIntegerTypesCheck::registerMatchers(MatchFinder *Finder) {
87+
void AvoidPlatformSpecificFundamentalTypesCheck::registerMatchers(MatchFinder *Finder) {
8888
// Match variable declarations with fundamental integer types
8989
Finder->addMatcher(
9090
varDecl().bind("var_decl"),
@@ -115,7 +115,7 @@ void AvoidFundamentalIntegerTypesCheck::registerMatchers(MatchFinder *Finder) {
115115
this);
116116
}
117117

118-
void AvoidFundamentalIntegerTypesCheck::check(
118+
void AvoidPlatformSpecificFundamentalTypesCheck::check(
119119
const MatchFinder::MatchResult &Result) {
120120
SourceLocation Loc;
121121
QualType QT;
@@ -178,4 +178,4 @@ void AvoidFundamentalIntegerTypesCheck::check(
178178
<< TypeName;
179179
}
180180

181-
} // namespace clang::tidy::modernize
181+
} // namespace clang::tidy::portability
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
//===--- AvoidFundamentalIntegerTypesCheck.h - clang-tidy -------*- C++ -*-===//
1+
//===--- AvoidPlatformSpecificFundamentalTypesCheck.h - clang-tidy -------*- C++ -*-===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_AVOIDFUNDAMENTALINTEGERTYPESCHECK_H
10-
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_AVOIDFUNDAMENTALINTEGERTYPESCHECK_H
9+
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PORTABILITY_AVOIDPLATFORMSPECIFICFUNDAMENTALTYPESCHECK_H
10+
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PORTABILITY_AVOIDPLATFORMSPECIFICFUNDAMENTALTYPESCHECK_H
1111

1212
#include "../ClangTidyCheck.h"
1313

14-
namespace clang::tidy::modernize {
14+
namespace clang::tidy::portability {
1515

1616
/// Find fundamental integer types and recommend using typedefs or fixed-width types.
1717
///
@@ -21,10 +21,10 @@ namespace clang::tidy::modernize {
2121
/// char32_t, size_t, and ptrdiff_t.
2222
///
2323
/// For the user-facing documentation see:
24-
/// http://clang.llvm.org/extra/clang-tidy/checks/modernize/avoid-fundamental-integer-types.html
25-
class AvoidFundamentalIntegerTypesCheck : public ClangTidyCheck {
24+
/// http://clang.llvm.org/extra/clang-tidy/checks/portability/avoid-platform-specific-fundamental-types.html
25+
class AvoidPlatformSpecificFundamentalTypesCheck : public ClangTidyCheck {
2626
public:
27-
AvoidFundamentalIntegerTypesCheck(StringRef Name, ClangTidyContext *Context);
27+
AvoidPlatformSpecificFundamentalTypesCheck(StringRef Name, ClangTidyContext *Context);
2828
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
2929
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
3030
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
@@ -39,6 +39,6 @@ class AvoidFundamentalIntegerTypesCheck : public ClangTidyCheck {
3939
bool isSemanticType(const Type *T) const;
4040
};
4141

42-
} // namespace clang::tidy::modernize
42+
} // namespace clang::tidy::portability
4343

44-
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_AVOIDFUNDAMENTALINTEGERTYPESCHECK_H
44+
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PORTABILITY_AVOIDPLATFORMSPECIFICFUNDAMENTALTYPESCHECK_H

clang-tools-extra/clang-tidy/portability/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ set(LLVM_LINK_COMPONENTS
55
)
66

77
add_clang_library(clangTidyPortabilityModule STATIC
8+
AvoidPlatformSpecificFundamentalTypesCheck.cpp
89
AvoidPragmaOnceCheck.cpp
910
PortabilityTidyModule.cpp
1011
RestrictSystemIncludesCheck.cpp

clang-tools-extra/clang-tidy/portability/PortabilityTidyModule.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "../ClangTidy.h"
1010
#include "../ClangTidyModule.h"
1111
#include "../ClangTidyModuleRegistry.h"
12+
#include "AvoidPlatformSpecificFundamentalTypesCheck.h"
1213
#include "AvoidPragmaOnceCheck.h"
1314
#include "RestrictSystemIncludesCheck.h"
1415
#include "SIMDIntrinsicsCheck.h"
@@ -21,6 +22,8 @@ namespace portability {
2122
class PortabilityModule : public ClangTidyModule {
2223
public:
2324
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
25+
CheckFactories.registerCheck<AvoidPlatformSpecificFundamentalTypesCheck>(
26+
"portability-avoid-platform-specific-fundamental-types");
2427
CheckFactories.registerCheck<AvoidPragmaOnceCheck>(
2528
"portability-avoid-pragma-once");
2629
CheckFactories.registerCheck<RestrictSystemIncludesCheck>(

clang-tools-extra/docs/clang-tidy/checks/list.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,6 @@ Clang-Tidy Checks
280280
:doc:`misc-use-internal-linkage <misc/use-internal-linkage>`, "Yes"
281281
:doc:`modernize-avoid-bind <modernize/avoid-bind>`, "Yes"
282282
:doc:`modernize-avoid-c-arrays <modernize/avoid-c-arrays>`,
283-
:doc:`modernize-avoid-fundamental-integer-types <modernize/avoid-fundamental-integer-types>`,
284283
:doc:`modernize-concat-nested-namespaces <modernize/concat-nested-namespaces>`, "Yes"
285284
:doc:`modernize-deprecated-headers <modernize/deprecated-headers>`, "Yes"
286285
:doc:`modernize-deprecated-ios-base-aliases <modernize/deprecated-ios-base-aliases>`, "Yes"
@@ -354,6 +353,7 @@ Clang-Tidy Checks
354353
:doc:`performance-type-promotion-in-math-fn <performance/type-promotion-in-math-fn>`, "Yes"
355354
:doc:`performance-unnecessary-copy-initialization <performance/unnecessary-copy-initialization>`, "Yes"
356355
:doc:`performance-unnecessary-value-param <performance/unnecessary-value-param>`, "Yes"
356+
:doc:`portability-avoid-platform-specific-fundamental-types <portability/avoid-platform-specific-fundamental-types>`,
357357
:doc:`portability-avoid-pragma-once <portability/avoid-pragma-once>`,
358358
:doc:`portability-restrict-system-includes <portability/restrict-system-includes>`, "Yes"
359359
:doc:`portability-simd-intrinsics <portability/simd-intrinsics>`,

clang-tools-extra/docs/clang-tidy/checks/portability/avoid-platform-specific-fundamental-types.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
.. title:: clang-tidy - modernize-avoid-fundamental-integer-types
1+
.. title:: clang-tidy - portability-avoid-platform-specific-fundamental-types
22

3-
modernize-avoid-fundamental-integer-types
3+
portability-avoid-platform-specific-fundamental-types
44
==========================================
55

6-
Finds fundamental integer types and recommends using typedefs or fixed-width types instead.
6+
Finds fundamental types and recommends using typedefs or fixed-width types instead.
77

88
This check detects fundamental integer types (``int``, ``short``, ``long``, ``long long``, and their
99
``unsigned`` variants) and warns against their use due to non-standard platform-dependent behavior.

0 commit comments

Comments
 (0)