This feature is generic. Make it applicable for AArch64 and X86 because
the backend has only implemented NOP insertion for AArch64 and X86.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Unit tests: pass. 61253 tests passed, 0 failed and 736 were skipped.
clang-tidy: fail. Please fix clang-tidy findings.
clang-format: fail. Please format your changes with clang-format by running git-clang-format HEAD^ or applying this patch.
Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml
Unit tests: pass. 61253 tests passed, 0 failed and 736 were skipped.
clang-tidy: fail. Please fix clang-tidy findings.
clang-format: fail. Please format your changes with clang-format by running git-clang-format HEAD^ or applying this patch.
Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml
Unit tests: pass. 61253 tests passed, 0 failed and 736 were skipped.
clang-tidy: fail. Please fix clang-tidy findings.
clang-format: fail. Please format your changes with clang-format by running git-clang-format HEAD^ or applying this patch.
Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml
clang/lib/Sema/SemaDeclAttr.cpp | ||
---|---|---|
4923 | Why is the target arch also checked in clang/lib/Driver/ToolChains/Clang.cpp in https://reviews.llvm.org/D72222? |
clang/lib/Sema/SemaDeclAttr.cpp | ||
---|---|---|
4923 | Ah, https://reviews.llvm.org/D72221 is checking the __attribute__ syntax, https://reviews.llvm.org/D72222 is checking the command line -f syntax. |
clang/lib/CodeGen/CodeGenFunction.cpp | ||
---|---|---|
826 | In that case, it would not make sense to have start without a size, and thus should be checked for in the verification. |
clang/include/clang/Basic/Attr.td | ||
---|---|---|
686 | Should this be inheriting from TargetSpecificAttr as well given that the attribute is only supported on some architectures? | |
clang/lib/Sema/SemaDeclAttr.cpp | ||
4921 | If you make the attribute target-specific, this code can be removed. | |
4928 | Should not be a need to check this -- it will always have at least one argument because the common attribute handling code will diagnose otherwise given the subject list. | |
clang/test/CodeGen/patchable-function-entry.c | ||
21 | Can you also add a test verifying that this attribute works with redeclarations as well? Something like: [[gnu::patchable_function_entry(12, 4)]] void func(void); void func(void) { // Definition should have the noop sled } |
Address review comments
clang/include/clang/Basic/Attr.td | ||
---|---|---|
686 | Thanks for the suggestion. Didn't know TargetSpecificAttr. | |
clang/include/clang/Basic/AttrDocs.td | ||
3995 | Thanks. (I am a non-native English speaker and any advice will be highly appreciated.) (So, I believe GCC's documentation misses _the_) | |
clang/lib/CodeGen/CodeGenFunction.cpp | ||
826 | Agreed. Updated D72215 (semantics of the IR function attribute "patchable-function-entry") as well. | |
clang/lib/Sema/SemaDeclAttr.cpp | ||
4923 | ||
clang/test/CodeGen/patchable-function-entry.c | ||
21 | __attribute__((patchable_function_entry(2,0))) void f20decl(); __attribute__((noinline)) void f20decl() {} Checked this case. I'll delete __attribute__((noinline)) since it does not seem to be clear what it intends to do. |
Unit tests: fail. 61271 tests passed, 1 failed and 736 were skipped.
failed: Clang.CodeGen/patchable-function-entry.c
clang-tidy: fail. Please fix clang-tidy findings.
clang-format: fail. Please format your changes with clang-format by running git-clang-format HEAD^ or applying this patch.
Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml
Thanks for all of the work that went into this. Looks like review comments have all been addressed.
Should this be inheriting from TargetSpecificAttr as well given that the attribute is only supported on some architectures?