File tree Expand file tree Collapse file tree 5 files changed +28
-0
lines changed Expand file tree Collapse file tree 5 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 28
28
#include " llvm/ADT/StringSwitch.h"
29
29
using namespace swift ;
30
30
31
+ #define DECL_ATTR (_, Id, ...) \
32
+ static_assert (IsTriviallyDestructible<Id##Attr>::value, \
33
+ " Attrs are BumpPtrAllocated; the destructor is never called" );
34
+ #include " swift/AST/Attr.def"
35
+ static_assert (IsTriviallyDestructible<DeclAttributes>::value,
36
+ " DeclAttributes are BumpPtrAllocated; the d'tor is never called" );
37
+ static_assert (IsTriviallyDestructible<TypeAttributes>::value,
38
+ " TypeAttributes are BumpPtrAllocated; the d'tor is never called" );
39
+
31
40
32
41
// Only allow allocation of attributes using the allocator in ASTContext.
33
42
void *AttributeBase::operator new (size_t Bytes, ASTContext &C,
Original file line number Diff line number Diff line change @@ -72,6 +72,10 @@ STATISTIC(NumLazyGenericEnvironmentsLoaded,
72
72
IsTriviallyDestructible<Id##Decl>::value, \
73
73
" Decls are BumpPtrAllocated; the destructor is never called" );
74
74
#include " swift/AST/DeclNodes.def"
75
+ static_assert (IsTriviallyDestructible<ParameterList>::value,
76
+ " ParameterLists are BumpPtrAllocated; the d'tor is never called" );
77
+ static_assert (IsTriviallyDestructible<GenericParamList>::value,
78
+ " GenericParamLists are BumpPtrAllocated; the d'tor isn't called" );
75
79
76
80
const clang::MacroInfo *ClangNode::getAsMacro () const {
77
81
if (auto MM = getAsModuleMacro ())
Original file line number Diff line number Diff line change 25
25
#include " llvm/Support/raw_ostream.h"
26
26
using namespace swift ;
27
27
28
+ #define PATTERN (Id, _ ) \
29
+ static_assert (IsTriviallyDestructible<Id##Pattern>::value, \
30
+ " Patterns are BumpPtrAllocated; the d'tor is never called" );
31
+ #include " swift/AST/PatternNodes.def"
32
+
28
33
// / Diagnostic printing of PatternKinds.
29
34
llvm::raw_ostream &swift::operator <<(llvm::raw_ostream &OS, PatternKind kind) {
30
35
switch (kind) {
Original file line number Diff line number Diff line change 42
42
#include < iterator>
43
43
using namespace swift ;
44
44
45
+ #define TYPE (Id, _ ) \
46
+ static_assert (IsTriviallyDestructible<Id##Type>::value, \
47
+ " Types are BumpPtrAllocated; the destructor is never called" );
48
+ #include " swift/AST/TypeNodes.def"
49
+
45
50
Type QueryTypeSubstitutionMap::operator ()(SubstitutableType *type) const {
46
51
auto key = type->getCanonicalType ()->castTo <SubstitutableType>();
47
52
auto known = substitutions.find (key);
Original file line number Diff line number Diff line change 28
28
#include " llvm/Support/raw_ostream.h"
29
29
using namespace swift ;
30
30
31
+ #define TYPEREPR (Id, _ ) \
32
+ static_assert (IsTriviallyDestructible<Id##TypeRepr>::value, \
33
+ " TypeReprs are BumpPtrAllocated; the d'tor is never called" );
34
+ #include " swift/AST/TypeReprNodes.def"
35
+
31
36
SourceLoc TypeRepr::getLoc () const {
32
37
switch (getKind ()) {
33
38
#define TYPEREPR (CLASS, PARENT ) \
You can’t perform that action at this time.
0 commit comments