Skip to content

Commit fe01536

Browse files
committed
Remove __ptrauth_restricted_intptr from docs and diagnostic message
1 parent 8f2fa5a commit fe01536

File tree

5 files changed

+7
-12
lines changed

5 files changed

+7
-12
lines changed

clang/include/clang/Basic/AttrDocs.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2128,7 +2128,7 @@ Also see the documentation for `@available
21282128

21292129
def PtrAuthDocs : Documentation {
21302130
let Category = DocCatVariable;
2131-
let Heading = "__ptrauth, __ptrauth_restricted_intptr";
2131+
let Heading = "__ptrauth";
21322132
let Content = [{
21332133
The ``__ptrauth`` qualifier allows the programmer to directly control
21342134
how pointers are signed when they are stored in a particular variable.

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ def err_ptrauth_indirect_goto_addrlabel_arithmetic : Error<
976976

977977
// __ptrauth qualifier
978978
def err_ptrauth_qualifier_invalid : Error<
979-
"%select{return types|parameter types|properties}2 may not be qualified with %select{__ptrauth|__ptrauth_restricted_intptr}1; type is %0">;
979+
"%select{return types|parameter types|properties}1 may not be qualified with __ptrauth; type is %0">;
980980
def err_ptrauth_qualifier_cast : Error<
981981
"cast types may not be qualified with __ptrauth; type is %0">;
982982
def err_ptrauth_qualifier_nonpointer : Error<

clang/lib/Sema/SemaDecl.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15268,8 +15268,7 @@ ParmVarDecl *Sema::CheckParameter(DeclContext *DC, SourceLocation StartLoc,
1526815268

1526915269
// __ptrauth is forbidden on parameters.
1527015270
if (T.getPointerAuth()) {
15271-
Diag(NameLoc, diag::err_ptrauth_qualifier_invalid)
15272-
<< T << (int)!T->isSignableType() << 1;
15271+
Diag(NameLoc, diag::err_ptrauth_qualifier_invalid) << T << 1;
1527315272
New->setInvalidDecl();
1527415273
}
1527515274

clang/lib/Sema/SemaObjCProperty.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,7 @@ Decl *SemaObjC::ActOnProperty(Scope *S, SourceLocation AtLoc,
181181
TypeSourceInfo *TSI = SemaRef.GetTypeForDeclarator(FD.D);
182182
QualType T = TSI->getType();
183183
if (T.getPointerAuth().isPresent()) {
184-
Diag(AtLoc, diag::err_ptrauth_qualifier_invalid)
185-
<< T << (int)!T->isSignableType() << 2;
184+
Diag(AtLoc, diag::err_ptrauth_qualifier_invalid) << T << 2;
186185
}
187186
if (!getOwnershipRule(Attributes)) {
188187
Attributes |= deducePropertyOwnershipFromType(SemaRef, T);

clang/lib/Sema/SemaType.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2550,8 +2550,7 @@ bool Sema::CheckFunctionReturnType(QualType T, SourceLocation Loc) {
25502550

25512551
// __ptrauth is illegal on a function return type.
25522552
if (T.getPointerAuth()) {
2553-
Diag(Loc, diag::err_ptrauth_qualifier_invalid)
2554-
<< T << (int)!T->isSignableType() << 0;
2553+
Diag(Loc, diag::err_ptrauth_qualifier_invalid) << T << 0;
25552554
return true;
25562555
}
25572556

@@ -2662,8 +2661,7 @@ QualType Sema::BuildFunctionType(QualType T,
26622661
Invalid = true;
26632662
} else if (ParamType.getPointerAuth()) {
26642663
// __ptrauth is illegal on a function return type.
2665-
Diag(Loc, diag::err_ptrauth_qualifier_invalid)
2666-
<< T << (int)!T->isSignableType() << 1;
2664+
Diag(Loc, diag::err_ptrauth_qualifier_invalid) << T << 1;
26672665
Invalid = true;
26682666
}
26692667

@@ -4977,8 +4975,7 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state,
49774975

49784976
// __ptrauth is illegal on a function return type.
49794977
if (T.getPointerAuth()) {
4980-
S.Diag(DeclType.Loc, diag::err_ptrauth_qualifier_invalid)
4981-
<< T << (int)!T->isSignableType() << 0;
4978+
S.Diag(DeclType.Loc, diag::err_ptrauth_qualifier_invalid) << T << 0;
49824979
}
49834980

49844981
if (LangOpts.OpenCL) {

0 commit comments

Comments
 (0)