[cfe-commits] r73581 - in /cfe/trunk: include/clang/Driver/Options.def include/clang/Driver/ToolChain.h lib/Driver/Driver.cpp

Daniel Dunbar daniel at zuster.org
Tue Jun 16 16:25:22 PDT 2009


Author: ddunbar
Date: Tue Jun 16 18:25:22 2009
New Revision: 73581

URL: http://llvm.org/viewvc/llvm-project?rev=73581&view=rev
Log:
Fake support for -print-multi-*
 - I think we will eventually need to support this for realz, and some build
   processes seem to depend on these options.

Modified:
    cfe/trunk/include/clang/Driver/Options.def
    cfe/trunk/include/clang/Driver/ToolChain.h
    cfe/trunk/lib/Driver/Driver.cpp

Modified: cfe/trunk/include/clang/Driver/Options.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.def?rev=73581&r1=73580&r2=73581&view=diff

==============================================================================
--- cfe/trunk/include/clang/Driver/Options.def (original)
+++ cfe/trunk/include/clang/Driver/Options.def Tue Jun 16 18:25:22 2009
@@ -565,9 +565,9 @@
 OPTION("-print-ivar-layout", print_ivar_layout, Flag, INVALID, INVALID, "", 0, 0, 0)
 OPTION("-print-libgcc-file-name", print_libgcc_file_name, Flag, INVALID, INVALID, "", 0, 
        "Print the library path for \"libgcc.a\"", 0)
-OPTION("-print-multi-directory", print_multi_directory, Flag, INVALID, INVALID, "u", 0, 0, 0)
-OPTION("-print-multi-lib", print_multi_lib, Flag, INVALID, INVALID, "u", 0, 0, 0)
-OPTION("-print-multi-os-directory", print_multi_os_directory, Flag, INVALID, INVALID, "u", 0, 0, 0)
+OPTION("-print-multi-directory", print_multi_directory, Flag, INVALID, INVALID, "", 0, 0, 0)
+OPTION("-print-multi-lib", print_multi_lib, Flag, INVALID, INVALID, "", 0, 0, 0)
+OPTION("-print-multi-os-directory", print_multi_os_directory, Flag, INVALID, INVALID, "", 0, 0, 0)
 OPTION("-print-prog-name=", print_prog_name_EQ, Joined, INVALID, INVALID, "", 0,
        "Print the full program path of <name>", "<name>")
 OPTION("-print-search-dirs", print_search_dirs, Flag, INVALID, INVALID, "", 0, 

Modified: cfe/trunk/include/clang/Driver/ToolChain.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/ToolChain.h?rev=73581&r1=73580&r2=73581&view=diff

==============================================================================
--- cfe/trunk/include/clang/Driver/ToolChain.h (original)
+++ cfe/trunk/include/clang/Driver/ToolChain.h Tue Jun 16 18:25:22 2009
@@ -50,6 +50,8 @@
   // Accessors
 
   const HostInfo &getHost() const { return Host; }
+  const llvm::Triple &getTriple() const { return Triple; }
+
   std::string getArchName() const { return Triple.getArchName(); }
   std::string getPlatform() const { return Triple.getVendorName(); }
   std::string getOS() const { return Triple.getOSName(); }

Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=73581&r1=73580&r2=73581&view=diff

==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Tue Jun 16 18:25:22 2009
@@ -429,6 +429,47 @@
     return false;
   }
 
+  if (C.getArgs().hasArg(options::OPT_print_multi_lib)) {
+    // FIXME: We need tool chain support for this.
+    llvm::outs() << ".;\n";
+
+    switch (C.getDefaultToolChain().getTriple().getArch()) {
+    default:
+      break;
+      
+    case llvm::Triple::x86_64:
+      llvm::outs() << "x86_64;@m64" << "\n";
+      break;
+
+    case llvm::Triple::ppc64:
+      llvm::outs() << "ppc64;@m64" << "\n";
+      break;
+    }
+    return false;
+  }
+
+  // FIXME: What is the difference between print-multi-directory and
+  // print-multi-os-directory?
+  if (C.getArgs().hasArg(options::OPT_print_multi_directory) ||
+      C.getArgs().hasArg(options::OPT_print_multi_os_directory)) {
+    switch (C.getDefaultToolChain().getTriple().getArch()) {
+    default:
+    case llvm::Triple::x86:
+    case llvm::Triple::ppc:
+      llvm::outs() << "." << "\n";
+      break;
+      
+    case llvm::Triple::x86_64:
+      llvm::outs() << "x86_64" << "\n";
+      break;
+
+    case llvm::Triple::ppc64:
+      llvm::outs() << "ppc64" << "\n";
+      break;
+    }
+    return false;
+  }
+
   return true;
 }
 





More information about the cfe-commits mailing list