Hi,

On Thu, Oct 27, 2011 at 10:01 PM, Joerg Sonnenberger
<[email protected]> wrote:
>> 2. derive LLVM_HOSTTRIPLE from $target as you proposed, then rename
>> LLVM_HOSTTRIPLE into something more meaningful, like what I proposed
>> LLVM_DEFAULT_TARGET.
> The second makes sure that everything is consistent from the start, no
> chance of forgetting something in the middle. So yes, (2) is fine with
> me, but the "rename to something meaningful" part has to be part of a
> larger API change, since the host vs target misnaming is very sticky.

Here are the amended patches for this change.
Tested on amd64-linux and cross to ARM.
Ok with these changes?

Thanks,
Sebastian
--
Qualcomm Innovation Center, Inc is a member of Code Aurora Forum
From 9aaecc3711601e98904878f9a293c42392be7b56 Mon Sep 17 00:00:00 2001
From: Sebastian Pop <[email protected]>
Date: Mon, 31 Oct 2011 11:38:36 -0500
Subject: [PATCH 1/3] derive LLVM_HOSTTRIPLE from target

---
 autoconf/configure.ac                 |    2 +-
 configure                             |    2 +-
 projects/sample/autoconf/configure.ac |    2 +-
 projects/sample/configure             |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/autoconf/configure.ac b/autoconf/configure.ac
index 8b64ce1..7586ba7 100644
--- a/autoconf/configure.ac
+++ b/autoconf/configure.ac
@@ -1453,7 +1453,7 @@ AC_DEFINE_UNQUOTED(LLVM_MANDIR, "$LLVM_MANDIR",
                    [Installation directory for man pages])
 AC_DEFINE_UNQUOTED(LLVM_CONFIGTIME, "$LLVM_CONFIGTIME",
                    [Time at which LLVM was configured])
-AC_DEFINE_UNQUOTED(LLVM_HOSTTRIPLE, "$host",
+AC_DEFINE_UNQUOTED(LLVM_HOSTTRIPLE, "$target",
                    [Host triple we were built on])
 
 # Determine which bindings to build.
diff --git a/configure b/configure
index a1eb3b1..a10276b 100755
--- a/configure
+++ b/configure
@@ -20865,7 +20865,7 @@ _ACEOF
 
 
 cat >>confdefs.h <<_ACEOF
-#define LLVM_HOSTTRIPLE "$host"
+#define LLVM_HOSTTRIPLE "$target"
 _ACEOF
 
 
diff --git a/projects/sample/autoconf/configure.ac b/projects/sample/autoconf/configure.ac
index fae0060..a5d786d 100644
--- a/projects/sample/autoconf/configure.ac
+++ b/projects/sample/autoconf/configure.ac
@@ -1386,7 +1386,7 @@ AC_DEFINE_UNQUOTED(LLVM_MANDIR, "$LLVM_MANDIR",
                    [Installation directory for man pages])
 AC_DEFINE_UNQUOTED(LLVM_CONFIGTIME, "$LLVM_CONFIGTIME",
                    [Time at which LLVM was configured])
-AC_DEFINE_UNQUOTED(LLVM_HOSTTRIPLE, "$host",
+AC_DEFINE_UNQUOTED(LLVM_HOSTTRIPLE, "$target",
                    [Host triple we were built on])
 
 # Determine which bindings to build.
diff --git a/projects/sample/configure b/projects/sample/configure
index 921afb5..1045b5d 100755
--- a/projects/sample/configure
+++ b/projects/sample/configure
@@ -20815,7 +20815,7 @@ _ACEOF
 
 
 cat >>confdefs.h <<_ACEOF
-#define LLVM_HOSTTRIPLE "$host"
+#define LLVM_HOSTTRIPLE "$target"
 _ACEOF
 
 
-- 
1.7.4.1

From fe9640ea4187ed3530f83635476e48f6618fbdeb Mon Sep 17 00:00:00 2001
From: Sebastian Pop <[email protected]>
Date: Mon, 31 Oct 2011 11:59:54 -0500
Subject: [PATCH 2/3] rename LLVM_HOSTTRIPLE into LLVM_DEFAULT_TARGET_TRIPLE

---
 autoconf/configure.ac                   |    4 ++--
 cmake/config-ix.cmake                   |    7 +++----
 configure                               |    2 +-
 include/llvm/Config/config.h.cmake      |    2 +-
 include/llvm/Config/config.h.in         |    6 +++---
 include/llvm/Config/llvm-config.h.cmake |    2 +-
 include/llvm/Config/llvm-config.h.in    |    2 +-
 lib/Support/Unix/Host.inc               |    5 +----
 lib/Support/Windows/Host.inc            |    3 +--
 projects/sample/autoconf/configure.ac   |    4 ++--
 projects/sample/configure               |    2 +-
 11 files changed, 17 insertions(+), 22 deletions(-)

diff --git a/autoconf/configure.ac b/autoconf/configure.ac
index 7586ba7..6e9d848 100644
--- a/autoconf/configure.ac
+++ b/autoconf/configure.ac
@@ -1453,8 +1453,8 @@ AC_DEFINE_UNQUOTED(LLVM_MANDIR, "$LLVM_MANDIR",
                    [Installation directory for man pages])
 AC_DEFINE_UNQUOTED(LLVM_CONFIGTIME, "$LLVM_CONFIGTIME",
                    [Time at which LLVM was configured])
-AC_DEFINE_UNQUOTED(LLVM_HOSTTRIPLE, "$target",
-                   [Host triple we were built on])
+AC_DEFINE_UNQUOTED(LLVM_DEFAULT_TARGET_TRIPLE, "$target",
+                   [Target triple LLVM will generate code for by default])
 
 # Determine which bindings to build.
 if test "$BINDINGS_TO_BUILD" = auto ; then
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
index 18549a3..62699fa 100755
--- a/cmake/config-ix.cmake
+++ b/cmake/config-ix.cmake
@@ -286,15 +286,14 @@ include(CheckCXXCompilerFlag)
 check_cxx_compiler_flag("-Wno-variadic-macros" SUPPORTS_NO_VARIADIC_MACROS_FLAG)
 
 include(GetTargetTriple)
-get_target_triple(LLVM_HOSTTRIPLE)
+get_target_triple(LLVM_DEFAULT_TARGET_TRIPLE)
 
-# FIXME: We don't distinguish the target and the host. :(
-set(TARGET_TRIPLE "${LLVM_HOSTTRIPLE}")
+set(TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE}")
 
 # Determine the native architecture.
 string(TOLOWER "${LLVM_TARGET_ARCH}" LLVM_NATIVE_ARCH)
 if( LLVM_NATIVE_ARCH STREQUAL "host" )
-  string(REGEX MATCH "^[^-]*" LLVM_NATIVE_ARCH ${LLVM_HOSTTRIPLE})
+  string(REGEX MATCH "^[^-]*" LLVM_NATIVE_ARCH ${LLVM_DEFAULT_TARGET_TRIPLE})
 endif ()
 
 if (LLVM_NATIVE_ARCH MATCHES "i[2-6]86")
diff --git a/configure b/configure
index 8d84133..3b97c3a 100755
--- a/configure
+++ b/configure
@@ -20865,7 +20865,7 @@ _ACEOF
 
 
 cat >>confdefs.h <<_ACEOF
-#define LLVM_HOSTTRIPLE "$target"
+#define LLVM_DEFAULT_TARGET_TRIPLE "$target"
 _ACEOF
 
 
diff --git a/include/llvm/Config/config.h.cmake b/include/llvm/Config/config.h.cmake
index e44d429..69e3eef 100644
--- a/include/llvm/Config/config.h.cmake
+++ b/include/llvm/Config/config.h.cmake
@@ -555,7 +555,7 @@
 #cmakedefine01 LLVM_HAS_ATOMICS
 
 /* Host triple we were built on */
-#cmakedefine LLVM_HOSTTRIPLE "${LLVM_HOSTTRIPLE}"
+#cmakedefine LLVM_DEFAULT_TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE}"
 
 /* Installation directory for include files */
 #cmakedefine LLVM_INCLUDEDIR "${LLVM_INCLUDEDIR}"
diff --git a/include/llvm/Config/config.h.in b/include/llvm/Config/config.h.in
index 3670de5..813c6eb 100644
--- a/include/llvm/Config/config.h.in
+++ b/include/llvm/Config/config.h.in
@@ -543,6 +543,9 @@
 /* Installation directory for data files */
 #undef LLVM_DATADIR
 
+/* Target triple LLVM will generate code for by default */
+#undef LLVM_DEFAULT_TARGET_TRIPLE
+
 /* Installation directory for documentation */
 #undef LLVM_DOCSDIR
 
@@ -552,9 +555,6 @@
 /* Has gcc/MSVC atomic intrinsics */
 #undef LLVM_HAS_ATOMICS
 
-/* Host triple we were built on */
-#undef LLVM_HOSTTRIPLE
-
 /* Installation directory for include files */
 #undef LLVM_INCLUDEDIR
 
diff --git a/include/llvm/Config/llvm-config.h.cmake b/include/llvm/Config/llvm-config.h.cmake
index 4147fd1..8383886 100644
--- a/include/llvm/Config/llvm-config.h.cmake
+++ b/include/llvm/Config/llvm-config.h.cmake
@@ -35,7 +35,7 @@
 #cmakedefine01 LLVM_HAS_ATOMICS
 
 /* Host triple we were built on */
-#cmakedefine LLVM_HOSTTRIPLE "${LLVM_HOSTTRIPLE}"
+#cmakedefine LLVM_DEFAULT_TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE}"
 
 /* Installation directory for include files */
 #cmakedefine LLVM_INCLUDEDIR "${LLVM_INCLUDEDIR}"
diff --git a/include/llvm/Config/llvm-config.h.in b/include/llvm/Config/llvm-config.h.in
index b2257f3..1dd7ed6 100644
--- a/include/llvm/Config/llvm-config.h.in
+++ b/include/llvm/Config/llvm-config.h.in
@@ -35,7 +35,7 @@
 #undef LLVM_HAS_ATOMICS
 
 /* Host triple we were built on */
-#undef LLVM_HOSTTRIPLE
+#undef LLVM_DEFAULT_TARGET_TRIPLE
 
 /* Installation directory for include files */
 #undef LLVM_INCLUDEDIR
diff --git a/lib/Support/Unix/Host.inc b/lib/Support/Unix/Host.inc
index dda3ce2..dc16417 100644
--- a/lib/Support/Unix/Host.inc
+++ b/lib/Support/Unix/Host.inc
@@ -36,10 +36,7 @@ static std::string getOSVersion() {
 }
 
 std::string sys::getHostTriple() {
-  // FIXME: Derive directly instead of relying on the autoconf generated
-  // variable.
-
-  StringRef HostTripleString(LLVM_HOSTTRIPLE);
+  StringRef HostTripleString(LLVM_DEFAULT_TARGET_TRIPLE);
   std::pair<StringRef, StringRef> ArchSplit = HostTripleString.split('-');
 
   // Normalize the arch, since the host triple may not actually match the host.
diff --git a/lib/Support/Windows/Host.inc b/lib/Support/Windows/Host.inc
index 733830e..5bbc74e 100644
--- a/lib/Support/Windows/Host.inc
+++ b/lib/Support/Windows/Host.inc
@@ -18,6 +18,5 @@
 using namespace llvm;
 
 std::string sys::getHostTriple() {
-  // FIXME: Adapt to running version.
-  return LLVM_HOSTTRIPLE;
+  return LLVM_DEFAULT_TARGET_TRIPLE;
 }
diff --git a/projects/sample/autoconf/configure.ac b/projects/sample/autoconf/configure.ac
index a5d786d..ab15892 100644
--- a/projects/sample/autoconf/configure.ac
+++ b/projects/sample/autoconf/configure.ac
@@ -1386,8 +1386,8 @@ AC_DEFINE_UNQUOTED(LLVM_MANDIR, "$LLVM_MANDIR",
                    [Installation directory for man pages])
 AC_DEFINE_UNQUOTED(LLVM_CONFIGTIME, "$LLVM_CONFIGTIME",
                    [Time at which LLVM was configured])
-AC_DEFINE_UNQUOTED(LLVM_HOSTTRIPLE, "$target",
-                   [Host triple we were built on])
+AC_DEFINE_UNQUOTED(LLVM_DEFAULT_TARGET_TRIPLE, "$target",
+                   [Target triple LLVM will generate code for by default])
 
 # Determine which bindings to build.
 if test "$BINDINGS_TO_BUILD" = auto ; then
diff --git a/projects/sample/configure b/projects/sample/configure
index d91704e..75da00e 100755
--- a/projects/sample/configure
+++ b/projects/sample/configure
@@ -20814,7 +20814,7 @@ _ACEOF
 
 
 cat >>confdefs.h <<_ACEOF
-#define LLVM_HOSTTRIPLE "$target"
+#define LLVM_DEFAULT_TARGET_TRIPLE "$target"
 _ACEOF
 
 
-- 
1.7.4.1

From fd9e3bf0addf8573e6f7d685f7682fc42e97c840 Mon Sep 17 00:00:00 2001
From: Sebastian Pop <[email protected]>
Date: Mon, 31 Oct 2011 13:47:42 -0500
Subject: [PATCH 3/3] rename getHostTriple into getDefaultTargetTriple

---
 include/llvm/Support/Host.h          |    4 ++--
 lib/ExecutionEngine/TargetSelect.cpp |    2 +-
 lib/Support/CommandLine.cpp          |    2 +-
 lib/Support/TargetRegistry.cpp       |    2 +-
 lib/Support/Unix/Host.inc            |   10 +++++-----
 lib/Support/Windows/Host.inc         |    2 +-
 lib/Target/CBackend/CBackend.cpp     |    4 ++--
 tools/bugpoint/BugDriver.cpp         |    2 +-
 tools/llc/llc.cpp                    |    2 +-
 tools/llvm-mc/llvm-mc.cpp            |    2 +-
 tools/lto/LTOCodeGenerator.cpp       |    2 +-
 tools/lto/LTOModule.cpp              |    2 +-
 12 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/include/llvm/Support/Host.h b/include/llvm/Support/Host.h
index f77d4c1..d52f631 100644
--- a/include/llvm/Support/Host.h
+++ b/include/llvm/Support/Host.h
@@ -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
diff --git a/lib/ExecutionEngine/TargetSelect.cpp b/lib/ExecutionEngine/TargetSelect.cpp
index 004b865..45480a6 100644
--- a/lib/ExecutionEngine/TargetSelect.cpp
+++ b/lib/ExecutionEngine/TargetSelect.cpp
@@ -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;
diff --git a/lib/Support/CommandLine.cpp b/lib/Support/CommandLine.cpp
index 238adcc..4b43ae9 100644
--- a/lib/Support/CommandLine.cpp
+++ b/lib/Support/CommandLine.cpp
@@ -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) {
diff --git a/lib/Support/TargetRegistry.cpp b/lib/Support/TargetRegistry.cpp
index 7497bfe..53c8d84 100644
--- a/lib/Support/TargetRegistry.cpp
+++ b/lib/Support/TargetRegistry.cpp
@@ -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";
diff --git a/lib/Support/Unix/Host.inc b/lib/Support/Unix/Host.inc
index dc16417..726e2fb 100644
--- a/lib/Support/Unix/Host.inc
+++ b/lib/Support/Unix/Host.inc
@@ -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"));
diff --git a/lib/Support/Windows/Host.inc b/lib/Support/Windows/Host.inc
index 5bbc74e..2e6d6f1 100644
--- a/lib/Support/Windows/Host.inc
+++ b/lib/Support/Windows/Host.inc
@@ -17,6 +17,6 @@
 
 using namespace llvm;
 
-std::string sys::getHostTriple() {
+std::string sys::getDefaultTargetTriple() {
   return LLVM_DEFAULT_TARGET_TRIPLE;
 }
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp
index 69d8c46..06e812b 100644
--- a/lib/Target/CBackend/CBackend.cpp
+++ b/lib/Target/CBackend/CBackend.cpp
@@ -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))
diff --git a/tools/bugpoint/BugDriver.cpp b/tools/bugpoint/BugDriver.cpp
index 0b59a78..6b219bf 100644
--- a/tools/bugpoint/BugDriver.cpp
+++ b/tools/bugpoint/BugDriver.cpp
@@ -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());
     }
diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp
index be6afec..1694e01 100644
--- a/tools/llc/llc.cpp
+++ b/tools/llc/llc.cpp
@@ -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
diff --git a/tools/llvm-mc/llvm-mc.cpp b/tools/llvm-mc/llvm-mc.cpp
index 280a1bb..c188a76 100644
--- a/tools/llvm-mc/llvm-mc.cpp
+++ b/tools/llvm-mc/llvm-mc.cpp
@@ -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;
diff --git a/tools/lto/LTOCodeGenerator.cpp b/tools/lto/LTOCodeGenerator.cpp
index 6c8dbad..c8a0bf1 100644
--- a/tools/lto/LTOCodeGenerator.cpp
+++ b/tools/lto/LTOCodeGenerator.cpp
@@ -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);
diff --git a/tools/lto/LTOModule.cpp b/tools/lto/LTOModule.cpp
index 4ba8985..8deaf4c 100644
--- a/tools/lto/LTOModule.cpp
+++ b/tools/lto/LTOModule.cpp
@@ -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);
-- 
1.7.4.1

From c7f4c0cc2bddc0ce55e8ca8a324f521894b5b3d6 Mon Sep 17 00:00:00 2001
From: Sebastian Pop <[email protected]>
Date: Mon, 31 Oct 2011 13:49:16 -0500
Subject: [PATCH] rename getHostTriple into getDefaultTargetTriple in clang

---
 examples/clang-interpreter/main.cpp              |    2 +-
 lib/Frontend/CompilerInstance.cpp                |    2 +-
 lib/Frontend/CompilerInvocation.cpp              |    4 ++--
 lib/Frontend/CreateInvocationFromCommandLine.cpp |    2 +-
 tools/driver/cc1as_main.cpp                      |    4 ++--
 tools/driver/driver.cpp                          |    2 +-
 6 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/examples/clang-interpreter/main.cpp b/examples/clang-interpreter/main.cpp
index c9734e5..4192c09 100644
--- a/examples/clang-interpreter/main.cpp
+++ b/examples/clang-interpreter/main.cpp
@@ -76,7 +76,7 @@ int main(int argc, const char **argv, char * const *envp) {
 
   llvm::IntrusiveRefCntPtr<DiagnosticIDs> DiagID(new DiagnosticIDs());
   DiagnosticsEngine Diags(DiagID, DiagClient);
-  Driver TheDriver(Path.str(), llvm::sys::getHostTriple(),
+  Driver TheDriver(Path.str(), llvm::sys::getDefaultTargetTriple(),
                    "a.out", /*IsProduction=*/false, Diags);
   TheDriver.setTitle("clang interpreter");
 
diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp
index 9b96141..f4d0a15 100644
--- a/lib/Frontend/CompilerInstance.cpp
+++ b/lib/Frontend/CompilerInstance.cpp
@@ -639,7 +639,7 @@ bool CompilerInstance::ExecuteAction(FrontendAction &Act) {
   if (getHeaderSearchOpts().Verbose)
     OS << "clang -cc1 version " CLANG_VERSION_STRING
        << " based upon " << PACKAGE_STRING
-       << " hosted on " << llvm::sys::getHostTriple() << "\n";
+       << " default target " << llvm::sys::getDefaultTargetTriple() << "\n";
 
   if (getFrontendOpts().ShowTimers)
     createFrontendTimer();
diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp
index 6950647..79e087e 100644
--- a/lib/Frontend/CompilerInvocation.cpp
+++ b/lib/Frontend/CompilerInvocation.cpp
@@ -1915,9 +1915,9 @@ static void ParseTargetArgs(TargetOptions &Opts, ArgList &Args) {
   Opts.LinkerVersion = Args.getLastArgValue(OPT_target_linker_version);
   Opts.Triple = llvm::Triple::normalize(Args.getLastArgValue(OPT_triple));
 
-  // Use the host triple if unspecified.
+  // Use the default target triple if unspecified.
   if (Opts.Triple.empty())
-    Opts.Triple = llvm::sys::getHostTriple();
+    Opts.Triple = llvm::sys::getDefaultTargetTriple();
 }
 
 //
diff --git a/lib/Frontend/CreateInvocationFromCommandLine.cpp b/lib/Frontend/CreateInvocationFromCommandLine.cpp
index fc15081..e94b944 100644
--- a/lib/Frontend/CreateInvocationFromCommandLine.cpp
+++ b/lib/Frontend/CreateInvocationFromCommandLine.cpp
@@ -48,7 +48,7 @@ clang::createInvocationFromCommandLine(ArrayRef<const char *> ArgList,
   Args.push_back("-fsyntax-only");
 
   // FIXME: We shouldn't have to pass in the path info.
-  driver::Driver TheDriver("clang", llvm::sys::getHostTriple(),
+  driver::Driver TheDriver("clang", llvm::sys::getDefaultTargetTriple(),
                            "a.out", false, *Diags);
 
   // Don't check that inputs exist, they may have been remapped.
diff --git a/tools/driver/cc1as_main.cpp b/tools/driver/cc1as_main.cpp
index 4215a32..5a17512 100644
--- a/tools/driver/cc1as_main.cpp
+++ b/tools/driver/cc1as_main.cpp
@@ -151,8 +151,8 @@ void AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,
 
   // Target Options
   Opts.Triple = Triple::normalize(Args->getLastArgValue(OPT_triple));
-  if (Opts.Triple.empty()) // Use the host triple if unspecified.
-    Opts.Triple = sys::getHostTriple();
+  if (Opts.Triple.empty()) // Use the default target triple if unspecified.
+    Opts.Triple = sys::getDefaultTargetTriple();
 
   // Language Options
   Opts.IncludePaths = Args->getAllArgValues(OPT_I);
diff --git a/tools/driver/driver.cpp b/tools/driver/driver.cpp
index bd1d2a2..4f5d3fe 100644
--- a/tools/driver/driver.cpp
+++ b/tools/driver/driver.cpp
@@ -382,7 +382,7 @@ int main(int argc_, const char **argv_) {
 #else
   const bool IsProduction = false;
 #endif
-  Driver TheDriver(Path.str(), llvm::sys::getHostTriple(),
+  Driver TheDriver(Path.str(), llvm::sys::getDefaultTargetTriple(),
                    "a.out", IsProduction, Diags);
 
   // Attempt to find the original path used to invoke the driver, to determine
-- 
1.7.4.1

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to