diff options
author | Dean Michael Berris <dberris@google.com> | 2016-11-21 03:24:59 +0000 |
---|---|---|
committer | Dean Michael Berris <dberris@google.com> | 2016-11-21 03:24:59 +0000 |
commit | 3abce99b6747bcfe6768d2598b1cf8a0b17a3b1e (patch) | |
tree | d034539f8544e06dad2ac3637fa3873c4a38f9ba | |
parent | bad8f0feb47dbd648ebee5208ae5d966ed22ad50 (diff) | |
download | bcm5719-llvm-3abce99b6747bcfe6768d2598b1cf8a0b17a3b1e.tar.gz bcm5719-llvm-3abce99b6747bcfe6768d2598b1cf8a0b17a3b1e.zip |
[XRay] Support AArch64 in Clang
This patch adds XRay support in Clang for AArch64 target.
This patch is one of a series:
LLVM: https://reviews.llvm.org/D26412
compiler-rt: https://reviews.llvm.org/D26413
Author: rSerge
Reviewers: rengolin, dberris
Subscribers: aemerson, cfe-commits, iid_iunknown
Differential Revision: https://reviews.llvm.org/D26415
llvm-svn: 287518
-rw-r--r-- | clang/lib/Driver/Tools.cpp | 20 | ||||
-rw-r--r-- | clang/test/Driver/XRay/xray-instrument-cpu.c | 2 | ||||
-rw-r--r-- | clang/test/Driver/XRay/xray-instrument-os.c | 2 |
3 files changed, 15 insertions, 9 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 8fc34ab05a0..18c917c55a4 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -4900,14 +4900,20 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, if (Args.hasFlag(options::OPT_fxray_instrument, options::OPT_fnoxray_instrument, false)) { const char *const XRayInstrumentOption = "-fxray-instrument"; - if (Triple.getOS() == llvm::Triple::Linux && - (Triple.getArch() == llvm::Triple::arm || - Triple.getArch() == llvm::Triple::x86_64)) { - // Supported. - } else { + if (Triple.getOS() == llvm::Triple::Linux) + switch (Triple.getArch()) { + case llvm::Triple::x86_64: + case llvm::Triple::arm: + case llvm::Triple::aarch64: + // Supported. + break; + default: + D.Diag(diag::err_drv_clang_unsupported) + << (std::string(XRayInstrumentOption) + " on " + Triple.str()); + } + else D.Diag(diag::err_drv_clang_unsupported) - << (std::string(XRayInstrumentOption) + " on " + Triple.str()); - } + << (std::string(XRayInstrumentOption) + " on non-Linux target OS"); CmdArgs.push_back(XRayInstrumentOption); if (const Arg *A = Args.getLastArg(options::OPT_fxray_instruction_threshold_, diff --git a/clang/test/Driver/XRay/xray-instrument-cpu.c b/clang/test/Driver/XRay/xray-instrument-cpu.c index a686377d287..613342063a4 100644 --- a/clang/test/Driver/XRay/xray-instrument-cpu.c +++ b/clang/test/Driver/XRay/xray-instrument-cpu.c @@ -1,4 +1,4 @@ // RUN: not %clang -o /dev/null -v -fxray-instrument -c %s -// XFAIL: amd64-, x86_64-, x86_64h-, arm +// XFAIL: amd64-, x86_64-, x86_64h-, arm, aarch64, arm64 // REQUIRES: linux typedef int a; diff --git a/clang/test/Driver/XRay/xray-instrument-os.c b/clang/test/Driver/XRay/xray-instrument-os.c index 3b992030904..86b109b6dbf 100644 --- a/clang/test/Driver/XRay/xray-instrument-os.c +++ b/clang/test/Driver/XRay/xray-instrument-os.c @@ -1,4 +1,4 @@ // RUN: not %clang -o /dev/null -v -fxray-instrument -c %s // XFAIL: -linux- -// REQUIRES-ANY: amd64, x86_64, x86_64h, arm +// REQUIRES-ANY: amd64, x86_64, x86_64h, arm, aarch64, arm64 typedef int a; |