[llvm-commits] [llvm] r143502 - in /llvm/trunk: include/llvm/Support/Host.h lib/ExecutionEngine/TargetSelect.cpp lib/Support/CommandLine.cpp lib/Support/TargetRegistry.cpp lib/Support/Unix/Host.inc lib/Support/Windows/Host.inc lib/Target/CBackend/CBackend.cpp tools/bugpoint/BugDriver.cpp tools/llc/llc.cpp tools/llvm-mc/llvm-mc.cpp tools/lto/LTOCodeGenerator.cpp tools/lto/LTOModule.cpp

Sebastian Pop spop at codeaurora.org
Tue Nov 1 14:32:20 PDT 2011


Author: spop
Date: Tue Nov  1 16:32:20 2011
New Revision: 143502

URL: http://llvm.org/viewvc/llvm-project?rev=143502&view=rev
Log:
rename getHostTriple into getDefaultTargetTriple


Modified:
    llvm/trunk/include/llvm/Support/Host.h
    llvm/trunk/lib/ExecutionEngine/TargetSelect.cpp
    llvm/trunk/lib/Support/CommandLine.cpp
    llvm/trunk/lib/Support/TargetRegistry.cpp
    llvm/trunk/lib/Support/Unix/Host.inc
    llvm/trunk/lib/Support/Windows/Host.inc
    llvm/trunk/lib/Target/CBackend/CBackend.cpp
    llvm/trunk/tools/bugpoint/BugDriver.cpp
    llvm/trunk/tools/llc/llc.cpp
    llvm/trunk/tools/llvm-mc/llvm-mc.cpp
    llvm/trunk/tools/lto/LTOCodeGenerator.cpp
    llvm/trunk/tools/lto/LTOModule.cpp

Modified: llvm/trunk/include/llvm/Support/Host.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Host.h?rev=143502&r1=143501&r2=143502&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/Host.h (original)
+++ llvm/trunk/include/llvm/Support/Host.h Tue Nov  1 16:32:20 2011
@@ -33,14 +33,14 @@
     return !isLittleEndianHost();
   }
 
-  /// getHostTriple() - Return the target triple of the running
+  /// getDefaultTargetTriple() - Return the target triple of the running
   /// system.
   ///
   /// The target triple is a string in the format of:
   ///   CPU_TYPE-VENDOR-OPERATING_SYSTEM
   /// or
   ///   CPU_TYPE-VENDOR-KERNEL-OPERATING_SYSTEM
-  std::string getHostTriple();
+  std::string getDefaultTargetTriple();
 
   /// getHostCPUName - Get the LLVM name for the host CPU. The particular format
   /// of the name is target dependent, and suitable for passing as -mcpu to the

Modified: llvm/trunk/lib/ExecutionEngine/TargetSelect.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/TargetSelect.cpp?rev=143502&r1=143501&r2=143502&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/TargetSelect.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/TargetSelect.cpp Tue Nov  1 16:32:20 2011
@@ -35,7 +35,7 @@
                               std::string *ErrorStr) {
   Triple TheTriple(Mod->getTargetTriple());
   if (TheTriple.getTriple().empty())
-    TheTriple.setTriple(sys::getHostTriple());
+    TheTriple.setTriple(sys::getDefaultTargetTriple());
 
   // Adjust the triple to match what the user requested.
   const Target *TheTarget = 0;

Modified: llvm/trunk/lib/Support/CommandLine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/CommandLine.cpp?rev=143502&r1=143501&r2=143502&view=diff
==============================================================================
--- llvm/trunk/lib/Support/CommandLine.cpp (original)
+++ llvm/trunk/lib/Support/CommandLine.cpp Tue Nov  1 16:32:20 2011
@@ -1369,7 +1369,7 @@
 #if (ENABLE_TIMESTAMPS == 1)
        << "  Built " << __DATE__ << " (" << __TIME__ << ").\n"
 #endif
-       << "  Host: " << sys::getHostTriple() << '\n'
+       << "  Default target: " << sys::getDefaultTargetTriple() << '\n'
        << "  Host CPU: " << CPU << '\n';
   }
   void operator=(bool OptionWasSpecified) {

Modified: llvm/trunk/lib/Support/TargetRegistry.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/TargetRegistry.cpp?rev=143502&r1=143501&r2=143502&view=diff
==============================================================================
--- llvm/trunk/lib/Support/TargetRegistry.cpp (original)
+++ llvm/trunk/lib/Support/TargetRegistry.cpp Tue Nov  1 16:32:20 2011
@@ -84,7 +84,7 @@
 }
 
 const Target *TargetRegistry::getClosestTargetForJIT(std::string &Error) {
-  const Target *TheTarget = lookupTarget(sys::getHostTriple(), Error);
+  const Target *TheTarget = lookupTarget(sys::getDefaultTargetTriple(), Error);
 
   if (TheTarget && !TheTarget->hasJIT()) {
     Error = "No JIT compatible target available for this host";

Modified: llvm/trunk/lib/Support/Unix/Host.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Unix/Host.inc?rev=143502&r1=143501&r2=143502&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Unix/Host.inc (original)
+++ llvm/trunk/lib/Support/Unix/Host.inc Tue Nov  1 16:32:20 2011
@@ -35,11 +35,11 @@
   return info.release;
 }
 
-std::string sys::getHostTriple() {
-  StringRef HostTripleString(LLVM_DEFAULT_TARGET_TRIPLE);
-  std::pair<StringRef, StringRef> ArchSplit = HostTripleString.split('-');
+std::string sys::getDefaultTargetTriple() {
+  StringRef TargetTripleString(LLVM_DEFAULT_TARGET_TRIPLE);
+  std::pair<StringRef, StringRef> ArchSplit = TargetTripleString.split('-');
 
-  // Normalize the arch, since the host triple may not actually match the host.
+  // Normalize the arch, since the target triple may not actually match the target.
   std::string Arch = ArchSplit.first;
 
   std::string Triple(Arch);
@@ -52,7 +52,7 @@
     Triple[1] = '3';
 
   // On darwin, we want to update the version to match that of the
-  // host.
+  // target.
   std::string::size_type DarwinDashIdx = Triple.find("-darwin");
   if (DarwinDashIdx != std::string::npos) {
     Triple.resize(DarwinDashIdx + strlen("-darwin"));

Modified: llvm/trunk/lib/Support/Windows/Host.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Windows/Host.inc?rev=143502&r1=143501&r2=143502&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Windows/Host.inc (original)
+++ llvm/trunk/lib/Support/Windows/Host.inc Tue Nov  1 16:32:20 2011
@@ -17,6 +17,6 @@
 
 using namespace llvm;
 
-std::string sys::getHostTriple() {
+std::string sys::getDefaultTargetTriple() {
   return LLVM_DEFAULT_TARGET_TRIPLE;
 }

Modified: llvm/trunk/lib/Target/CBackend/CBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CBackend/CBackend.cpp?rev=143502&r1=143501&r2=143502&view=diff
==============================================================================
--- llvm/trunk/lib/Target/CBackend/CBackend.cpp (original)
+++ llvm/trunk/lib/Target/CBackend/CBackend.cpp Tue Nov  1 16:32:20 2011
@@ -1660,7 +1660,7 @@
 #if 0
   std::string Triple = TheModule->getTargetTriple();
   if (Triple.empty())
-    Triple = llvm::sys::getHostTriple();
+    Triple = llvm::sys::getDefaultTargetTriple();
 
   std::string E;
   if (const Target *Match = TargetRegistry::lookupTarget(Triple, E))
@@ -3167,7 +3167,7 @@
   const MCAsmInfo *TargetAsm;
   std::string Triple = TheModule->getTargetTriple();
   if (Triple.empty())
-    Triple = llvm::sys::getHostTriple();
+    Triple = llvm::sys::getDefaultTargetTriple();
 
   std::string E;
   if (const Target *Match = TargetRegistry::lookupTarget(Triple, E))

Modified: llvm/trunk/tools/bugpoint/BugDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/BugDriver.cpp?rev=143502&r1=143501&r2=143502&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/BugDriver.cpp (original)
+++ llvm/trunk/tools/bugpoint/BugDriver.cpp Tue Nov  1 16:32:20 2011
@@ -96,7 +96,7 @@
       Triple TheTriple(Result->getTargetTriple());
 
       if (TheTriple.getTriple().empty())
-        TheTriple.setTriple(sys::getHostTriple());
+        TheTriple.setTriple(sys::getDefaultTargetTriple());
 
       TargetTriple.setTriple(TheTriple.getTriple());
     }

Modified: llvm/trunk/tools/llc/llc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llc/llc.cpp?rev=143502&r1=143501&r2=143502&view=diff
==============================================================================
--- llvm/trunk/tools/llc/llc.cpp (original)
+++ llvm/trunk/tools/llc/llc.cpp Tue Nov  1 16:32:20 2011
@@ -261,7 +261,7 @@
 
   Triple TheTriple(mod.getTargetTriple());
   if (TheTriple.getTriple().empty())
-    TheTriple.setTriple(sys::getHostTriple());
+    TheTriple.setTriple(sys::getDefaultTargetTriple());
 
   // Allocate target machine.  First, check whether the user has explicitly
   // specified an architecture to compile for. If so we have to look it up by

Modified: llvm/trunk/tools/llvm-mc/llvm-mc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/llvm-mc.cpp?rev=143502&r1=143501&r2=143502&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mc/llvm-mc.cpp (original)
+++ llvm/trunk/tools/llvm-mc/llvm-mc.cpp Tue Nov  1 16:32:20 2011
@@ -175,7 +175,7 @@
 static const Target *GetTarget(const char *ProgName) {
   // Figure out the target triple.
   if (TripleName.empty())
-    TripleName = sys::getHostTriple();
+    TripleName = sys::getDefaultTargetTriple();
   Triple TheTriple(Triple::normalize(TripleName));
 
   const Target *TheTarget = 0;

Modified: llvm/trunk/tools/lto/LTOCodeGenerator.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/LTOCodeGenerator.cpp?rev=143502&r1=143501&r2=143502&view=diff
==============================================================================
--- llvm/trunk/tools/lto/LTOCodeGenerator.cpp (original)
+++ llvm/trunk/tools/lto/LTOCodeGenerator.cpp Tue Nov  1 16:32:20 2011
@@ -243,7 +243,7 @@
     if ( _target == NULL ) {
         std::string Triple = _linker.getModule()->getTargetTriple();
         if (Triple.empty())
-          Triple = sys::getHostTriple();
+          Triple = sys::getDefaultTargetTriple();
 
         // create target machine from info for merged modules
         const Target *march = TargetRegistry::lookupTarget(Triple, errMsg);

Modified: llvm/trunk/tools/lto/LTOModule.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/LTOModule.cpp?rev=143502&r1=143501&r2=143502&view=diff
==============================================================================
--- llvm/trunk/tools/lto/LTOModule.cpp (original)
+++ llvm/trunk/tools/lto/LTOModule.cpp Tue Nov  1 16:32:20 2011
@@ -151,7 +151,7 @@
 
   std::string Triple = m->getTargetTriple();
   if (Triple.empty())
-    Triple = sys::getHostTriple();
+    Triple = sys::getDefaultTargetTriple();
 
   // find machine architecture for this module
   const Target *march = TargetRegistry::lookupTarget(Triple, errMsg);





More information about the llvm-commits mailing list