Skip to content

Commit 94eb978

Browse files
committed
cleanup
1 parent ee53387 commit 94eb978

File tree

6 files changed

+17
-21
lines changed

6 files changed

+17
-21
lines changed

clang/include/clang/AST/Type.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,7 @@ class QualType {
11291129
/// Return true if this is a trivially relocatable type.
11301130
bool isTriviallyRelocatableType(const ASTContext &Context) const;
11311131

1132-
bool isCppTriviallyRelocatableType(const ASTContext &Context) const;
1132+
bool isCXXTriviallyRelocatableType(const ASTContext &Context) const;
11331133

11341134
bool isReplaceableType(const ASTContext &Context) const;
11351135

clang/lib/AST/Type.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2848,7 +2848,7 @@ bool QualType::isTriviallyRelocatableType(const ASTContext &Context) const {
28482848
return false;
28492849
} else if (const auto *RD = BaseElementType->getAsRecordDecl()) {
28502850
return RD->canPassInRegisters();
2851-
} else if (BaseElementType.isCppTriviallyRelocatableType(Context)) {
2851+
} else if (BaseElementType.isCXXTriviallyRelocatableType(Context)) {
28522852
return true;
28532853
} else {
28542854
switch (isNonTrivialToPrimitiveDestructiveMove()) {
@@ -2862,7 +2862,7 @@ bool QualType::isTriviallyRelocatableType(const ASTContext &Context) const {
28622862
}
28632863
}
28642864

2865-
bool QualType::isCppTriviallyRelocatableType(const ASTContext &Context) const {
2865+
bool QualType::isCXXTriviallyRelocatableType(const ASTContext &Context) const {
28662866
QualType BaseElementType = Context.getBaseElementType(*this);
28672867

28682868
if (hasNonTrivialObjCLifetime())

clang/lib/Parse/ParseDeclCXX.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3868,7 +3868,7 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc,
38683868
bool IsFinalSpelledSealed = false;
38693869
bool IsAbstract = false;
38703870
SourceLocation TriviallyRelocatable;
3871-
SourceLocation Replacable;
3871+
SourceLocation Replaceable;
38723872

38733873
// Parse the optional 'final' keyword.
38743874
if (getLangOpts().CPlusPlus && Tok.is(tok::identifier)) {
@@ -3885,19 +3885,19 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc,
38853885
ParseCXX2CTriviallyRelocatableSpecifier(TriviallyRelocatable);
38863886
}
38873887
continue;
3888-
} else if (isCXX2CReplaceableKeyword(Tok)) {
3889-
if (Replacable.isValid()) {
3888+
}
3889+
if (isCXX2CReplaceableKeyword(Tok)) {
3890+
if (Replaceable.isValid()) {
38903891
auto Skipped = Tok;
38913892
ConsumeToken();
38923893
Diag(Skipped, diag::err_duplicate_class_relocation_specifier)
3893-
<< /*replaceable*/ 1 << Replacable;
3894+
<< /*replaceable*/ 1 << Replaceable;
38943895
} else {
3895-
ParseCXX2CReplaceableSpecifier(Replacable);
3896+
ParseCXX2CReplaceableSpecifier(Replaceable);
38963897
}
38973898
continue;
3898-
} else {
3899-
break;
39003899
}
3900+
break;
39013901
}
39023902
if (isCXX11FinalKeyword()) {
39033903
if (FinalLoc.isValid()) {
@@ -3935,7 +3935,7 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc,
39353935
Diag(FinalLoc, diag::ext_warn_gnu_final);
39363936
}
39373937
assert((FinalLoc.isValid() || AbstractLoc.isValid() ||
3938-
TriviallyRelocatable.isValid() || Replacable.isValid()) &&
3938+
TriviallyRelocatable.isValid() || Replaceable.isValid()) &&
39393939
"not a class definition");
39403940

39413941
// Parse any C++11 attributes after 'final' keyword.
@@ -4010,7 +4010,7 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc,
40104010
if (TagDecl)
40114011
Actions.ActOnStartCXXMemberDeclarations(
40124012
getCurScope(), TagDecl, FinalLoc, IsFinalSpelledSealed, IsAbstract,
4013-
TriviallyRelocatable, Replacable, T.getOpenLocation());
4013+
TriviallyRelocatable, Replaceable, T.getOpenLocation());
40144014

40154015
// C++ 11p3: Members of a class defined with the keyword class are private
40164016
// by default. Members of a class defined with the keywords struct or union

clang/lib/Sema/SemaChecking.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1896,7 +1896,7 @@ static ExprResult BuiltinTriviallyRelocate(Sema &S, CallExpr *TheCall) {
18961896
return ExprError();
18971897

18981898
if (T.isConstQualified() ||
1899-
!T.isCppTriviallyRelocatableType(S.getASTContext()) ||
1899+
!T.isCXXTriviallyRelocatableType(S.getASTContext()) ||
19001900
T->isIncompleteArrayType()) {
19011901
S.Diag(TheCall->getArg(0)->getExprLoc(),
19021902
diag::err_builtin_trivially_relocate_invalid_arg_type)

clang/lib/Sema/SemaDeclCXX.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7421,7 +7421,7 @@ static bool isEligibleForTrivialRelocation(Sema &SemaRef, CXXRecordDecl *D) {
74217421
continue;
74227422
// ... has a non-static data member of an object type that is not
74237423
// of a trivially relocatable type
7424-
if (!Field->getType().isCppTriviallyRelocatableType(
7424+
if (!Field->getType().isCXXTriviallyRelocatableType(
74257425
SemaRef.getASTContext()))
74267426
return false;
74277427
}
@@ -7458,10 +7458,6 @@ void Sema::CheckCXX2CRelocatableAndReplaceable(CXXRecordDecl *D) {
74587458

74597459
assert(D->hasDefinition());
74607460

7461-
bool MarkedCXX2CReplaceable = D->hasAttr<ReplaceableAttr>();
7462-
bool MarkedTriviallyRelocatable = D->hasAttr<TriviallyRelocatableAttr>();
7463-
7464-
74657461
// This is part of "eligible for replacement", however we defer it
74667462
// to avoid extraneous computations.
74677463
auto HasSuitableSMP = [&] {
@@ -7504,7 +7500,7 @@ void Sema::CheckCXX2CRelocatableAndReplaceable(CXXRecordDecl *D) {
75047500
return false;
75057501

75067502
// has the trivially_relocatable_if_eligible class-property-specifier,
7507-
if (MarkedTriviallyRelocatable)
7503+
if (D->hasAttr<TriviallyRelocatableAttr>())
75087504
return true;
75097505

75107506
// is a union with no user-declared special member functions, or
@@ -7529,7 +7525,7 @@ void Sema::CheckCXX2CRelocatableAndReplaceable(CXXRecordDecl *D) {
75297525
return false;
75307526

75317527
// has the replaceable_if_eligible class-property-specifier
7532-
if (MarkedCXX2CReplaceable)
7528+
if (D->hasAttr<ReplaceableAttr>())
75337529
return HasSuitableSMP();
75347530

75357531
// is a union with no user-declared special member functions, or

clang/lib/Sema/SemaExprCXX.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5681,7 +5681,7 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, TypeTrait UTT,
56815681
case UTT_IsBitwiseCloneable:
56825682
return T.isBitwiseCloneableType(C);
56835683
case UTT_IsCppTriviallyRelocatable:
5684-
return T.isCppTriviallyRelocatableType(C);
5684+
return T.isCXXTriviallyRelocatableType(C);
56855685
case UTT_IsReplaceable:
56865686
return T.isReplaceableType(C);
56875687
case UTT_CanPassInRegs:

0 commit comments

Comments
 (0)