Skip to content

Commit

Permalink
Revert "[llvm][ARM][AArch64] Add attributes to synthetic functions. (#…
Browse files Browse the repository at this point in the history
…83153)"

This reverts commit 4c7fd7e.
  • Loading branch information
DanielKristofKiss committed Jul 10, 2024
1 parent da31b68 commit 74eff4d
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 95 deletions.
29 changes: 0 additions & 29 deletions llvm/lib/IR/Function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,35 +407,6 @@ Function *Function::createWithDefaultAttr(FunctionType *Ty,
StringRef DefaultFeatures = F->getContext().getDefaultTargetFeatures();
if (!DefaultFeatures.empty())
B.addAttribute("target-features", DefaultFeatures);

// Check if the module attribute is present and not zero.
auto isModuleAttributeSet = [&](const StringRef &ModAttr) -> bool {
const auto *Attr =
mdconst::extract_or_null<ConstantInt>(M->getModuleFlag(ModAttr));
return Attr && !Attr->isZero();
};

auto AddAttributeIfSet = [&](const StringRef &ModAttr) {
if (isModuleAttributeSet(ModAttr))
B.addAttribute(ModAttr);
};

StringRef SignType = "none";
if (isModuleAttributeSet("sign-return-address"))
SignType = "non-leaf";
if (isModuleAttributeSet("sign-return-address-all"))
SignType = "all";
if (SignType != "none") {
B.addAttribute("sign-return-address", SignType);
B.addAttribute("sign-return-address-key",
isModuleAttributeSet("sign-return-address-with-bkey")
? "b_key"
: "a_key");
}
AddAttributeIfSet("branch-target-enforcement");
AddAttributeIfSet("branch-protection-pauth-lr");
AddAttributeIfSet("guarded-control-stack");

F->addFnAttrs(B);
return F;
}
Expand Down
33 changes: 0 additions & 33 deletions llvm/test/Instrumentation/AddressSanitizer/module-flags-aarch64.ll

This file was deleted.

This file was deleted.

0 comments on commit 74eff4d

Please sign in to comment.