================
@@ -595,6 +595,19 @@ class ZOSXPLinkTargetCodeGenInfo : public
TargetCodeGenInfo {
SwiftInfo =
std::make_unique<SwiftABIInfo>(CGT, /*SwiftErrorInRegister=*/false);
}
+
+ void setTargetAttributes(const Decl *D, llvm::GlobalValue *GV,
+ CodeGen::CodeGenModule &M) const override {
+ if (dyn_cast_or_null<FunctionDecl>(D)) {
+ if (auto *Fn = dyn_cast<llvm::Function>(GV)) {
+ auto ZOSPPA1Name = M.getCodeGenOpts().getZOSPPA1Name();
+ if (ZOSPPA1Name == clang::CodeGenOptions::ZOSPPA1NameKind::Emit)
+ Fn->addFnAttr("zos-ppa1-name", "all");
+ else if (ZOSPPA1Name == clang::CodeGenOptions::ZOSPPA1NameKind::NoEmit)
+ Fn->addFnAttr("zos-ppa1-name", "none");
----------------
uweigand wrote:
`all` and `none` look a bit weird here - this is a *per function* attribute, so
it really only affects one function, never "all" or "none". Looks to me it
would be preferable to have `emit` / `noemit` or simply `true` / `false` as
attribute value ...
https://github.com/llvm/llvm-project/pull/207416
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits