@@ -4914,6 +4920,78 @@ class FunctionEffectsRef {
void dump(llvm::raw_ostream &OS) const;
};
+/// A mutable set of FunctionEffect::Kind.
+class FunctionEffectKindSet {
dougsonos wrote:
For now I've left the special iterator but replaced the manual bit-twidd
@@ -15012,6 +14992,12 @@ class Sema final : public SemaBase {
return hasAcceptableDefinition(D, &Hidden, Kind);
}
+ /// Try to parse the conditional expression attached to an effect attribute
+ /// (e.g. 'nonblocking'). (c.f. Sema::ActOnNoexceptSpec). Return an empty
+
dougsonos wrote:
> @dougsonos Maybe you’ve just not pushed that change yet, but remember to put
> an entry for `SemaFunctionEffects.cpp` in the table of contents at the start
> of the `Sema` class definition.
Thanks. I started to do that and got distracted by a bunch of sections which
aren't
@@ -10941,6 +10941,55 @@ def warn_imp_cast_drops_unaligned : Warning<
InGroup>;
// Function effects
+def warn_func_effect_allocates : Warning<
+ "'%0' function must not allocate or deallocate memory">,
+ InGroup;
+def note_func_effect_allocates : Note<
+ "function cannot
@@ -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 getUn
@@ -4429,6 +4433,218 @@ class FunctionNoProtoType : public FunctionType, public
llvm::FoldingSetNode {
}
};
+//
--
+
+// TODO: Should FunctionEffect be located elsewhere, where Decl is not
+// forw
@@ -4429,6 +4433,218 @@ class FunctionNoProtoType : public FunctionType, public
llvm::FoldingSetNode {
}
};
+//
--
+
+// TODO: Should FunctionEffect be located elsewhere, where Decl is not
+// forw
@@ -4429,6 +4433,218 @@ class FunctionNoProtoType : public FunctionType, public
llvm::FoldingSetNode {
}
};
+//
--
+
+// TODO: Should FunctionEffect be located elsewhere, where Decl is not
+// forw
@@ -10798,6 +10798,95 @@ def warn_imp_cast_drops_unaligned : Warning<
"implicit cast from type %0 to type %1 drops __unaligned qualifier">,
InGroup>;
+def warn_func_effect_allocates : Warning<
+ "'%0' function must not allocate or deallocate memory">,
dou
@@ -3144,6 +3154,9 @@ class Sema final {
QualType T, TypeSourceInfo *TSInfo,
StorageClass SC);
+ /// Potentially add a FunctionDecl or BlockDecl to DeclsWithEffectsToVerify.
+ void CheckAddCallableWithEffects(const
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
@@ -5016,3 +5024,254 @@ void AutoType::Profile(llvm::FoldingSetNodeID &ID,
const ASTContext &Context) {
Profile(ID, Context, getDeducedType(), getKeyword(), isDependentType(),
getTypeConstraintConcept(), getTypeConstraintArguments());
}
+
+FunctionEffect::FunctionE
@@ -5016,3 +5024,254 @@ void AutoType::Profile(llvm::FoldingSetNodeID &ID,
const ASTContext &Context) {
Profile(ID, Context, getDeducedType(), getKeyword(), isDependentType(),
getTypeConstraintConcept(), getTypeConstraintArguments());
}
+
+FunctionEffect::FunctionE
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
@@ -4429,6 +4433,218 @@ class FunctionNoProtoType : public FunctionType, public
llvm::FoldingSetNode {
}
};
+//
--
+
+// TODO: Should FunctionEffect be located elsewhere, where Decl is not
+// forw
@@ -1868,6 +1868,28 @@ bool Sema::IsFunctionConversion(QualType FromType,
QualType ToType,
FromFn = QT->getAs();
Changed = true;
}
+
+if (getLangOpts().CPlusPlus) {
+ // For C, when called from checkPointerTypesForAssignment,
+ // we need not to c
@@ -7959,6 +7979,122 @@ static Attr *getCCTypeAttr(ASTContext &Ctx, ParsedAttr
&Attr) {
llvm_unreachable("unexpected attribute kind!");
}
+static bool
+handleNonBlockingNonAllocatingTypeAttr(TypeProcessingState &state,
+ ParsedAttr &PAt
@@ -0,0 +1,117 @@
+// RUN: %clang_cc1 %s -ast-dump -fblocks | FileCheck %s
+
+// Make sure that the attribute gets parsed and attached to the correct AST
elements.
+
+#pragma clang diagnostic ignored "-Wunused-variable"
+
+//
=
dougsonos wrote:
> I understand that you’d want to avoid allocating memory for effects over and
> over again, but at the same time—I think it’s fine to just don’t cache effect
> sets at all.
I agree that this would be simpler and fine.
> Each effect has a set of properties, which are represen
dougsonos wrote:
> > I understand that you’d want to avoid allocating memory for effects over
> > and over again, but at the same time—I think it’s fine to just don’t cache
> > effect sets at all.
>
> I agree that this would be simpler and fine.
>
> > Each effect has a set of properties, whic
@@ -0,0 +1,117 @@
+// RUN: %clang_cc1 %s -ast-dump -fblocks | FileCheck %s
+
+// Make sure that the attribute gets parsed and attached to the correct AST
elements.
+
+#pragma clang diagnostic ignored "-Wunused-variable"
+
+//
=
dougsonos wrote:
> One thing I noticed you bring up on Discourse and which I agree is probably
> for the better: this pr can just be about introducing an effect system;
> actually using it can be deferred to a follow-up pr. This pr is already big
> enough if you consider just those changes, an
@@ -4429,6 +4433,218 @@ class FunctionNoProtoType : public FunctionType, public
llvm::FoldingSetNode {
}
};
+//
--
+
+// TODO: Should FunctionEffect be located elsewhere, where Decl is not
+// forw
@@ -4429,6 +4433,210 @@ class FunctionNoProtoType : public FunctionType, public
llvm::FoldingSetNode {
}
};
+//
--
+
+class Decl;
+class CXXMethodDecl;
+class FunctionEffectSet;
+
+/// Represents a
@@ -3637,6 +3637,15 @@ FunctionProtoType::FunctionProtoType(QualType result,
ArrayRef params,
auto &EllipsisLoc = *getTrailingObjects();
EllipsisLoc = epi.EllipsisLoc;
}
+
+ if (epi.FunctionEffects) {
+auto &ExtraBits = *getTrailingObjects();
+ExtraBits.HasF
@@ -0,0 +1,190 @@
+// RUN: %clang_cc1 -fsyntax-only -fblocks -fcxx-exceptions -verify %s
+// These are in a separate file because errors (e.g. incompatible attributes)
currently prevent
dougsonos wrote:
Split the file.
https://github.com/llvm/llvm-project/pull/
@@ -1868,6 +1868,28 @@ bool Sema::IsFunctionConversion(QualType FromType,
QualType ToType,
FromFn = QT->getAs();
Changed = true;
}
+
+if (getLangOpts().CPlusPlus) {
+ // For C, when called from checkPointerTypesForAssignment,
+ // we need not to c
@@ -18324,6 +18324,47 @@ bool Sema::CheckOverridingFunctionAttributes(const
CXXMethodDecl *New,
return true;
}
+ // Virtual overrides: check for matching effects.
+ const auto OldFX = Old->getFunctionEffects();
+ const auto NewFX = New->getFunctionEffects();
+
+ if
@@ -0,0 +1,117 @@
+// RUN: %clang_cc1 %s -ast-dump -fblocks | FileCheck %s
+
+// Make sure that the attribute gets parsed and attached to the correct AST
elements.
+
+#pragma clang diagnostic ignored "-Wunused-variable"
+
+//
=
@@ -4429,6 +4433,210 @@ class FunctionNoProtoType : public FunctionType, public
llvm::FoldingSetNode {
}
};
+//
--
+
+class Decl;
+class CXXMethodDecl;
+class FunctionEffectSet;
+
+/// Represents a
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
@@ -0,0 +1,141 @@
+// 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(nonblocking)
+#error "the 'nonblocking' attribute is not available"
+#endif
+
+// --- ATTRIBUTE SYNT
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
@@ -0,0 +1,141 @@
+// 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(nonblocking)
+#error "the 'nonblocking' attribute is not available"
+#endif
+
+// --- ATTRIBUTE SYNT
@@ -0,0 +1,141 @@
+// 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(nonblocking)
+#error "the 'nonblocking' attribute is not available"
+#endif
+
+// --- ATTRIBUTE SYNT
@@ -0,0 +1,141 @@
+// 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(nonblocking)
+#error "the 'nonblocking' attribute is not available"
+#endif
+
+// --- ATTRIBUTE SYNT
@@ -0,0 +1,141 @@
+// 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(nonblocking)
+#error "the 'nonblocking' attribute is not available"
+#endif
+
+// --- ATTRIBUTE SYNT
@@ -0,0 +1,141 @@
+// 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(nonblocking)
+#error "the 'nonblocking' attribute is not available"
+#endif
+
+// --- ATTRIBUTE SYNT
@@ -0,0 +1,141 @@
+// 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(nonblocking)
+#error "the 'nonblocking' attribute is not available"
+#endif
+
+// --- ATTRIBUTE SYNT
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
@@ -0,0 +1,141 @@
+// 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(nonblocking)
+#error "the 'nonblocking' attribute is not available"
+#endif
+
+// --- ATTRIBUTE SYNT
@@ -0,0 +1,141 @@
+// 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(nonblocking)
+#error "the 'nonblocking' attribute is not available"
+#endif
+
+// --- ATTRIBUTE SYNT
dougsonos wrote:
> Looking for weighing in on any of the code as it stands now, or the naming
> question posed by MaskRay
> [here](https://discourse.llvm.org/t/rfc-nolock-and-noalloc-attributes/76837/75),
> so far there seems to be support for rtsan over radsan :)
+1 for rtsan
https://github
@@ -4429,6 +4434,284 @@ class FunctionNoProtoType : public FunctionType, public
llvm::FoldingSetNode {
}
};
+//
--
+
+class Decl;
+class CXXMethodDecl;
+class FunctionTypeEffectsRef;
+class Functio
dougsonos wrote:
I worked out an idea for moving much of the FunctionEffect plumbing out of
Type.h, into somewhere under Sema (probably new files because Sema.h is huge).
It's outlined in a comment in Type.h.
Initial support for an optional conditional expression attached to an effect is
now
@@ -4429,6 +4434,284 @@ class FunctionNoProtoType : public FunctionType, public
llvm::FoldingSetNode {
}
};
+//
--
+
+class Decl;
+class CXXMethodDecl;
+class FunctionTypeEffectsRef;
+class Functio
@@ -4429,6 +4434,284 @@ class FunctionNoProtoType : public FunctionType, public
llvm::FoldingSetNode {
}
};
+//
--
+
+class Decl;
+class CXXMethodDecl;
+class FunctionTypeEffectsRef;
+class Functio
dougsonos wrote:
> > I think the code to do this could live in the effect set if it were under
> > Sema (as I just described)
>
> Seeing as the effect set is part of the type, at least the parts that are
> stored in the `FunctionProtoType` can’t be in Sema and have to stay in the
> AST librar
@@ -0,0 +1,194 @@
+// RUN: %clang_cc1 -fsyntax-only -fblocks -fcxx-exceptions -verify %s
+// These are in a separate file because errors (e.g. incompatible attributes)
currently prevent
+// the AnalysisBasedWarnings pass from running at all.
+
+// This diagnostic is re-enabled an
@@ -0,0 +1,194 @@
+// RUN: %clang_cc1 -fsyntax-only -fblocks -fcxx-exceptions -verify %s
+// These are in a separate file because errors (e.g. incompatible attributes)
currently prevent
+// the AnalysisBasedWarnings pass from running at all.
+
+// This diagnostic is re-enabled an
@@ -0,0 +1,194 @@
+// RUN: %clang_cc1 -fsyntax-only -fblocks -fcxx-exceptions -verify %s
+// These are in a separate file because errors (e.g. incompatible attributes)
currently prevent
+// the AnalysisBasedWarnings pass from running at all.
+
+// This diagnostic is re-enabled an
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 -fsyntax-only -fblocks -fcxx-exceptions -verify %s
+
+#pragma clang diagnostic ignored "-Wperf-constraint-implies-noexcept"
+
+// Objective-C
+@interface OCClass
+- (void)method;
+@end
+
+void nl14(OCClass *oc) [[clang::nonblocking]] {
+
@@ -4699,7 +4699,7 @@ class FunctionEffect {
private:
LLVM_PREFERRED_TYPE(Kind)
- unsigned FKind : 3;
+ uint8_t FKind : 3;
dougsonos wrote:
(sorry, what's "NFC" in this context?)
https://github.com/llvm/llvm-project/pull/99656
___
https://github.com/dougsonos edited
https://github.com/llvm/llvm-project/pull/99656
___
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/99656
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 -fsyntax-only -fblocks -fcxx-exceptions -verify %s
+
+#pragma clang diagnostic ignored "-Wperf-constraint-implies-noexcept"
+
+// Objective-C
+@interface OCClass
+- (void)method;
+@end
+
+void nl14(OCClass *oc) [[clang::nonblocking]] {
+
https://github.com/dougsonos created
https://github.com/llvm/llvm-project/pull/100753
As a preliminary to PR https://github.com/llvm/llvm-project/pull/99656 , reduce
the size of `FunctionEffect` to 1 byte.
>From 3cc18ded835f3a25dc98bc81988d3a2f1181c300 Mon Sep 17 00:00:00 2001
From: Doug Wyatt
@@ -4699,7 +4699,7 @@ class FunctionEffect {
private:
LLVM_PREFERRED_TYPE(Kind)
- unsigned FKind : 3;
+ uint8_t FKind : 3;
dougsonos wrote:
Opened PR https://github.com/llvm/llvm-project/pull/100753 for this.
https://github.com/llvm/llvm-project/pull/996
https://github.com/dougsonos updated
https://github.com/llvm/llvm-project/pull/100753
>From 3cc18ded835f3a25dc98bc81988d3a2f1181c300 Mon Sep 17 00:00:00 2001
From: Doug Wyatt
Date: Sun, 5 May 2024 12:36:53 -0700
Subject: [PATCH 1/2] Reduce size of FunctionEffect to 1 byte.
---
clang/include/c
@@ -15609,6 +15661,10 @@ Decl *Sema::ActOnStartOfFunctionDef(Scope
*FnBodyScope, Decl *D,
getCurLexicalContext()->getDeclKind() != Decl::ObjCImplementation)
Diag(FD->getLocation(), diag::warn_function_def_in_objc_container);
+ if (Context.hasAnyFunctionEffects())
+
@@ -2397,6 +2397,1262 @@ class UnsafeBufferUsageReporter : public
UnsafeBufferUsageHandler {
};
} // namespace
+//
=
+
+namespace FXAnalysis {
+
+enum class DiagnosticID : uint8_t {
+ None = 0, // s
@@ -2397,6 +2397,1262 @@ class UnsafeBufferUsageReporter : public
UnsafeBufferUsageHandler {
};
} // namespace
+//
=
+
+namespace FXAnalysis {
+
+enum class DiagnosticID : uint8_t {
+ None = 0, // s
https://github.com/dougsonos edited
https://github.com/llvm/llvm-project/pull/99656
___
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/99656
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -2397,6 +2397,1262 @@ class UnsafeBufferUsageReporter : public
UnsafeBufferUsageHandler {
};
} // namespace
+//
=
+
+namespace FXAnalysis {
+
+enum class DiagnosticID : uint8_t {
+ None = 0, // s
@@ -2397,6 +2397,1262 @@ class UnsafeBufferUsageReporter : public
UnsafeBufferUsageHandler {
};
} // namespace
+//
=
+
+namespace FXAnalysis {
+
+enum class DiagnosticID : uint8_t {
+ None = 0, // s
@@ -2397,6 +2397,1262 @@ class UnsafeBufferUsageReporter : public
UnsafeBufferUsageHandler {
};
} // namespace
+//
=
+
+namespace FXAnalysis {
+
+enum class DiagnosticID : uint8_t {
+ None = 0, // s
https://github.com/dougsonos edited
https://github.com/llvm/llvm-project/pull/99656
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -873,30 +873,17 @@ class Sema final : public SemaBase {
/// Warn when implicitly casting 0 to nullptr.
void diagnoseZeroToNullptrConversion(CastKind Kind, const Expr *E);
- // - function effects ---
+ /// All functions/lambdas/blocks which have bodies and which ha
@@ -2397,6 +2397,1262 @@ class UnsafeBufferUsageReporter : public
UnsafeBufferUsageHandler {
};
} // namespace
+//
=
+
+namespace FXAnalysis {
+
+enum class DiagnosticID : uint8_t {
+ None = 0, // s
@@ -10897,6 +10902,53 @@ Attr
*Sema::getImplicitCodeSegOrSectionAttrForFunction(const FunctionDecl *FD,
return nullptr;
}
+// Should only be called when getFunctionEffects() returns a non-empty set.
+// Decl should be a FunctionDecl or BlockDecl.
+void Sema::maybeAddDeclWit
@@ -4699,7 +4699,7 @@ class FunctionEffect {
private:
LLVM_PREFERRED_TYPE(Kind)
- unsigned FKind : 3;
+ uint8_t FKind : 3;
dougsonos wrote:
That PR has been merged.
https://github.com/llvm/llvm-project/pull/99656
_
@@ -2397,6 +2397,1262 @@ class UnsafeBufferUsageReporter : public
UnsafeBufferUsageHandler {
};
} // namespace
+//
=
+
+namespace FXAnalysis {
+
+enum class DiagnosticID : uint8_t {
+ None = 0, // s
@@ -10897,6 +10902,53 @@ Attr
*Sema::getImplicitCodeSegOrSectionAttrForFunction(const FunctionDecl *FD,
return nullptr;
}
+// Should only be called when getFunctionEffects() returns a non-empty set.
+// Decl should be a FunctionDecl or BlockDecl.
+void Sema::maybeAddDeclWit
https://github.com/dougsonos edited
https://github.com/llvm/llvm-project/pull/99656
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -2397,6 +2397,1262 @@ class UnsafeBufferUsageReporter : public
UnsafeBufferUsageHandler {
};
} // namespace
+//
=
+
+namespace FXAnalysis {
+
+enum class DiagnosticID : uint8_t {
+ None = 0, // s
dougsonos wrote:
It would be great if we could merge this soon, please; I'd to start another PR
for the 2nd-pass effects analysis and it has a dependency or two on these
changes.
https://github.com/llvm/llvm-project/pull/96844
___
cfe-commits mailing
https://github.com/dougsonos created
https://github.com/llvm/llvm-project/pull/99656
- In Sema, when encountering Decls with function effects needing verification,
add them to a vector, DeclsWithEffectsToVerify.
- Update AST serialization to include DeclsWithEffectsToVerify.
- In AnalysisBasedW
@@ -4699,7 +4699,7 @@ class FunctionEffect {
private:
LLVM_PREFERRED_TYPE(Kind)
- unsigned FKind : 3;
+ uint8_t FKind : 3;
dougsonos wrote:
The size of FunctionEffect changes from 4 (sizeof(unsigned)) to 1, and saves on
memory footprint in the new analys
@@ -10928,6 +10928,55 @@ def warn_imp_cast_drops_unaligned : Warning<
InGroup>;
// Function effects
+def warn_func_effect_allocates : Warning<
+ "'%0' function must not allocate or deallocate memory">,
+ InGroup;
+def note_func_effect_allocates : Note<
+ "function cannot
@@ -2551,6 +3807,9 @@ void clang::sema::AnalysisBasedWarnings::IssueWarnings(
SourceLocation())) {
CallableVisitor(CallAnalyzers).TraverseTranslationUnitDecl(TU);
}
+
+ if (S.Context.hasAnyFunctionEffects())
dougsonos wrote:
This
@@ -2397,6 +2397,1262 @@ class UnsafeBufferUsageReporter : public
UnsafeBufferUsageHandler {
};
} // namespace
+//
=
+
+namespace FXAnalysis {
+
+enum class DiagnosticID : uint8_t {
+ None = 0, // s
https://github.com/dougsonos updated
https://github.com/llvm/llvm-project/pull/99656
>From 8c5f85492091df2432701f15f4ec4b6acfe19944 Mon Sep 17 00:00:00 2001
From: Doug Wyatt
Date: Sun, 5 May 2024 12:36:53 -0700
Subject: [PATCH 1/2] nonblocking/nonallocating attributes: 2nd pass
caller/callee a
https://github.com/dougsonos updated
https://github.com/llvm/llvm-project/pull/99656
>From 8c5f85492091df2432701f15f4ec4b6acfe19944 Mon Sep 17 00:00:00 2001
From: Doug Wyatt
Date: Sun, 5 May 2024 12:36:53 -0700
Subject: [PATCH 1/3] nonblocking/nonallocating attributes: 2nd pass
caller/callee a
@@ -891,6 +898,12 @@ class Sema final : public SemaBase {
SourceLocation NewLoc,
SourceLocation OldLoc);
+ /// Potentially add a FunctionDecl or BlockDecl to DeclsWithEffectsToVerify.
+ void maybeA
https://github.com/dougsonos edited
https://github.com/llvm/llvm-project/pull/99656
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -5016,3 +5041,345 @@ void AutoType::Profile(llvm::FoldingSetNodeID &ID,
const ASTContext &Context) {
Profile(ID, Context, getDeducedType(), getKeyword(), isDependentType(),
getTypeConstraintConcept(), getTypeConstraintArguments());
}
+
+StringRef FunctionEffect:
@@ -3637,6 +3637,28 @@ FunctionProtoType::FunctionProtoType(QualType result,
ArrayRef params,
auto &EllipsisLoc = *getTrailingObjects();
EllipsisLoc = epi.EllipsisLoc;
}
+
+ if (!epi.FunctionEffects.empty()) {
+auto &ExtraBits = *getTrailingObjects();
+// TO
https://github.com/dougsonos deleted
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 deleted
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
@@ -210,24 +210,88 @@ void nb18(void (^block)() [[clang::nonblocking]])
[[clang::nonblocking]]
}
// Builtin functions
-void nb18a() [[clang::nonblocking]] {
+void nb19() [[clang::nonblocking]] {
__builtin_assume(1);
void *ptr = __builtin_malloc(1); // expected
@@ -908,9 +936,9 @@ class Analyzer {
static bool isSafeBuiltinFunction(const FunctionDecl *FD) {
unsigned BuiltinID = FD->getBuiltinID();
switch (BuiltinID) {
- case 0: // not builtin
+ case 0: // Not builtin.
return false;
- default: //
@@ -1,44 +1,67 @@
-//=== EffectAnalysis.cpp - Sema warnings for function effects
-===//
+//=== SemaFunctionEffects.cpp - Sema handling of function effects
-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
// See ht
https://github.com/dougsonos updated
https://github.com/llvm/llvm-project/pull/96844
>From 038b39d3235c6c8151127c34d34f498dd298273c Mon Sep 17 00:00:00 2001
From: Doug Wyatt
Date: Wed, 26 Jun 2024 10:03:25 -0700
Subject: [PATCH 1/2] Performance optimizations for function effects: - Put new
Fun
https://github.com/dougsonos updated
https://github.com/llvm/llvm-project/pull/96844
>From 038b39d3235c6c8151127c34d34f498dd298273c Mon Sep 17 00:00:00 2001
From: Doug Wyatt
Date: Wed, 26 Jun 2024 10:03:25 -0700
Subject: [PATCH 1/4] Performance optimizations for function effects: - Put new
Fun
dougsonos wrote:
Added a further tweak: add a bool to ASTContext to track whether any
FunctionProtoType's with effects have been created, so that Sema can
short-circuit checks involving effects when it knows no one has any. This seems
to have the desired effect of only paying for the feature w
https://github.com/dougsonos created
https://github.com/llvm/llvm-project/pull/90702
This addresses an issue where the explicit alignment of 2 (for C++ ABI reasons)
was being propagated to the back end and causing under-aligned functions (in
special sections). (#90358)
This is an alternate ap
@@ -5387,6 +5387,14 @@ std::string llvm::UpgradeDataLayoutString(StringRef DL,
StringRef TT) {
return Res;
}
+ // AArch64 data layout upgrades.
+ if (T.isAArch64()) {
+// Add "-Fn32"
+if (!DL.contains("-Fn32"))
+ Res.append("-Fn32");
doug
https://github.com/dougsonos edited
https://github.com/llvm/llvm-project/pull/90702
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
101 - 200 of 456 matches
Mail list logo