diff options
Diffstat (limited to 'clang/lib/CodeGen/Targets')
-rw-r--r-- | clang/lib/CodeGen/Targets/AArch64.cpp | 3 | ||||
-rw-r--r-- | clang/lib/CodeGen/Targets/ARM.cpp | 8 |
2 files changed, 2 insertions, 9 deletions
diff --git a/clang/lib/CodeGen/Targets/AArch64.cpp b/clang/lib/CodeGen/Targets/AArch64.cpp index adfdd51..2b8e2ae 100644 --- a/clang/lib/CodeGen/Targets/AArch64.cpp +++ b/clang/lib/CodeGen/Targets/AArch64.cpp @@ -132,8 +132,7 @@ public: assert(Error.empty()); auto *Fn = cast<llvm::Function>(GV); - static const char *SignReturnAddrStr[] = {"none", "non-leaf", "all"}; - Fn->addFnAttr("sign-return-address", SignReturnAddrStr[static_cast<int>(BPI.SignReturnAddr)]); + Fn->addFnAttr("sign-return-address", BPI.getSignReturnAddrStr()); if (BPI.SignReturnAddr != LangOptions::SignReturnAddressScopeKind::None) { Fn->addFnAttr("sign-return-address-key", diff --git a/clang/lib/CodeGen/Targets/ARM.cpp b/clang/lib/CodeGen/Targets/ARM.cpp index d7d175f..5d42e62 100644 --- a/clang/lib/CodeGen/Targets/ARM.cpp +++ b/clang/lib/CodeGen/Targets/ARM.cpp @@ -152,13 +152,7 @@ public: diag::warn_target_unsupported_branch_protection_attribute) << Arch; } else { - static const char *SignReturnAddrStr[] = {"none", "non-leaf", "all"}; - assert(static_cast<unsigned>(BPI.SignReturnAddr) <= 2 && - "Unexpected SignReturnAddressScopeKind"); - Fn->addFnAttr( - "sign-return-address", - SignReturnAddrStr[static_cast<int>(BPI.SignReturnAddr)]); - + Fn->addFnAttr("sign-return-address", BPI.getSignReturnAddrStr()); Fn->addFnAttr("branch-target-enforcement", BPI.BranchTargetEnforcement ? "true" : "false"); } |