diff options
| author | Marcin Koscielnicki <koriakin@0x04.net> | 2016-05-04 23:37:40 +0000 |
|---|---|---|
| committer | Marcin Koscielnicki <koriakin@0x04.net> | 2016-05-04 23:37:40 +0000 |
| commit | b31ee6db115eab2a8db7a483d5a42fadac69f6b1 (patch) | |
| tree | baa9cb114120a154e36b8489da4333e4ca440557 /clang/lib | |
| parent | 68695b643da34e1a798cee8018cfb7ac621b0139 (diff) | |
| download | bcm5719-llvm-b31ee6db115eab2a8db7a483d5a42fadac69f6b1.tar.gz bcm5719-llvm-b31ee6db115eab2a8db7a483d5a42fadac69f6b1.zip | |
[SystemZ] Add -mbackchain option.
This option, like the corresponding gcc option, is SystemZ-specific and
enables storing frame backchain links, as specified in the ABI.
Differential Revision: http://reviews.llvm.org/D19891
llvm-svn: 268575
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/CodeGen/CGCall.cpp | 2 | ||||
| -rw-r--r-- | clang/lib/Driver/Tools.cpp | 10 | ||||
| -rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 2 |
3 files changed, 14 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index 50ea7f7cc33..8a26db2116d 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -1714,6 +1714,8 @@ void CodeGenModule::ConstructAttributeList( if (CodeGenOpts.StackRealignment) FuncAttrs.addAttribute("stackrealign"); + if (CodeGenOpts.Backchain) + FuncAttrs.addAttribute("backchain"); // Add target-cpu and target-features attributes to functions. If // we have a decl for the function and it has a target attribute then diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 1cc1369f330..c688763e69d 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -1655,6 +1655,12 @@ void Clang::AddSparcTargetArgs(const ArgList &Args, } } +void Clang::AddSystemZTargetArgs(const ArgList &Args, + ArgStringList &CmdArgs) const { + if (Args.hasFlag(options::OPT_mbackchain, options::OPT_mno_backchain, false)) + CmdArgs.push_back("-mbackchain"); +} + static const char *getSystemZTargetCPU(const ArgList &Args) { if (const Arg *A = Args.getLastArg(options::OPT_march_EQ)) return A->getValue(); @@ -4241,6 +4247,10 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, AddSparcTargetArgs(Args, CmdArgs); break; + case llvm::Triple::systemz: + AddSystemZTargetArgs(Args, CmdArgs); + break; + case llvm::Triple::x86: case llvm::Triple::x86_64: AddX86TargetArgs(Args, CmdArgs); diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 2091ec4af32..0b154b6743c 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -782,6 +782,8 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK, Opts.CudaGpuBinaryFileNames = Args.getAllArgValues(OPT_fcuda_include_gpubinary); + Opts.Backchain = Args.hasArg(OPT_mbackchain); + return Success; } |

