mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #66333 from al45tair/eng/PR-110260855
[Backtracing][IRGen] Add a semantic attribute to force frame pointer.
This commit is contained in:
@@ -144,5 +144,8 @@ SEMANTICS_ATTR(NO_PERFORMANCE_ANALYSIS, "no_performance_analysis")
|
||||
// that may cause the user to think there is a bug in the compiler.
|
||||
SEMANTICS_ATTR(NO_MOVEONLY_DIAGNOSTICS, "sil.optimizer.moveonly.diagnostic.ignore")
|
||||
|
||||
// Force the use of the frame pointer for the specified function
|
||||
SEMANTICS_ATTR(USE_FRAME_POINTER, "use_frame_pointer")
|
||||
|
||||
#undef SEMANTICS_ATTR
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "swift/AST/IRGenOptions.h"
|
||||
#include "swift/AST/ParameterList.h"
|
||||
#include "swift/AST/Pattern.h"
|
||||
#include "swift/AST/SemanticAttrs.h"
|
||||
#include "swift/AST/SubstitutionMap.h"
|
||||
#include "swift/AST/Types.h"
|
||||
#include "swift/Basic/ExternalUnion.h"
|
||||
@@ -1854,6 +1855,11 @@ IRGenSILFunction::IRGenSILFunction(IRGenModule &IGM, SILFunction *f)
|
||||
}
|
||||
}
|
||||
|
||||
// If we have @_semantics("use_frame_pointer"), force the use of a
|
||||
// frame pointer for this function.
|
||||
if (f->hasSemanticsAttr(semantics::USE_FRAME_POINTER))
|
||||
CurFn->addFnAttr("frame-pointer", "all");
|
||||
|
||||
// Disable inlining of coroutine functions until we split.
|
||||
if (f->getLoweredFunctionType()->isCoroutine()) {
|
||||
CurFn->addFnAttr(llvm::Attribute::NoInline);
|
||||
|
||||
Reference in New Issue
Block a user