[llvm-commits] [llvm] r73008 - /llvm/trunk/tools/gold/gold-plugin.cpp

Nick Lewycky nicholas at mxc.ca
Sat Jun 6 17:50:47 PDT 2009


Author: nicholas
Date: Sat Jun  6 19:50:45 2009
New Revision: 73008

URL: http://llvm.org/viewvc/llvm-project?rev=73008&view=rev
Log:
Add option for specifying the path to assembler, "as". This overrides the path
to gcc.

Modified:
    llvm/trunk/tools/gold/gold-plugin.cpp

Modified: llvm/trunk/tools/gold/gold-plugin.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/gold/gold-plugin.cpp?rev=73008&r1=73007&r2=73008&view=diff

==============================================================================
--- llvm/trunk/tools/gold/gold-plugin.cpp (original)
+++ llvm/trunk/tools/gold/gold-plugin.cpp Sat Jun  6 19:50:45 2009
@@ -45,6 +45,7 @@
 
   bool generate_api_file = false;
   const char *gcc_path = NULL;
+  const char *as_path = NULL;
 
   struct claimed_file {
     lto_module_t M;
@@ -109,6 +110,13 @@
           } else {
             gcc_path = strdup(tv->tv_u.tv_string + 4);
           }
+        } else if (strncmp("as=", tv->tv_u.tv_string, 3) == 0) {
+          if (as_path) {
+            (*message)(LDPL_WARNING, "Path to as specified twice. "
+                       "Discarding %s", tv->tv_u.tv_string);
+          } else {
+            as_path = strdup(tv->tv_u.tv_string + 3);
+          }
         } else {
           (*message)(LDPL_WARNING, "Ignoring flag %s", tv->tv_u.tv_string);
         }
@@ -346,6 +354,8 @@
   lto_codegen_set_debug_model(cg, LTO_DEBUG_MODEL_DWARF);
   if (gcc_path)
     lto_codegen_set_gcc_path(cg, gcc_path);
+  if (as_path)
+    lto_codegen_set_assembler_path(cg, as_path);
 
   size_t bufsize = 0;
   const char *buffer = static_cast<const char *>(lto_codegen_compile(cg,





More information about the llvm-commits mailing list