diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2011-01-23 17:58:26 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2011-01-23 17:58:26 +0000 |
commit | 3176cca2fe2bb9ab061e8e5fc05b4d59403fcf19 (patch) | |
tree | 588002416561b54a7223b78a8e86e28dcb61deef /tools/driver/cc1as_main.cpp | |
parent | 9660803cd332d5c605899435019bb3b37fca3acc (diff) |
Add support for the --noexecstack option. Fixes PR8762.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124078 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/driver/cc1as_main.cpp')
-rw-r--r-- | tools/driver/cc1as_main.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/driver/cc1as_main.cpp b/tools/driver/cc1as_main.cpp index 2eb9ff96f1..1d544f3d3c 100644 --- a/tools/driver/cc1as_main.cpp +++ b/tools/driver/cc1as_main.cpp @@ -101,6 +101,7 @@ struct AssemblerInvocation { /// @{ unsigned RelaxAll : 1; + unsigned NoExecStack : 1; /// @} @@ -115,6 +116,7 @@ public: ShowInst = 0; ShowEncoding = 0; RelaxAll = 0; + NoExecStack = 0; } static void CreateFromArgs(AssemblerInvocation &Res, const char **ArgBegin, @@ -193,6 +195,7 @@ void AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts, // Assemble Options Opts.RelaxAll = Args->hasArg(OPT_relax_all); + Opts.NoExecStack = Args->hasArg(OPT_no_exec_stack); } static formatted_raw_ostream *GetOutputStream(AssemblerInvocation &Opts, @@ -269,7 +272,7 @@ static bool ExecuteAssembler(AssemblerInvocation &Opts, Diagnostic &Diags) { TM->getTargetLowering()->getObjFileLowering(); const_cast<TargetLoweringObjectFile&>(TLOF).Initialize(Ctx, *TM); - + // FIXME: There is a bit of code duplication with addPassesToEmitFile. if (Opts.OutputType == AssemblerInvocation::FT_Asm) { MCInstPrinter *IP = TheTarget->createMCInstPrinter(Opts.OutputAsmVariant, *MAI); @@ -290,7 +293,8 @@ static bool ExecuteAssembler(AssemblerInvocation &Opts, Diagnostic &Diags) { MCCodeEmitter *CE = TheTarget->createCodeEmitter(*TM, Ctx); TargetAsmBackend *TAB = TheTarget->createAsmBackend(Opts.Triple); Str.reset(TheTarget->createObjectStreamer(Opts.Triple, Ctx, *TAB, *Out, - CE, Opts.RelaxAll)); + CE, Opts.RelaxAll, + Opts.NoExecStack)); Str.get()->InitSections(); } |