@@ -7525,25 +7525,21 @@ static Attr *getCCTypeAttr(ASTContext , ParsedAttr
) {
std::optional
Sema::ActOnEffectExpression(Expr *CondExpr, StringRef AttributeName) {
- auto BadExpr = [&]() {
-Diag(CondExpr->getExprLoc(), diag::err_attribute_argument_type)
-<< ("'"
@@ -7525,25 +7525,21 @@ static Attr *getCCTypeAttr(ASTContext , ParsedAttr
) {
std::optional
Sema::ActOnEffectExpression(Expr *CondExpr, StringRef AttributeName) {
- auto BadExpr = [&]() {
-Diag(CondExpr->getExprLoc(), diag::err_attribute_argument_type)
-<< ("'"
@@ -7525,25 +7525,21 @@ static Attr *getCCTypeAttr(ASTContext , ParsedAttr
) {
std::optional
Sema::ActOnEffectExpression(Expr *CondExpr, StringRef AttributeName) {
- auto BadExpr = [&]() {
-Diag(CondExpr->getExprLoc(), diag::err_attribute_argument_type)
-<< ("'"
@@ -7525,25 +7525,21 @@ static Attr *getCCTypeAttr(ASTContext , ParsedAttr
) {
std::optional
Sema::ActOnEffectExpression(Expr *CondExpr, StringRef AttributeName) {
- auto BadExpr = [&]() {
-Diag(CondExpr->getExprLoc(), diag::err_attribute_argument_type)
-<< ("'"
@@ -7525,25 +7525,21 @@ static Attr *getCCTypeAttr(ASTContext , ParsedAttr
) {
std::optional
Sema::ActOnEffectExpression(Expr *CondExpr, StringRef AttributeName) {
- auto BadExpr = [&]() {
-Diag(CondExpr->getExprLoc(), diag::err_attribute_argument_type)
-<< ("'"
dougsonos wrote:
> @dougsonos Just merged a pr that diagnoses unexpanded parameter packs when an
> attribute is parsed, so could you double-check if that call to
> `DiagnoseUnexpandedParameterPack` is still necessary?
I just re-merged main to the branch and verified that the call to
https://github.com/Sirraide approved this pull request.
One last minor comment, but other than that I think we’re good.
This is a comparatively large pr, so while it’s possible that I missed
something, I don’t think there is much to be gained from me staring at this for
any longer than I
@@ -7525,25 +7525,21 @@ static Attr *getCCTypeAttr(ASTContext , ParsedAttr
) {
std::optional
Sema::ActOnEffectExpression(Expr *CondExpr, StringRef AttributeName) {
- auto BadExpr = [&]() {
-Diag(CondExpr->getExprLoc(), diag::err_attribute_argument_type)
-<< ("'"
https://github.com/Sirraide edited
https://github.com/llvm/llvm-project/pull/84983
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -4640,6 +4647,306 @@ class FunctionNoProtoType : public FunctionType, public
llvm::FoldingSetNode {
}
};
+//
--
+
+/// Represents an abstract function effect, using just an enumeration
https://github.com/dougsonos edited
https://github.com/llvm/llvm-project/pull/84983
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/dougsonos edited
https://github.com/llvm/llvm-project/pull/84983
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -4640,6 +4647,306 @@ class FunctionNoProtoType : public FunctionType, public
llvm::FoldingSetNode {
}
};
+//
--
+
+/// Represents an abstract function effect, using just an enumeration
https://github.com/Sirraide edited
https://github.com/llvm/llvm-project/pull/84983
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -7518,6 +7523,154 @@ static Attr *getCCTypeAttr(ASTContext , ParsedAttr
) {
llvm_unreachable("unexpected attribute kind!");
}
+std::optional
+Sema::ActOnEffectExpression(Expr *CondExpr, StringRef AttributeName) {
+ auto BadExpr = [&]() {
+
@@ -7518,6 +7523,154 @@ static Attr *getCCTypeAttr(ASTContext , ParsedAttr
) {
llvm_unreachable("unexpected attribute kind!");
}
+std::optional
+Sema::ActOnEffectExpression(Expr *CondExpr, StringRef AttributeName) {
+ auto BadExpr = [&]() {
+
https://github.com/Sirraide edited
https://github.com/llvm/llvm-project/pull/84983
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -7518,6 +7523,154 @@ static Attr *getCCTypeAttr(ASTContext , ParsedAttr
) {
llvm_unreachable("unexpected attribute kind!");
}
+std::optional
+Sema::ActOnEffectExpression(Expr *CondExpr, StringRef AttributeName) {
+ auto BadExpr = [&]() {
+
@@ -4640,6 +4647,306 @@ class FunctionNoProtoType : public FunctionType, public
llvm::FoldingSetNode {
}
};
+//
--
+
+/// Represents an abstract function effect, using just an enumeration
@@ -7518,6 +7523,154 @@ static Attr *getCCTypeAttr(ASTContext , ParsedAttr
) {
llvm_unreachable("unexpected attribute kind!");
}
+std::optional
+Sema::ActOnEffectExpression(Expr *CondExpr, StringRef AttributeName) {
+ auto BadExpr = [&]() {
+
@@ -7518,6 +7523,154 @@ static Attr *getCCTypeAttr(ASTContext , ParsedAttr
) {
llvm_unreachable("unexpected attribute kind!");
}
+std::optional
+Sema::ActOnEffectExpression(Expr *CondExpr, StringRef AttributeName) {
+ auto BadExpr = [&]() {
+
@@ -7518,6 +7523,154 @@ static Attr *getCCTypeAttr(ASTContext , ParsedAttr
) {
llvm_unreachable("unexpected attribute kind!");
}
+std::optional
+Sema::ActOnEffectExpression(Expr *CondExpr, StringRef AttributeName) {
+ auto BadExpr = [&]() {
+
@@ -4780,42 +4781,38 @@ struct FunctionEffectWithCondition {
/// Return a textual description of the effect, and its condition, if any.
std::string description() const;
-
- friend bool operator<(const FunctionEffectWithCondition ,
-const
@@ -1870,6 +1870,28 @@ bool Sema::IsFunctionConversion(QualType FromType,
QualType ToType,
FromFn = QT->getAs();
Changed = true;
}
+
+// For C, when called from checkPointerTypesForAssignment,
+// we need not to alter FromFn, or else even an innocuous
@@ -4640,6 +4647,306 @@ class FunctionNoProtoType : public FunctionType, public
llvm::FoldingSetNode {
}
};
+//
--
+
+/// Represents an abstract function effect, using just an enumeration
@@ -4640,6 +4647,306 @@ class FunctionNoProtoType : public FunctionType, public
llvm::FoldingSetNode {
}
};
+//
--
+
+/// Represents an abstract function effect, using just an enumeration
https://github.com/Sirraide edited
https://github.com/llvm/llvm-project/pull/84983
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -4640,6 +4647,306 @@ class FunctionNoProtoType : public FunctionType, public
llvm::FoldingSetNode {
}
};
+//
--
+
+/// Represents an abstract function effect, using just an enumeration
https://github.com/Sirraide requested changes to this pull request.
A few more minor things, but I think this should mostly be done after this.
https://github.com/llvm/llvm-project/pull/84983
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
dougsonos wrote:
I've been through all the feedback again and believe I have addressed
everything.
https://github.com/llvm/llvm-project/pull/84983
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
@@ -10510,6 +10512,8 @@ QualType ASTContext::mergeFunctionTypes(QualType lhs,
QualType rhs,
if (lproto->getMethodQuals() != rproto->getMethodQuals())
return {};
+// TODO: (nonblocking) Does anything need to be done with FunctionEffects?
+
@@ -7973,3 +7973,20 @@ requirement:
}
}];
}
+
+def NoLockNoAllocDocs : Documentation {
+ let Category = DocCatType;
+ let Content = [{
+The ``nolock`` and ``noalloc`` attributes can be attached to functions,
blocks,
+function pointers, lambdas, and member functions.
@@ -4639,6 +4645,303 @@ class FunctionNoProtoType : public FunctionType, public
llvm::FoldingSetNode {
}
};
+//
--
+
+/// Represents an abstract function effect, using just an enumeration
@@ -4429,6 +4434,284 @@ class FunctionNoProtoType : public FunctionType, public
llvm::FoldingSetNode {
}
};
+//
--
+
+class Decl;
+class CXXMethodDecl;
+class FunctionTypeEffectsRef;
+class
@@ -4429,6 +4433,210 @@ class FunctionNoProtoType : public FunctionType, public
llvm::FoldingSetNode {
}
};
+//
--
+
+class Decl;
+class CXXMethodDecl;
+class FunctionEffectSet;
+
+/// Represents
@@ -17154,6 +17156,10 @@ ExprResult Sema::ActOnBlockStmtExpr(SourceLocation
CaretLoc,
BlockScopeInfo *BSI = cast(FunctionScopes.back());
BlockDecl *BD = BSI->TheDecl;
+ if (const auto FX = BD->getFunctionEffects()) {
+CheckAddCallableWithEffects(BD, FX);
+ }
@@ -1888,6 +1888,11 @@ ExprResult Sema::BuildCaptureInit(const Capture ,
ExprResult Sema::ActOnLambdaExpr(SourceLocation StartLoc, Stmt *Body) {
LambdaScopeInfo LSI = *cast(FunctionScopes.back());
ActOnFinishFunctionBody(LSI.CallOperator, Body);
+
+ if (const auto FX =
@@ -4429,6 +4433,218 @@ class FunctionNoProtoType : public FunctionType, public
llvm::FoldingSetNode {
}
};
+//
--
+
+// TODO: Should FunctionEffect be located elsewhere, where Decl is not
+//
@@ -5016,3 +5024,254 @@ void AutoType::Profile(llvm::FoldingSetNodeID ,
const ASTContext ) {
Profile(ID, Context, getDeducedType(), getKeyword(), isDependentType(),
getTypeConstraintConcept(), getTypeConstraintArguments());
}
+
+FunctionEffect::FunctionEffect(Type
@@ -3144,6 +3154,9 @@ class Sema final {
QualType T, TypeSourceInfo *TSInfo,
StorageClass SC);
+ /// Potentially add a FunctionDecl or BlockDecl to DeclsWithEffectsToVerify.
+ void CheckAddCallableWithEffects(const
@@ -352,6 +352,9 @@ let Class = FunctionProtoType in {
def : Property<"AArch64SMEAttributes", UInt32> {
let Read = [{ node->getAArch64SMEAttributes() }];
}
+ def : Property<"functionEffects", Array> {
+let Read = [{ node->getFunctionEffects().serializable() }];
+
@@ -4429,6 +4433,218 @@ class FunctionNoProtoType : public FunctionType, public
llvm::FoldingSetNode {
}
};
+//
--
+
+// TODO: Should FunctionEffect be located elsewhere, where Decl is not
+//
@@ -464,6 +466,16 @@ class ASTContext : public RefCountedBase {
/// This is the top-level (C++20) Named module we are building.
Module *CurrentCXXNamedModule = nullptr;
+ class FunctionEffectSetUniquing {
+llvm::DenseSet> Set;
+
+ public:
+FunctionEffectSet
@@ -4912,3 +4922,279 @@ void AutoType::Profile(llvm::FoldingSetNodeID ,
const ASTContext ) {
Profile(ID, Context, getDeducedType(), getKeyword(), isDependentType(),
getTypeConstraintConcept(), getTypeConstraintArguments());
}
+
+FunctionEffect::~FunctionEffect() =
@@ -7963,6 +7967,148 @@ static Attr *getCCTypeAttr(ASTContext , ParsedAttr
) {
llvm_unreachable("unexpected attribute kind!");
}
+ExprResult Sema::ActOnEffectExpression(Expr *CondExpr, FunctionEffectMode
,
+ bool RequireConstexpr) {
+
@@ -7963,6 +7967,148 @@ static Attr *getCCTypeAttr(ASTContext , ParsedAttr
) {
llvm_unreachable("unexpected attribute kind!");
}
+ExprResult Sema::ActOnEffectExpression(Expr *CondExpr, FunctionEffectMode
,
+ bool RequireConstexpr) {
+
https://github.com/dougsonos edited
https://github.com/llvm/llvm-project/pull/84983
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -7963,6 +7967,148 @@ static Attr *getCCTypeAttr(ASTContext , ParsedAttr
) {
llvm_unreachable("unexpected attribute kind!");
}
+ExprResult Sema::ActOnEffectExpression(Expr *CondExpr, FunctionEffectMode
,
+ bool RequireConstexpr) {
+
@@ -7963,6 +7967,148 @@ static Attr *getCCTypeAttr(ASTContext , ParsedAttr
) {
llvm_unreachable("unexpected attribute kind!");
}
+ExprResult Sema::ActOnEffectExpression(Expr *CondExpr, FunctionEffectMode
,
+ bool RequireConstexpr) {
+
@@ -5028,3 +5050,376 @@ void AutoType::Profile(llvm::FoldingSetNodeID ,
const ASTContext ) {
Profile(ID, Context, getDeducedType(), getKeyword(), isDependentType(),
getTypeConstraintConcept(), getTypeConstraintArguments());
}
+
+FunctionEffect::Kind
@@ -5028,3 +5050,376 @@ void AutoType::Profile(llvm::FoldingSetNodeID ,
const ASTContext ) {
Profile(ID, Context, getDeducedType(), getKeyword(), isDependentType(),
getTypeConstraintConcept(), getTypeConstraintArguments());
}
+
+FunctionEffect::Kind
@@ -1870,6 +1870,28 @@ bool Sema::IsFunctionConversion(QualType FromType,
QualType ToType,
FromFn = QT->getAs();
Changed = true;
}
+
+// For C, when called from checkPointerTypesForAssignment,
+// we need not to alter FromFn, or else even an innocuous
@@ -4639,6 +4645,303 @@ class FunctionNoProtoType : public FunctionType, public
llvm::FoldingSetNode {
}
};
+//
--
+
+/// Represents an abstract function effect, using just an enumeration
@@ -4639,6 +4645,303 @@ class FunctionNoProtoType : public FunctionType, public
llvm::FoldingSetNode {
}
};
+//
--
+
+/// Represents an abstract function effect, using just an enumeration
@@ -4639,6 +4645,303 @@ class FunctionNoProtoType : public FunctionType, public
llvm::FoldingSetNode {
}
};
+//
--
+
+/// Represents an abstract function effect, using just an enumeration
@@ -1435,6 +1435,38 @@ def CXX11NoReturn : InheritableAttr {
let Documentation = [CXX11NoReturnDocs];
}
+def NonBlocking : TypeAttr {
+ let Spellings = [CXX11<"clang", "nonblocking">,
AaronBallman wrote:
Present Aaron thanks you and Past Aaron apologized
@@ -4639,6 +4645,303 @@ class FunctionNoProtoType : public FunctionType, public
llvm::FoldingSetNode {
}
};
+//
--
+
+/// Represents an abstract function effect, using just an enumeration
@@ -5028,3 +5060,263 @@ void AutoType::Profile(llvm::FoldingSetNodeID ,
const ASTContext ) {
Profile(ID, Context, getDeducedType(), getKeyword(), isDependentType(),
getTypeConstraintConcept(), getTypeConstraintArguments());
}
+
+FunctionEffect::Kind
@@ -5028,3 +5060,263 @@ void AutoType::Profile(llvm::FoldingSetNodeID ,
const ASTContext ) {
Profile(ID, Context, getDeducedType(), getKeyword(), isDependentType(),
getTypeConstraintConcept(), getTypeConstraintArguments());
}
+
+FunctionEffect::Kind
@@ -5028,3 +5060,263 @@ void AutoType::Profile(llvm::FoldingSetNodeID ,
const ASTContext ) {
Profile(ID, Context, getDeducedType(), getKeyword(), isDependentType(),
getTypeConstraintConcept(), getTypeConstraintArguments());
}
+
+FunctionEffect::Kind
@@ -1435,6 +1435,38 @@ def CXX11NoReturn : InheritableAttr {
let Documentation = [CXX11NoReturnDocs];
}
+def NonBlocking : TypeAttr {
+ let Spellings = [CXX11<"clang", "nonblocking">,
dougsonos wrote:
I've gotten rid of the "clang_" prefix on the
@@ -4639,6 +4645,303 @@ class FunctionNoProtoType : public FunctionType, public
llvm::FoldingSetNode {
}
};
+//
--
+
+/// Represents an abstract function effect, using just an enumeration
@@ -395,6 +395,33 @@ bool Sema::checkStringLiteralArgumentAttr(const ParsedAttr
, unsigned ArgNum,
return checkStringLiteralArgumentAttr(AL, ArgExpr, Str, ArgLocation);
}
+/// Check if the argument \p ArgNum of \p Attr is a compile-time constant
+/// integer (boolean)
@@ -4639,6 +4645,303 @@ class FunctionNoProtoType : public FunctionType, public
llvm::FoldingSetNode {
}
};
+//
--
+
+/// Represents an abstract function effect, using just an enumeration
@@ -395,6 +395,33 @@ bool Sema::checkStringLiteralArgumentAttr(const ParsedAttr
, unsigned ArgNum,
return checkStringLiteralArgumentAttr(AL, ArgExpr, Str, ArgLocation);
}
+/// Check if the argument \p ArgNum of \p Attr is a compile-time constant
+/// integer (boolean)
@@ -661,6 +681,11 @@ ExprResult Sema::ImpCastExprToType(Expr *E, QualType Ty,
diagnoseNullableToNonnullConversion(Ty, E->getType(), E->getBeginLoc());
diagnoseZeroToNullptrConversion(Kind, E);
+ if (!isCast(CCK) && !E->isNullPointerConstant(
+
@@ -4639,6 +4645,303 @@ class FunctionNoProtoType : public FunctionType, public
llvm::FoldingSetNode {
}
};
+//
--
+
+/// Represents an abstract function effect, using just an enumeration
@@ -7963,6 +7968,154 @@ static Attr *getCCTypeAttr(ASTContext , ParsedAttr
) {
llvm_unreachable("unexpected attribute kind!");
}
+std::optional
+Sema::ActOnEffectExpression(Expr *CondExpr, StringRef AttributeName) {
+ auto BadExpr = [&]() {
+
erichkeane wrote:
> Well assume attribute is a good example of where gcc and clang disagree and
> might cause issues. Gcc implemented the assume attribute just the same as the
> standard one. While clang implemented before standardization and now they
> differ and could cause issues. This is
@@ -7963,6 +7968,154 @@ static Attr *getCCTypeAttr(ASTContext , ParsedAttr
) {
llvm_unreachable("unexpected attribute kind!");
}
+std::optional
+Sema::ActOnEffectExpression(Expr *CondExpr, StringRef AttributeName) {
+ auto BadExpr = [&]() {
+
pinskia wrote:
Well assume attribute is a good example of where gcc and clang disagree and
might cause issues. Gcc implemented the assume attribute just the same as the
standard one. While clang implemented before standardization and now they
differ and could cause issues. This is why I
@@ -1435,6 +1435,38 @@ def CXX11NoReturn : InheritableAttr {
let Documentation = [CXX11NoReturnDocs];
}
+def NonBlocking : TypeAttr {
+ let Spellings = [CXX11<"clang", "nonblocking">,
AaronBallman wrote:
Yeah, Present Aaron regrets Past Aaron's caution
@@ -1435,6 +1435,38 @@ def CXX11NoReturn : InheritableAttr {
let Documentation = [CXX11NoReturnDocs];
}
+def NonBlocking : TypeAttr {
+ let Spellings = [CXX11<"clang", "nonblocking">,
erichkeane wrote:
I agree with Aaron here, doing that sort of prefix is
@@ -1435,6 +1435,38 @@ def CXX11NoReturn : InheritableAttr {
let Documentation = [CXX11NoReturnDocs];
}
+def NonBlocking : TypeAttr {
+ let Spellings = [CXX11<"clang", "nonblocking">,
AaronBallman wrote:
CC @erichkeane
`clang_builtin_alias` is the only
@@ -1435,6 +1435,38 @@ def CXX11NoReturn : InheritableAttr {
let Documentation = [CXX11NoReturnDocs];
}
+def NonBlocking : TypeAttr {
+ let Spellings = [CXX11<"clang", "nonblocking">,
dougsonos wrote:
I don't really care either way, but there was a
@@ -7963,6 +7968,154 @@ static Attr *getCCTypeAttr(ASTContext , ParsedAttr
) {
llvm_unreachable("unexpected attribute kind!");
}
+std::optional
+Sema::ActOnEffectExpression(Expr *CondExpr, StringRef AttributeName) {
+ auto BadExpr = [&]() {
+
@@ -5028,3 +5060,263 @@ void AutoType::Profile(llvm::FoldingSetNodeID ,
const ASTContext ) {
Profile(ID, Context, getDeducedType(), getKeyword(), isDependentType(),
getTypeConstraintConcept(), getTypeConstraintArguments());
}
+
+FunctionEffect::Kind
@@ -7963,6 +7968,154 @@ static Attr *getCCTypeAttr(ASTContext , ParsedAttr
) {
llvm_unreachable("unexpected attribute kind!");
}
+std::optional
+Sema::ActOnEffectExpression(Expr *CondExpr, StringRef AttributeName) {
+ auto BadExpr = [&]() {
+
@@ -5028,3 +5060,263 @@ void AutoType::Profile(llvm::FoldingSetNodeID ,
const ASTContext ) {
Profile(ID, Context, getDeducedType(), getKeyword(), isDependentType(),
getTypeConstraintConcept(), getTypeConstraintArguments());
}
+
+FunctionEffect::Kind
@@ -4639,6 +4645,303 @@ class FunctionNoProtoType : public FunctionType, public
llvm::FoldingSetNode {
}
};
+//
--
+
+/// Represents an abstract function effect, using just an enumeration
@@ -3649,6 +3649,35 @@ FunctionProtoType::FunctionProtoType(QualType result,
ArrayRef params,
auto = *getTrailingObjects();
EllipsisLoc = epi.EllipsisLoc;
}
+
+ if (!epi.FunctionEffects.empty()) {
+auto = *getTrailingObjects();
+const size_t EffectsCount
@@ -2743,3 +2759,153 @@ bool Sema::isDeclaratorFunctionLike(Declarator ) {
});
return Result;
}
+
+FunctionEffectDifferences::FunctionEffectDifferences(
+const FunctionEffectsRef , const FunctionEffectsRef ) {
+
+ FunctionEffectsRef::iterator POld = Old.begin();
+
@@ -4639,6 +4645,303 @@ class FunctionNoProtoType : public FunctionType, public
llvm::FoldingSetNode {
}
};
+//
--
+
+/// Represents an abstract function effect, using just an enumeration
@@ -0,0 +1,134 @@
+// RUN: %clang_cc1 -fsyntax-only -fblocks -fcxx-exceptions -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fblocks -verify -x c -std=c23 %s
+
+#if !__has_attribute(clang_nonblocking)
+#error "the 'nonblocking' attribute is not available"
+#endif
+
+// ---
@@ -4669,6 +4679,13 @@ class BlockDecl : public Decl, public DeclContext {
SourceRange getSourceRange() const override LLVM_READONLY;
+ FunctionEffectsRef getFunctionEffects() const {
+if (TypeSourceInfo *TSI = getSignatureAsWritten())
+ if (auto *FPT =
@@ -2743,3 +2759,153 @@ bool Sema::isDeclaratorFunctionLike(Declarator ) {
});
return Result;
}
+
+FunctionEffectDifferences::FunctionEffectDifferences(
+const FunctionEffectsRef , const FunctionEffectsRef ) {
+
+ FunctionEffectsRef::iterator POld = Old.begin();
+
@@ -1870,6 +1870,27 @@ bool Sema::IsFunctionConversion(QualType FromType,
QualType ToType,
FromFn = QT->getAs();
Changed = true;
}
+
+// For C, when called from checkPointerTypesForAssignment,
+// we need not to alter FromFn, or else even an innocuous
@@ -4639,6 +4645,303 @@ class FunctionNoProtoType : public FunctionType, public
llvm::FoldingSetNode {
}
};
+//
--
+
+/// Represents an abstract function effect, using just an enumeration
@@ -1870,6 +1870,28 @@ bool Sema::IsFunctionConversion(QualType FromType,
QualType ToType,
FromFn = QT->getAs();
Changed = true;
}
+
+// For C, when called from checkPointerTypesForAssignment,
+// we need not to alter FromFn, or else even an innocuous
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -x c -std=c11 %s
AaronBallman wrote:
```suggestion
// RUN: %clang_cc1 -fsyntax-only -verify -std=c89 %s
```
https://github.com/llvm/llvm-project/pull/84983
@@ -5028,3 +5060,263 @@ void AutoType::Profile(llvm::FoldingSetNodeID ,
const ASTContext ) {
Profile(ID, Context, getDeducedType(), getKeyword(), isDependentType(),
getTypeConstraintConcept(), getTypeConstraintArguments());
}
+
+FunctionEffect::Kind
@@ -4639,6 +4645,303 @@ class FunctionNoProtoType : public FunctionType, public
llvm::FoldingSetNode {
}
};
+//
--
+
+/// Represents an abstract function effect, using just an enumeration
@@ -5028,3 +5060,263 @@ void AutoType::Profile(llvm::FoldingSetNodeID ,
const ASTContext ) {
Profile(ID, Context, getDeducedType(), getKeyword(), isDependentType(),
getTypeConstraintConcept(), getTypeConstraintArguments());
}
+
+FunctionEffect::Kind
@@ -5028,3 +5060,263 @@ void AutoType::Profile(llvm::FoldingSetNodeID ,
const ASTContext ) {
Profile(ID, Context, getDeducedType(), getKeyword(), isDependentType(),
getTypeConstraintConcept(), getTypeConstraintArguments());
}
+
+FunctionEffect::Kind
@@ -4639,6 +4645,303 @@ class FunctionNoProtoType : public FunctionType, public
llvm::FoldingSetNode {
}
};
+//
--
+
+/// Represents an abstract function effect, using just an enumeration
@@ -1435,6 +1435,38 @@ def CXX11NoReturn : InheritableAttr {
let Documentation = [CXX11NoReturnDocs];
}
+def NonBlocking : TypeAttr {
+ let Spellings = [CXX11<"clang", "nonblocking">,
AaronBallman wrote:
Generally speaking, these would use the `Clang`
Sirraide wrote:
@dougsonos Btw, feel free to remind reviewers that this pr exists every week or
so if no-one reviews it. Just adding a comment with the text ‘ping’ is how we
usually handle that.
https://github.com/llvm/llvm-project/pull/84983
___
@@ -0,0 +1,126 @@
+// RUN: %clang_cc1 -fsyntax-only -fblocks -fcxx-exceptions -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fblocks -verify -x c -std=c23 %s
Sirraide wrote:
Prototypeless functions are the only thing I can think of as well candidly.
@@ -7963,6 +7967,148 @@ static Attr *getCCTypeAttr(ASTContext , ParsedAttr
) {
llvm_unreachable("unexpected attribute kind!");
}
+ExprResult Sema::ActOnEffectExpression(Expr *CondExpr, FunctionEffectMode
,
+ bool RequireConstexpr) {
+
@@ -0,0 +1,126 @@
+// RUN: %clang_cc1 -fsyntax-only -fblocks -fcxx-exceptions -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fblocks -verify -x c -std=c23 %s
dougsonos wrote:
There's now a separate file for pre-C23 - currently it just tests the
prototypeless
1 - 100 of 270 matches
Mail list logo