[cfe-commits] r124078 - in /cfe/trunk: include/clang/Driver/CC1AsOptions.td tools/driver/cc1as_main.cpp
Rafael Espindola
rafael.espindola at gmail.com
Sun Jan 23 09:58:26 PST 2011
Author: rafael
Date: Sun Jan 23 11:58:26 2011
New Revision: 124078
URL: http://llvm.org/viewvc/llvm-project?rev=124078&view=rev
Log:
Add support for the --noexecstack option. Fixes PR8762.
Modified:
cfe/trunk/include/clang/Driver/CC1AsOptions.td
cfe/trunk/tools/driver/cc1as_main.cpp
Modified: cfe/trunk/include/clang/Driver/CC1AsOptions.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/CC1AsOptions.td?rev=124078&r1=124077&r2=124078&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/CC1AsOptions.td (original)
+++ cfe/trunk/include/clang/Driver/CC1AsOptions.td Sun Jan 23 11:58:26 2011
@@ -70,3 +70,6 @@
def relax_all : Flag<"-relax-all">,
HelpText<"Relax all fixups (for performance testing)">;
+
+def no_exec_stack : Flag<"--noexecstack">,
+ HelpText<"Mark the file as not needing an executable stack">;
\ No newline at end of file
Modified: cfe/trunk/tools/driver/cc1as_main.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/cc1as_main.cpp?rev=124078&r1=124077&r2=124078&view=diff
==============================================================================
--- cfe/trunk/tools/driver/cc1as_main.cpp (original)
+++ cfe/trunk/tools/driver/cc1as_main.cpp Sun Jan 23 11:58:26 2011
@@ -101,6 +101,7 @@
/// @{
unsigned RelaxAll : 1;
+ unsigned NoExecStack : 1;
/// @}
@@ -115,6 +116,7 @@
ShowInst = 0;
ShowEncoding = 0;
RelaxAll = 0;
+ NoExecStack = 0;
}
static void CreateFromArgs(AssemblerInvocation &Res, const char **ArgBegin,
@@ -193,6 +195,7 @@
// 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 @@
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 @@
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();
}
More information about the cfe-commits
mailing list