@@ -677,6 +677,7 @@ Expr *swift::expandMacroExpr(
677
677
return nullptr ;
678
678
679
679
// Evaluate the macro.
680
+ llvm::BumpPtrAllocator allocator;
680
681
NullTerminatedStringRef evaluatedSource;
681
682
682
683
MacroDecl *macro = cast<MacroDecl>(macroRef.getDecl ());
@@ -722,7 +723,6 @@ Expr *swift::expandMacroExpr(
722
723
// Expand the definition with the given arguments.
723
724
auto result = expandMacroDefinition (
724
725
macroDef.getExpanded (), macro, expr->getArgs ());
725
- llvm::MallocAllocator allocator;
726
726
evaluatedSource = NullTerminatedStringRef (result, allocator);
727
727
break ;
728
728
}
@@ -866,6 +866,7 @@ swift::expandFreestandingMacro(MacroExpansionDecl *med) {
866
866
return None;
867
867
868
868
// Evaluate the macro.
869
+ llvm::BumpPtrAllocator allocator;
869
870
NullTerminatedStringRef evaluatedSource;
870
871
871
872
MacroDecl *macro = cast<MacroDecl>(med->getMacroRef ().getDecl ());
@@ -899,7 +900,6 @@ swift::expandFreestandingMacro(MacroExpansionDecl *med) {
899
900
// Expand the definition with the given arguments.
900
901
auto result = expandMacroDefinition (
901
902
macroDef.getExpanded (), macro, med->getArgs ());
902
- llvm::MallocAllocator allocator;
903
903
evaluatedSource = NullTerminatedStringRef (result, allocator);
904
904
break ;
905
905
}
@@ -1092,6 +1092,7 @@ evaluateAttachedMacro(MacroDecl *macro, Decl *attachedTo, CustomAttr *attr,
1092
1092
}
1093
1093
1094
1094
// Evaluate the macro.
1095
+ llvm::BumpPtrAllocator allocator;
1095
1096
NullTerminatedStringRef evaluatedSource;
1096
1097
1097
1098
std::string discriminator;
@@ -1114,7 +1115,6 @@ evaluateAttachedMacro(MacroDecl *macro, Decl *attachedTo, CustomAttr *attr,
1114
1115
// Expand the definition with the given arguments.
1115
1116
auto result = expandMacroDefinition (
1116
1117
macroDef.getExpanded (), macro, attr->getArgs ());
1117
- llvm::MallocAllocator allocator;
1118
1118
evaluatedSource = NullTerminatedStringRef (result, allocator);
1119
1119
break ;
1120
1120
}
0 commit comments