Skip to content

Commit b623ed7

Browse files
committed
cleanup
1 parent 14302d9 commit b623ed7

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
@@ -1136,7 +1136,7 @@ class QualType {
11361136
/// Return true if this is a trivially relocatable type.
11371137
bool isTriviallyRelocatableType(const ASTContext &Context) const;
11381138

1139-
bool isCppTriviallyRelocatableType(const ASTContext &Context) const;
1139+
bool isCXXTriviallyRelocatableType(const ASTContext &Context) const;
11401140

11411141
bool isReplaceableType(const ASTContext &Context) const;
11421142

clang/lib/AST/Type.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2905,7 +2905,7 @@ bool QualType::isTriviallyRelocatableType(const ASTContext &Context) const {
29052905
return false;
29062906
} else if (const auto *RD = BaseElementType->getAsRecordDecl()) {
29072907
return RD->canPassInRegisters();
2908-
} else if (BaseElementType.isCppTriviallyRelocatableType(Context)) {
2908+
} else if (BaseElementType.isCXXTriviallyRelocatableType(Context)) {
29092909
return true;
29102910
} else {
29112911
switch (isNonTrivialToPrimitiveDestructiveMove()) {
@@ -2919,7 +2919,7 @@ bool QualType::isTriviallyRelocatableType(const ASTContext &Context) const {
29192919
}
29202920
}
29212921

2922-
bool QualType::isCppTriviallyRelocatableType(const ASTContext &Context) const {
2922+
bool QualType::isCXXTriviallyRelocatableType(const ASTContext &Context) const {
29232923
QualType BaseElementType = Context.getBaseElementType(*this);
29242924

29252925
if (hasNonTrivialObjCLifetime())

clang/lib/Parse/ParseDeclCXX.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3872,7 +3872,7 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc,
38723872
bool IsFinalSpelledSealed = false;
38733873
bool IsAbstract = false;
38743874
SourceLocation TriviallyRelocatable;
3875-
SourceLocation Replacable;
3875+
SourceLocation Replaceable;
38763876

38773877
// Parse the optional 'final' keyword.
38783878
if (getLangOpts().CPlusPlus && Tok.is(tok::identifier)) {
@@ -3889,19 +3889,19 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc,
38893889
ParseCXX2CTriviallyRelocatableSpecifier(TriviallyRelocatable);
38903890
}
38913891
continue;
3892-
} else if (isCXX2CReplaceableKeyword(Tok)) {
3893-
if (Replacable.isValid()) {
3892+
}
3893+
if (isCXX2CReplaceableKeyword(Tok)) {
3894+
if (Replaceable.isValid()) {
38943895
auto Skipped = Tok;
38953896
ConsumeToken();
38963897
Diag(Skipped, diag::err_duplicate_class_relocation_specifier)
3897-
<< /*replaceable*/ 1 << Replacable;
3898+
<< /*replaceable*/ 1 << Replaceable;
38983899
} else {
3899-
ParseCXX2CReplaceableSpecifier(Replacable);
3900+
ParseCXX2CReplaceableSpecifier(Replaceable);
39003901
}
39013902
continue;
3902-
} else {
3903-
break;
39043903
}
3904+
break;
39053905
}
39063906
if (isCXX11FinalKeyword()) {
39073907
if (FinalLoc.isValid()) {
@@ -3939,7 +3939,7 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc,
39393939
Diag(FinalLoc, diag::ext_warn_gnu_final);
39403940
}
39413941
assert((FinalLoc.isValid() || AbstractLoc.isValid() ||
3942-
TriviallyRelocatable.isValid() || Replacable.isValid()) &&
3942+
TriviallyRelocatable.isValid() || Replaceable.isValid()) &&
39433943
"not a class definition");
39443944

39453945
// Parse any C++11 attributes after 'final' keyword.
@@ -4014,7 +4014,7 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc,
40144014
if (TagDecl)
40154015
Actions.ActOnStartCXXMemberDeclarations(
40164016
getCurScope(), TagDecl, FinalLoc, IsFinalSpelledSealed, IsAbstract,
4017-
TriviallyRelocatable, Replacable, T.getOpenLocation());
4017+
TriviallyRelocatable, Replaceable, T.getOpenLocation());
40184018

40194019
// C++ 11p3: Members of a class defined with the keyword class are private
40204020
// 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
@@ -1940,7 +1940,7 @@ static ExprResult BuiltinTriviallyRelocate(Sema &S, CallExpr *TheCall) {
19401940
return ExprError();
19411941

19421942
if (T.isConstQualified() ||
1943-
!T.isCppTriviallyRelocatableType(S.getASTContext()) ||
1943+
!T.isCXXTriviallyRelocatableType(S.getASTContext()) ||
19441944
T->isIncompleteArrayType()) {
19451945
S.Diag(TheCall->getArg(0)->getExprLoc(),
19461946
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
@@ -7532,7 +7532,7 @@ static bool isEligibleForTrivialRelocation(Sema &SemaRef, CXXRecordDecl *D) {
75327532
continue;
75337533
// ... has a non-static data member of an object type that is not
75347534
// of a trivially relocatable type
7535-
if (!Field->getType().isCppTriviallyRelocatableType(
7535+
if (!Field->getType().isCXXTriviallyRelocatableType(
75367536
SemaRef.getASTContext()))
75377537
return false;
75387538
}
@@ -7569,10 +7569,6 @@ void Sema::CheckCXX2CRelocatableAndReplaceable(CXXRecordDecl *D) {
75697569

75707570
assert(D->hasDefinition());
75717571

7572-
bool MarkedCXX2CReplaceable = D->hasAttr<ReplaceableAttr>();
7573-
bool MarkedTriviallyRelocatable = D->hasAttr<TriviallyRelocatableAttr>();
7574-
7575-
75767572
// This is part of "eligible for replacement", however we defer it
75777573
// to avoid extraneous computations.
75787574
auto HasSuitableSMP = [&] {
@@ -7615,7 +7611,7 @@ void Sema::CheckCXX2CRelocatableAndReplaceable(CXXRecordDecl *D) {
76157611
return false;
76167612

76177613
// has the trivially_relocatable_if_eligible class-property-specifier,
7618-
if (MarkedTriviallyRelocatable)
7614+
if (D->hasAttr<TriviallyRelocatableAttr>())
76197615
return true;
76207616

76217617
// is a union with no user-declared special member functions, or
@@ -7640,7 +7636,7 @@ void Sema::CheckCXX2CRelocatableAndReplaceable(CXXRecordDecl *D) {
76407636
return false;
76417637

76427638
// has the replaceable_if_eligible class-property-specifier
7643-
if (MarkedCXX2CReplaceable)
7639+
if (D->hasAttr<ReplaceableAttr>())
76447640
return HasSuitableSMP();
76457641

76467642
// 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
@@ -6008,7 +6008,7 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, TypeTrait UTT,
60086008
case UTT_IsBitwiseCloneable:
60096009
return T.isBitwiseCloneableType(C);
60106010
case UTT_IsCppTriviallyRelocatable:
6011-
return T.isCppTriviallyRelocatableType(C);
6011+
return T.isCXXTriviallyRelocatableType(C);
60126012
case UTT_IsReplaceable:
60136013
return T.isReplaceableType(C);
60146014
case UTT_CanPassInRegs:

0 commit comments

Comments
 (0)