Skip to content

Commit 95b7a00

Browse files
author
Doug Wyatt
committed
- Sema.h: Move function decls to be in the correct per-source-file sections.
- Fix ObjC++ test which was using the attribute's old name.
1 parent 8c5f854 commit 95b7a00

File tree

2 files changed

+24
-30
lines changed

2 files changed

+24
-30
lines changed

clang/include/clang/Sema/Sema.h

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -873,8 +873,6 @@ class Sema final : public SemaBase {
873873
/// Warn when implicitly casting 0 to nullptr.
874874
void diagnoseZeroToNullptrConversion(CastKind Kind, const Expr *E);
875875

876-
// ----- function effects ---
877-
878876
/// All functions/lambdas/blocks which have bodies and which have a non-empty
879877
/// FunctionEffectsRef to be verified.
880878
SmallVector<const Decl *> DeclsWithEffectsToVerify;
@@ -886,30 +884,6 @@ class Sema final : public SemaBase {
886884
void diagnoseFunctionEffectConversion(QualType DstType, QualType SrcType,
887885
SourceLocation Loc);
888886

889-
/// Warn and return true if adding an effect to a set would create a conflict.
890-
bool diagnoseConflictingFunctionEffect(const FunctionEffectsRef &FX,
891-
const FunctionEffectWithCondition &EC,
892-
SourceLocation NewAttrLoc);
893-
894-
// Report a failure to merge function effects between declarations due to a
895-
// conflict.
896-
void
897-
diagnoseFunctionEffectMergeConflicts(const FunctionEffectSet::Conflicts &Errs,
898-
SourceLocation NewLoc,
899-
SourceLocation OldLoc);
900-
901-
/// Potentially add a FunctionDecl or BlockDecl to DeclsWithEffectsToVerify.
902-
void maybeAddDeclWithEffects(const Decl *D, const FunctionEffectsRef &FX);
903-
904-
/// Unconditionally add a Decl to DeclsWithEfffectsToVerify.
905-
void addDeclWithEffects(const Decl *D, const FunctionEffectsRef &FX);
906-
907-
/// Try to parse the conditional expression attached to an effect attribute
908-
/// (e.g. 'nonblocking'). (c.f. Sema::ActOnNoexceptSpec). Return an empty
909-
/// optional on error.
910-
std::optional<FunctionEffectMode>
911-
ActOnEffectExpression(Expr *CondExpr, StringRef AttributeName);
912-
913887
/// makeUnavailableInSystemHeader - There is an error in the current
914888
/// context. If we're still in a system header, and we can plausibly
915889
/// make the relevant declaration unavailable instead of erroring, do
@@ -4343,6 +4317,24 @@ class Sema final : public SemaBase {
43434317
// Whether the callee should be ignored in CUDA/HIP/OpenMP host/device check.
43444318
bool shouldIgnoreInHostDeviceCheck(FunctionDecl *Callee);
43454319

4320+
/// Warn and return true if adding a function effect to a set would create a conflict.
4321+
bool diagnoseConflictingFunctionEffect(const FunctionEffectsRef &FX,
4322+
const FunctionEffectWithCondition &EC,
4323+
SourceLocation NewAttrLoc);
4324+
4325+
// Report a failure to merge function effects between declarations due to a
4326+
// conflict.
4327+
void
4328+
diagnoseFunctionEffectMergeConflicts(const FunctionEffectSet::Conflicts &Errs,
4329+
SourceLocation NewLoc,
4330+
SourceLocation OldLoc);
4331+
4332+
/// Potentially add a FunctionDecl or BlockDecl to DeclsWithEffectsToVerify.
4333+
void maybeAddDeclWithEffects(const Decl *D, const FunctionEffectsRef &FX);
4334+
4335+
/// Unconditionally add a Decl to DeclsWithEfffectsToVerify.
4336+
void addDeclWithEffects(const Decl *D, const FunctionEffectsRef &FX);
4337+
43464338
private:
43474339
/// Function or variable declarations to be checked for whether the deferred
43484340
/// diagnostics should be emitted.
@@ -15015,6 +15007,12 @@ class Sema final : public SemaBase {
1501515007
return hasAcceptableDefinition(D, &Hidden, Kind);
1501615008
}
1501715009

15010+
/// Try to parse the conditional expression attached to an effect attribute
15011+
/// (e.g. 'nonblocking'). (c.f. Sema::ActOnNoexceptSpec). Return an empty
15012+
/// optional on error.
15013+
std::optional<FunctionEffectMode>
15014+
ActOnEffectExpression(Expr *CondExpr, StringRef AttributeName);
15015+
1501815016
private:
1501915017
/// The implementation of RequireCompleteType
1502015018
bool RequireCompleteTypeImpl(SourceLocation Loc, QualType T,

clang/test/SemaObjCXX/attr-nonblocking-constraints.mm

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
// RUN: %clang_cc1 -fsyntax-only -fblocks -fcxx-exceptions -verify %s
22

3-
#if !__has_attribute(clang_nonblocking)
4-
#error "the 'nonblocking' attribute is not available"
5-
#endif
6-
73
#pragma clang diagnostic ignored "-Wperf-constraint-implies-noexcept"
84

95
// Objective-C

0 commit comments

Comments
 (0)