diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2018-04-04 21:55:44 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2018-04-04 21:55:44 +0000 |
commit | f11eb3ebe77729426e562d7d4d7ebb1d5ff2e7c8 (patch) | |
tree | bb02cd6d80b6bbd8c47cc5b9490b26cb24a39d81 /llvm/lib/Support/TargetParser.cpp | |
parent | 4296ea72ffcef9fff5ce735dbbfeccd503200735 (diff) | |
download | bcm5719-llvm-f11eb3ebe77729426e562d7d4d7ebb1d5ff2e7c8.tar.gz bcm5719-llvm-f11eb3ebe77729426e562d7d4d7ebb1d5ff2e7c8.zip |
AArch64: Implement support for the shadowcallstack attribute.
The implementation of shadow call stack on aarch64 is quite different to
the implementation on x86_64. Instead of reserving a segment register for
the shadow call stack, we reserve the platform register, x18. Any function
that spills lr to sp also spills it to the shadow call stack, a pointer to
which is stored in x18.
Differential Revision: https://reviews.llvm.org/D45239
llvm-svn: 329236
Diffstat (limited to 'llvm/lib/Support/TargetParser.cpp')
-rw-r--r-- | llvm/lib/Support/TargetParser.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Support/TargetParser.cpp b/llvm/lib/Support/TargetParser.cpp index e38121d6445..cadb3efc063 100644 --- a/llvm/lib/Support/TargetParser.cpp +++ b/llvm/lib/Support/TargetParser.cpp @@ -917,3 +917,7 @@ ARM::ProfileKind AArch64::parseArchProfile(StringRef Arch) { unsigned llvm::AArch64::parseArchVersion(StringRef Arch) { return ARM::parseArchVersion(Arch); } + +bool llvm::AArch64::isX18ReservedByDefault(const Triple &TT) { + return TT.isOSDarwin() || TT.isOSFuchsia() || TT.isOSWindows(); +} |