[cfe-commits] r128432 - in /cfe/trunk: include/clang/Driver/CC1AsOptions.td tools/driver/cc1as_main.cpp

Daniel Dunbar daniel at zuster.org
Mon Mar 28 15:49:24 PDT 2011


Author: ddunbar
Date: Mon Mar 28 17:49:24 2011
New Revision: 128432

URL: http://llvm.org/viewvc/llvm-project?rev=128432&view=rev
Log:
Frontend/cc1as: Add support for -L.

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=128432&r1=128431&r2=128432&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/CC1AsOptions.td (original)
+++ cfe/trunk/include/clang/Driver/CC1AsOptions.td Mon Mar 28 17:49:24 2011
@@ -29,6 +29,10 @@
   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 @@
     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">;

Modified: cfe/trunk/tools/driver/cc1as_main.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/cc1as_main.cpp?rev=128432&r1=128431&r2=128432&view=diff
==============================================================================
--- cfe/trunk/tools/driver/cc1as_main.cpp (original)
+++ cfe/trunk/tools/driver/cc1as_main.cpp Mon Mar 28 17:49:24 2011
@@ -71,6 +71,7 @@
 
   std::vector<std::string> IncludePaths;
   unsigned NoInitialTextSection : 1;
+  unsigned SaveTemporaryLabels : 1;
 
   /// @}
   /// @name Frontend Options
@@ -156,6 +157,7 @@
   // 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 @@
 
   const TargetAsmInfo *tai = new TargetAsmInfo(*TM);
   MCContext Ctx(*MAI, tai);
+  if (Opts.SaveTemporaryLabels)
+    Ctx.setAllowTemporaryLabels(false);
 
   OwningPtr<MCStreamer> Str;
 





More information about the cfe-commits mailing list