]> granicus.if.org Git - clang/commitdiff
Frontend/cc1as: Add support for -L.
authorDaniel Dunbar <daniel@zuster.org>
Mon, 28 Mar 2011 22:49:24 +0000 (22:49 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Mon, 28 Mar 2011 22:49:24 +0000 (22:49 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128432 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Driver/CC1AsOptions.td
tools/driver/cc1as_main.cpp

index 50472ffdf9cddc9e02a44be0bc0ddba36e3880fe..2643c4f0e85435f42373638d346ca74fb9a8f4bd 100644 (file)
@@ -29,6 +29,10 @@ def I : JoinedOrSeparate<"-I">, MetaVarName<"<directory>">,
   HelpText<"Add directory to include search path">;
 def n : Flag<"-n">,
   HelpText<"Don't automatically start assembly file with a text section">;
+def L : Flag<"-L">,
+  HelpText<"Save temporary labels in the symbol table. "
+           "Note this may change .s semantics, it should almost never be used "
+           "on compiler generated code!">;
 
 //===----------------------------------------------------------------------===//
 // Frontend Options
@@ -72,4 +76,4 @@ 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
+    HelpText<"Mark the file as not needing an executable stack">;
index 643bd412bed6531c768b71284b8619363d78521b..0222f00dc6b881e1552a0117aa42643a7b1436d2 100644 (file)
@@ -71,6 +71,7 @@ struct AssemblerInvocation {
 
   std::vector<std::string> IncludePaths;
   unsigned NoInitialTextSection : 1;
+  unsigned SaveTemporaryLabels : 1;
 
   /// @}
   /// @name Frontend Options
@@ -156,6 +157,7 @@ void AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,
   // Language Options
   Opts.IncludePaths = Args->getAllArgValues(OPT_I);
   Opts.NoInitialTextSection = Args->hasArg(OPT_n);
+  Opts.SaveTemporaryLabels = Args->hasArg(OPT_L);
 
   // Frontend Options
   if (Args->hasArg(OPT_INPUT)) {
@@ -265,6 +267,8 @@ static bool ExecuteAssembler(AssemblerInvocation &Opts, Diagnostic &Diags) {
 
   const TargetAsmInfo *tai = new TargetAsmInfo(*TM);
   MCContext Ctx(*MAI, tai);
+  if (Opts.SaveTemporaryLabels)
+    Ctx.setAllowTemporaryLabels(false);
 
   OwningPtr<MCStreamer> Str;