[PATCH] D75181: [AArch64] Handle BTI/PAC in case of generated functions.

2020-08-29 Thread Daniel Kiss via Phabricator via cfe-commits
danielkiss abandoned this revision. danielkiss added a comment. Abandoning in favour of D85649 . CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75181/new/ https://reviews.llvm.org/D75181 ___ cfe-commits mailing

[PATCH] D75181: [AArch64] Handle BTI/PAC in case of generated functions.

2020-08-05 Thread Momchil Velikov via Phabricator via cfe-commits
chill added a comment. In D75181#2193447 , @danielkiss wrote: > I don't see any other alternative option, I'm open to any other idea. My original idea was to pass options to LLVM. I'll come up with a patch in a day or two (if it works) and then we'll see

[PATCH] D75181: [AArch64] Handle BTI/PAC in case of generated functions.

2020-08-05 Thread Daniel Kiss via Phabricator via cfe-commits
danielkiss added a comment. > FWIW GCC has a "sign-return-address" function attribute with a default value > of "none". It is considered deprecated, however, in favour of > "branch-protection" This is just the internal representation, the function attribute in C/C++ source is the "branch-prote

[PATCH] D75181: [AArch64] Handle BTI/PAC in case of generated functions.

2020-08-05 Thread Kyrill Tkachov via Phabricator via cfe-commits
ktkachov added a comment. In D75181#2193447 , @danielkiss wrote: > Would it be better to add a new value to `"sign-return-address"` as `"none"`? > I don't see any other alternative option, I'm open to any other idea. FWIW GCC has a "sign-return-address"

[PATCH] D75181: [AArch64] Handle BTI/PAC in case of generated functions.

2020-08-04 Thread Daniel Kiss via Phabricator via cfe-commits
danielkiss added a comment. Would it be better to add a new value to `"sign-return-address"` as `"none"`? I don't see any other alternative option, I'm open to any other idea. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75181/new/ https://reviews.llvm.org/D75181

[PATCH] D75181: [AArch64] Handle BTI/PAC in case of generated functions.

2020-08-04 Thread Momchil Velikov via Phabricator via cfe-commits
chill added a comment. This approach looks way too hackish to me with multiple opposing attributes ("sign-return-address" vs. "ignore-sign-return-address") and some convoluted logic to resolve the contradiction. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75181/new/ https://reviews.l

[PATCH] D75181: [AArch64] Handle BTI/PAC in case of generated functions.

2020-06-04 Thread Daniel Kiss via Phabricator via cfe-commits
danielkiss added a comment. depends on D80791 CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75181/new/ https://reviews.llvm.org/D75181 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.l

[PATCH] D75181: [AArch64] Handle BTI/PAC in case of generated functions.

2020-06-04 Thread Daniel Kiss via Phabricator via cfe-commits
danielkiss updated this revision to Diff 268383. danielkiss edited the summary of this revision. danielkiss added a comment. Patch is refactored, the new pass smooth out the attribute issues. This version fixes issues with _clang_call_terminate, sanitisers and the CFI. New pass might need a new f

[PATCH] D75181: [AArch64] Handle BTI/PAC in case of generated functions.

2020-04-08 Thread Daniel Kiss via Phabricator via cfe-commits
danielkiss added inline comments. Comment at: clang/lib/CodeGen/TargetInfo.cpp:5149-5152 + if (BPI.BranchTargetEnforcement) +Fn->addFnAttr("branch-target-enforcement", "true"); + else +Fn->addFnAttr("branch-target-enforcement", "false");

[PATCH] D75181: [AArch64] Handle BTI/PAC in case of generated functions.

2020-04-07 Thread Tamas Petz via Phabricator via cfe-commits
tamas.petz added inline comments. Comment at: clang/lib/CodeGen/TargetInfo.cpp:5149-5152 + if (BPI.BranchTargetEnforcement) +Fn->addFnAttr("branch-target-enforcement", "true"); + else +Fn->addFnAttr("branch-target-enforcement", "false");

[PATCH] D75181: [AArch64] Handle BTI/PAC in case of generated functions.

2020-04-07 Thread Momchil Velikov via Phabricator via cfe-commits
chill added inline comments. Comment at: clang/lib/CodeGen/TargetInfo.cpp:5149-5152 + if (BPI.BranchTargetEnforcement) +Fn->addFnAttr("branch-target-enforcement", "true"); + else +Fn->addFnAttr("branch-target-enforcement", "false"); -

[PATCH] D75181: [AArch64] Handle BTI/PAC in case of generated functions.

2020-04-06 Thread Daniel Kiss via Phabricator via cfe-commits
danielkiss updated this revision to Diff 255347. danielkiss added a reviewer: tamas.petz. danielkiss added a comment. Fix review comments from Tamas. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75181/new/ https://reviews.llvm.org/D75181 Files: clang/lib/CodeGen/CGCall.cpp clang/l

[PATCH] D75181: [AArch64] Handle BTI/PAC in case of generated functions.

2020-04-03 Thread Tamas Petz via Phabricator via cfe-commits
tamas.petz added inline comments. Comment at: clang/lib/CodeGen/CGCall.cpp:1827-1828 + + auto RASignKind = getLangOpts().getSignReturnAddressScope(); + if (RASignKind != LangOptions::SignReturnAddressScopeKind::None) { +FuncAttrs.addAttribute("sign-return-address",

[PATCH] D75181: [AArch64] Handle BTI/PAC in case of generated functions.

2020-04-03 Thread Daniel Kiss via Phabricator via cfe-commits
danielkiss updated this revision to Diff 254761. danielkiss added a comment. The patched is rebased and the hopefully the logic is now simpler. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75181/new/ https://reviews.llvm.org/D75181 Files: clang/lib/CodeGen/CGCall.cpp clang/lib/Cod

[PATCH] D75181: [AArch64] Handle BTI/PAC in case of generated functions.

2020-04-02 Thread Daniel Kiss via Phabricator via cfe-commits
danielkiss marked an inline comment as done. danielkiss added inline comments. Comment at: clang/lib/CodeGen/TargetInfo.cpp:5149-5152 + if (BPI.BranchTargetEnforcement) +Fn->addFnAttr("branch-target-enforcement", "true"); + else +Fn->addF

[PATCH] D75181: [AArch64] Handle BTI/PAC in case of generated functions.

2020-04-01 Thread Daniel Kiss via Phabricator via cfe-commits
danielkiss added inline comments. Comment at: clang/lib/CodeGen/CGCall.cpp:1828 + if (CodeGenOpts.BranchTargetEnforcement) { +FuncAttrs.addAttribute("branch-target-enforcement", "true"); + } chill wrote: > danielkiss wrote: > > chill wrote: > > > I would re

[PATCH] D75181: [AArch64] Handle BTI/PAC in case of generated functions.

2020-04-01 Thread Momchil Velikov via Phabricator via cfe-commits
chill added inline comments. Comment at: clang/lib/CodeGen/CGCall.cpp:1828 + if (CodeGenOpts.BranchTargetEnforcement) { +FuncAttrs.addAttribute("branch-target-enforcement", "true"); + } danielkiss wrote: > chill wrote: > > I would really prefer to not set v

[PATCH] D75181: [AArch64] Handle BTI/PAC in case of generated functions.

2020-03-30 Thread Daniel Kiss via Phabricator via cfe-commits
danielkiss added a comment. ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75181/new/ https://reviews.llvm.org/D75181 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D75181: [AArch64] Handle BTI/PAC in case of generated functions.

2020-03-13 Thread Daniel Kiss via Phabricator via cfe-commits
danielkiss updated this revision to Diff 250191. danielkiss marked an inline comment as done. danielkiss added a comment. Patch is rebased, test is updated. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75181/new/ https://reviews.llvm.org/D75181 Files: clang/lib/CodeGen/CGCall.cpp

[PATCH] D75181: [AArch64] Handle BTI/PAC in case of generated functions.

2020-03-04 Thread Daniel Kiss via Phabricator via cfe-commits
danielkiss updated this revision to Diff 248222. danielkiss marked an inline comment as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75181/new/ https://reviews.llvm.org/D75181 Files: clang/lib/CodeGen/CGCall.cpp clang/lib/CodeGen/CGDeclCXX.cpp clang/lib/CodeGen/CodeGenModule

[PATCH] D75181: [AArch64] Handle BTI/PAC in case of generated functions.

2020-03-04 Thread Daniel Kiss via Phabricator via cfe-commits
danielkiss updated this revision to Diff 248201. danielkiss added a comment. Thanks for the comments, patch is improved isStringAttribute() check removed, the attribute is always a string in this case or "null" so the check is not needed. Function level the attribute is now only change when neede

[PATCH] D75181: [AArch64] Handle BTI/PAC in case of generated functions.

2020-03-04 Thread Daniel Kiss via Phabricator via cfe-commits
danielkiss marked 4 inline comments as done. danielkiss added inline comments. Comment at: clang/lib/CodeGen/CGCall.cpp:1828 + if (CodeGenOpts.BranchTargetEnforcement) { +FuncAttrs.addAttribute("branch-target-enforcement", "true"); + } chill wrote: > I woul

[PATCH] D75181: [AArch64] Handle BTI/PAC in case of generated functions.

2020-03-02 Thread Momchil Velikov via Phabricator via cfe-commits
chill added inline comments. Comment at: llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp:200 +if (!F.hasFnAttribute("branch-target-enforcement")) + return false; +Attribute A = F.getFnAttribute("branch-target-enforcement"); chill wrote: > T

[PATCH] D75181: [AArch64] Handle BTI/PAC in case of generated functions.

2020-03-02 Thread Momchil Velikov via Phabricator via cfe-commits
chill added a comment. That said, my comments are not of the "over my dead body" kind ;) Comment at: clang/lib/CodeGen/CGCall.cpp:1828 + if (CodeGenOpts.BranchTargetEnforcement) { +FuncAttrs.addAttribute("branch-target-enforcement", "true"); + } I would r

[PATCH] D75181: [AArch64] Handle BTI/PAC in case of generated functions.

2020-02-28 Thread Daniel Kiss via Phabricator via cfe-commits
danielkiss updated this revision to Diff 247201. danielkiss retitled this revision from "[Clang][AArch64] Add default arguments to runtime functions." to "[AArch64] Handle BTI/PAC in case of generated functions.". danielkiss edited the summary of this revision. danielkiss added a project: LLVM. d