mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-08 09:03:18 +00:00
826ef59568
Summary: This attribute will allow users to opt specific functions out of speculative load hardening. This compliments the Clang attribute named speculative_load_hardening. When this attribute or the attribute speculative_load_hardening is used in combination with the flags -mno-speculative-load-hardening or -mspeculative-load-hardening, the function level attribute will override the default during LLVM IR generation. For example, in the case, where the flag opposes the function attribute, the function attribute will take precendence. The sticky inlining behavior of the speculative_load_hardening attribute may cause a function with the no_speculative_load_hardening attribute to be tagged with the speculative_load_hardening tag in subsequent compiler phases which is desired behavior since the speculative_load_hardening LLVM attribute is designed to be maximally conservative. If both attributes are specified for a function, then an error will be thrown. Reviewers: chandlerc, echristo, kristof.beyls, aaron.ballman Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D54909 llvm-svn: 351565
15 lines
452 B
Objective-C
15 lines
452 B
Objective-C
// RUN: %clang -emit-llvm %s -o - -S | FileCheck %s -check-prefix=SLH
|
|
|
|
int main() __attribute__((speculative_load_hardening)) {
|
|
return 0;
|
|
}
|
|
|
|
int test() __attribute__((no_speculative_load_hardening)) {
|
|
return 0;
|
|
}
|
|
|
|
// SLH: @{{.*}}main{{.*}}[[SLH:#[0-9]+]]
|
|
// SLH: @{{.*}}test{{.*}}[[NOSLH:#[0-9]+]]
|
|
// SLH: attributes [[SLH]] = { {{.*}}speculative_load_hardening{{.*}} }
|
|
// SLH-NOT: attributes [[NOSLH]] = { {{.*}}speculative_load_hardening{{.*}} }
|