[cfe-commits] r110871 - in /cfe/trunk: include/clang/Basic/TargetOptions.h include/clang/Driver/CC1Options.td lib/Frontend/CompilerInvocation.cpp

Daniel Dunbar daniel at zuster.org
Wed Aug 11 16:07:42 PDT 2010


Author: ddunbar
Date: Wed Aug 11 18:07:42 2010
New Revision: 110871

URL: http://llvm.org/viewvc/llvm-project?rev=110871&view=rev
Log:
Frontend: Add -target-linker-version, for specifying the version string of the
linker in use.

Modified:
    cfe/trunk/include/clang/Basic/TargetOptions.h
    cfe/trunk/include/clang/Driver/CC1Options.td
    cfe/trunk/lib/Frontend/CompilerInvocation.cpp

Modified: cfe/trunk/include/clang/Basic/TargetOptions.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/TargetOptions.h?rev=110871&r1=110870&r2=110871&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/TargetOptions.h (original)
+++ cfe/trunk/include/clang/Basic/TargetOptions.h Wed Aug 11 18:07:42 2010
@@ -37,6 +37,9 @@
   /// to "itanium".
   std::string CXXABI;
 
+  /// If given, the version string of the linker in use.
+  std::string LinkerVersion;
+
   /// The list of target specific features to enable or disable -- this should
   /// be a list of strings starting with by '+' or '-'.
   std::vector<std::string> Features;

Modified: cfe/trunk/include/clang/Driver/CC1Options.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/CC1Options.td?rev=110871&r1=110870&r2=110871&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/CC1Options.td (original)
+++ cfe/trunk/include/clang/Driver/CC1Options.td Wed Aug 11 18:07:42 2010
@@ -26,6 +26,8 @@
   HelpText<"Target a specific cpu type">;
 def target_feature : Separate<"-target-feature">,
   HelpText<"Target specific attributes">;
+def target_linker_version : Separate<"-target-linker-version">,
+  HelpText<"Target linker version">;
 def triple : Separate<"-triple">,
   HelpText<"Specify target triple (e.g. i686-apple-darwin9)">;
 def triple_EQ : Joined<"-triple=">, Alias<triple>;

Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=110871&r1=110870&r2=110871&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Wed Aug 11 18:07:42 2010
@@ -698,6 +698,10 @@
     Res.push_back("-target-abi");
     Res.push_back(Opts.ABI);
   }
+  if (!Opts.LinkerVersion.empty()) {
+    Res.push_back("-target-linker-version");
+    Res.push_back(Opts.LinkerVersion);
+  }
   Res.push_back("-cxx-abi");
   Res.push_back(Opts.CXXABI);
   for (unsigned i = 0, e = Opts.Features.size(); i != e; ++i) {
@@ -1441,8 +1445,9 @@
   Opts.ABI = Args.getLastArgValue(OPT_target_abi);
   Opts.CXXABI = Args.getLastArgValue(OPT_cxx_abi);
   Opts.CPU = Args.getLastArgValue(OPT_target_cpu);
-  Opts.Triple = Args.getLastArgValue(OPT_triple);
   Opts.Features = Args.getAllArgValues(OPT_target_feature);
+  Opts.LinkerVersion = Args.getLastArgValue(OPT_target_linker_version);
+  Opts.Triple = Args.getLastArgValue(OPT_triple);
 
   // Use the host triple if unspecified.
   if (Opts.Triple.empty())





More information about the cfe-commits mailing list