diff options
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; } |