diff options
author | Daniel Kiss <daniel.kiss@arm.com> | 2024-07-10 10:22:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-10 10:22:13 +0200 |
commit | ac285595829dde4cf435bcf5fc7a2a502d346fd4 (patch) | |
tree | 39763612fa36f4582709db86bc092f50be341069 /llvm/lib/IR/Function.cpp | |
parent | da31b684a57cdc77ad4274fd7d8b47ee27dea6c6 (diff) | |
download | llvm-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.cpp | 29 |
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; } |