rename getHostTriple into getDefaultTargetTriple
authorSebastian Pop <spop@codeaurora.org>
Tue, 1 Nov 2011 21:32:20 +0000 (21:32 +0000)
committerSebastian Pop <spop@codeaurora.org>
Tue, 1 Nov 2011 21:32:20 +0000 (21:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143502 91177308-0d34-0410-b5e6-96231b3b80d8

12 files changed:
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

index f77d4c1182bb478365558e3c5b1e622651ef9f83..d52f6319563f371ae3beabe6748c7a556423a3c1 100644 (file)
@@ -33,14 +33,14 @@ namespace sys {
     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
index 004b8656bf222656abe3161784d981ed853b76cb..45480a6d590b42ee4a53462f2bcb7cdc6c07301c 100644 (file)
@@ -35,7 +35,7 @@ TargetMachine *EngineBuilder::selectTarget(Module *Mod,
                               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;
index 238adcce0a121aebdde989e178639248c04241f5..4b43ae9cf24aad92be02e046428a7bde417d6dda 100644 (file)
@@ -1369,7 +1369,7 @@ public:
 #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) {
index 7497bfe035c66b69eaccf6574597ac5da70f89de..53c8d84e7d45882c548863becfe17ffef61d8c7a 100644 (file)
@@ -84,7 +84,7 @@ void TargetRegistry::RegisterTarget(Target &T,
 }
 
 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";
index dc1641722b1d226392df003ebf1c6a04f33d93f9..726e2fbcf056686f41533547a670a90bafcde7c6 100644 (file)
@@ -35,11 +35,11 @@ static std::string getOSVersion() {
   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 @@ std::string sys::getHostTriple() {
     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"));
index 5bbc74e5a39f75ce1d0c7d43e87920ad20ad2804..2e6d6f190370b9143a9417b89a37e14b96c7df59 100644 (file)
@@ -17,6 +17,6 @@
 
 using namespace llvm;
 
-std::string sys::getHostTriple() {
+std::string sys::getDefaultTargetTriple() {
   return LLVM_DEFAULT_TARGET_TRIPLE;
 }
index 69d8c46a502468109898dc7a70bee052be5e39ce..06e812bc6fe4627b8bf5e5e8e8340dca94c93df1 100644 (file)
@@ -1660,7 +1660,7 @@ bool CWriter::doInitialization(Module &M) {
 #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 @@ std::string CWriter::InterpretASMConstraint(InlineAsm::ConstraintInfo& c) {
   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))
index 0b59a7885f1cf84c0342912f1ae46b7c1b0392a2..6b219bf0858782fc7cf4cb03b528b5b9cdeabb6e 100644 (file)
@@ -96,7 +96,7 @@ Module *llvm::ParseInputFile(const std::string &Filename,
       Triple TheTriple(Result->getTargetTriple());
 
       if (TheTriple.getTriple().empty())
-        TheTriple.setTriple(sys::getHostTriple());
+        TheTriple.setTriple(sys::getDefaultTargetTriple());
 
       TargetTriple.setTriple(TheTriple.getTriple());
     }
index be6afec20a022404abc65bcb187c29d243b35624..1694e01cdfc41a3cf53d4614a2a2a5fab7758a39 100644 (file)
@@ -261,7 +261,7 @@ int main(int argc, char **argv) {
 
   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
index 280a1bbd9967f5f37abd8bad9eb73924f4a97adc..c188a76f5479a12b4f5c4179e73d0d77fafae2a4 100644 (file)
@@ -175,7 +175,7 @@ Action(cl::desc("Action to perform:"),
 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;
index 6c8dbad460c09c2bc44d009f61a9fbf7d360c28f..c8a0bf1d584b3e4ce8ea4bad48c14da6ba506c64 100644 (file)
@@ -243,7 +243,7 @@ bool LTOCodeGenerator::determineTarget(std::string& errMsg)
     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);
index 4ba8985e72a824526ad3e2cad79475b7b0647c40..8deaf4c427ca97b728adee457699c2524e35a5d9 100644 (file)
@@ -151,7 +151,7 @@ LTOModule *LTOModule::makeLTOModule(MemoryBuffer *buffer,
 
   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);