[llvm-branch-commits] [clang] [clang] Implement function pointer signing and authenticated function calls (PR #93906)
Akira Hatanaka via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Jun 12 10:24:27 PDT 2024
================
@@ -1458,6 +1458,39 @@ static void setPGOUseInstrumentor(CodeGenOptions &Opts,
Opts.setProfileUse(CodeGenOptions::ProfileClangInstr);
}
+bool CompilerInvocation::setDefaultPointerAuthOptions(
+ PointerAuthOptions &Opts, const LangOptions &LangOpts,
+ const llvm::Triple &Triple) {
+ if (Triple.getArch() == llvm::Triple::aarch64) {
+ if (LangOpts.PointerAuthCalls) {
+ using Key = PointerAuthSchema::ARM8_3Key;
+ using Discrimination = PointerAuthSchema::Discrimination;
+ // If you change anything here, be sure to update <ptrauth.h>.
+ Opts.FunctionPointers =
+ PointerAuthSchema(Key::ASIA, false, Discrimination::None);
+ }
+ return true;
+ }
+
+ return false;
+}
+
+static bool parsePointerAuthOptions(PointerAuthOptions &Opts,
+ ArgList &Args,
----------------
ahatanak wrote:
I removed `Args` as it wasn't used.
https://github.com/llvm/llvm-project/pull/93906
More information about the llvm-branch-commits
mailing list