Revert "arm64e: Workaround ptrauth-returns failure for swifttailcc"

This reverts commit 3c125a74f0.
This commit is contained in:
Arnold Schwaighofer
2021-03-18 10:44:35 -07:00
parent c4c91e2393
commit 340ccb2a5a
6 changed files with 11 additions and 28 deletions

View File

@@ -1111,18 +1111,11 @@ void IRGenModule::setHasNoFramePointer(llvm::Function *F) {
}
/// Construct initial function attributes from options.
void IRGenModule::constructInitialFnAttributes(
llvm::AttrBuilder &Attrs, bool disablePtrAuthReturns,
OptimizationMode FuncOptMode) {
void IRGenModule::constructInitialFnAttributes(llvm::AttrBuilder &Attrs,
OptimizationMode FuncOptMode) {
// Add the default attributes for the Clang configuration.
clang::CodeGen::addDefaultFunctionDefinitionAttributes(getClangCGM(), Attrs);
// Disable `ptrauth-returns`. It does not work for swifttailcc lowering atm.
// The `autibsp` instruction executed before a tail call that adjust the stack
// will currently fail.
if (disablePtrAuthReturns)
Attrs.removeAttribute("ptrauth-returns");
// Add/remove MinSize based on the appropriate setting.
if (FuncOptMode == OptimizationMode::NotSet)
FuncOptMode = IRGen.Opts.OptMode;
@@ -1135,10 +1128,9 @@ void IRGenModule::constructInitialFnAttributes(
}
}
llvm::AttributeList
IRGenModule::constructInitialAttributes(bool disablePtrAuthReturns) {
llvm::AttributeList IRGenModule::constructInitialAttributes() {
llvm::AttrBuilder b;
constructInitialFnAttributes(b, disablePtrAuthReturns);
constructInitialFnAttributes(b);
return llvm::AttributeList::get(getLLVMContext(),
llvm::AttributeList::FunctionIndex, b);
}