aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Function.cpp
diff options
context:
space:
mode:
authorDaniel Kiss <daniel.kiss@arm.com>2024-07-10 10:22:13 +0200
committerGitHub <noreply@github.com>2024-07-10 10:22:13 +0200
commitac285595829dde4cf435bcf5fc7a2a502d346fd4 (patch)
tree39763612fa36f4582709db86bc092f50be341069 /llvm/lib/IR/Function.cpp
parentda31b684a57cdc77ad4274fd7d8b47ee27dea6c6 (diff)
downloadllvm-ac285595829dde4cf435bcf5fc7a2a502d346fd4.zip
llvm-ac285595829dde4cf435bcf5fc7a2a502d346fd4.tar.gz
llvm-ac285595829dde4cf435bcf5fc7a2a502d346fd4.tar.bz2
Revert "[llvm][ARM][AArch64] Add attributes to synthetic functions." (#98283)
Reverts llvm/llvm-project#83153
Diffstat (limited to 'llvm/lib/IR/Function.cpp')
-rw-r--r--llvm/lib/IR/Function.cpp29
1 files changed, 0 insertions, 29 deletions
diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp
index 2087198..5fb348a8 100644
--- a/llvm/lib/IR/Function.cpp
+++ b/llvm/lib/IR/Function.cpp
@@ -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;
}