diff options
| author | Anatoly Trosinenko <atrosinenko@accesssoftek.com> | 2025-09-17 20:23:09 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-17 20:23:09 +0300 |
| commit | 6bbf734ecac35a5a1c3bcb680d20519dfd46da11 (patch) | |
| tree | f16a3867ef1f496187ca79967976c181a59d1a12 /clang/lib/CodeGen/CodeGenModule.h | |
| parent | 453e4102bd32b892e7fda2aea3f3ef9e9b038580 (diff) | |
[FMV] Set default attributes on the resolver functions (#141573)
There is a number of attributes that is expected to be set on functions
by default. This patch implements setting more such attributes on the
FMV resolver functions generated by Clang. On AArch64, this makes the
resolver functions use the default PAC and BTI hardening settings.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
| -rw-r--r-- | clang/lib/CodeGen/CodeGenModule.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index 8b1ac2d976c5..3971b296b3f8 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/lib/CodeGen/CodeGenModule.h @@ -1851,6 +1851,15 @@ private: // that feature and for a regular function (llvm::GlobalValue) otherwise. llvm::Constant *GetOrCreateMultiVersionResolver(GlobalDecl GD); + // Set attributes to a resolver function generated by Clang. + // GD is either the cpu_dispatch declaration or an arbitrarily chosen + // function declaration that triggered the implicit generation of this + // resolver function. + // + /// NOTE: This should only be called for definitions. + void setMultiVersionResolverAttributes(llvm::Function *Resolver, + GlobalDecl GD); + // In scenarios where a function is not known to be a multiversion function // until a later declaration, it is sometimes necessary to change the // previously created mangled name to align with requirements of whatever |
