From 53d6e3b9d38da43efde49420c8bb8f09eb77f6df Mon Sep 17 00:00:00 2001 From: Sebastian Pop Date: Thu, 5 Jan 2012 18:28:46 +0000 Subject: [PATCH] revert r147542 after comments from Joerg Sonnenberger llvm-svn: 147608 --- autoconf/configure.ac | 2 -- cmake/config-ix.cmake | 3 --- configure | 5 ----- include/llvm/Config/config.h.cmake | 3 --- include/llvm/Config/config.h.in | 3 --- include/llvm/Config/llvm-config.h.cmake | 3 --- include/llvm/Config/llvm-config.h.in | 3 --- include/llvm/Support/Host.h | 8 -------- lib/Support/CommandLine.cpp | 1 - lib/Support/TargetRegistry.cpp | 2 +- lib/Support/Unix/Host.inc | 18 ++++++------------ lib/Support/Windows/Host.inc | 4 ---- projects/sample/autoconf/configure.ac | 2 -- projects/sample/configure | 13 ++++--------- 14 files changed, 11 insertions(+), 59 deletions(-) diff --git a/autoconf/configure.ac b/autoconf/configure.ac index a5ccd3361cb..646d9a85910 100644 --- a/autoconf/configure.ac +++ b/autoconf/configure.ac @@ -1484,8 +1484,6 @@ 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_HOST_TRIPLE, "$host", - [Host triple LLVM will run on]) AC_DEFINE_UNQUOTED(LLVM_DEFAULT_TARGET_TRIPLE, "$target", [Target triple LLVM will generate code for by default]) diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake index 4ee433ae941..b380a48637f 100755 --- a/cmake/config-ix.cmake +++ b/cmake/config-ix.cmake @@ -288,16 +288,13 @@ include(CheckCXXCompilerFlag) check_cxx_compiler_flag("-Wno-variadic-macros" SUPPORTS_NO_VARIADIC_MACROS_FLAG) include(GetTargetTriple) -get_target_triple(LLVM_HOST_TRIPLE) get_target_triple(LLVM_DEFAULT_TARGET_TRIPLE) -set(HOST_TRIPLE "${LLVM_HOST_TRIPLE}") 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_HOST_TRIPLE}) string(REGEX MATCH "^[^-]*" LLVM_NATIVE_ARCH ${LLVM_DEFAULT_TARGET_TRIPLE}) endif () diff --git a/configure b/configure index 5ea1319f0dc..d0c3beb7eb4 100755 --- a/configure +++ b/configure @@ -20912,11 +20912,6 @@ cat >>confdefs.h <<_ACEOF _ACEOF -cat >>confdefs.h <<_ACEOF -#define LLVM_HOST_TRIPLE "$host" -_ACEOF - - cat >>confdefs.h <<_ACEOF #define LLVM_DEFAULT_TARGET_TRIPLE "$target" _ACEOF diff --git a/include/llvm/Config/config.h.cmake b/include/llvm/Config/config.h.cmake index 920bc4153f3..b4356b18c7e 100644 --- a/include/llvm/Config/config.h.cmake +++ b/include/llvm/Config/config.h.cmake @@ -560,9 +560,6 @@ /* Has gcc/MSVC atomic intrinsics */ #cmakedefine01 LLVM_HAS_ATOMICS -/* Host triple LLVM will run on */ -#cmakedefine LLVM_HOST_TRIPLE "${LLVM_HOST_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 f49e176391b..30afa5890be 100644 --- a/include/llvm/Config/config.h.in +++ b/include/llvm/Config/config.h.in @@ -558,9 +558,6 @@ /* Has gcc/MSVC atomic intrinsics */ #undef LLVM_HAS_ATOMICS -/* Host triple LLVM will run on */ -#undef LLVM_HOST_TRIPLE - /* 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 5cc35e662fc..0c5b542679b 100644 --- a/include/llvm/Config/llvm-config.h.cmake +++ b/include/llvm/Config/llvm-config.h.cmake @@ -40,9 +40,6 @@ /* Has gcc/MSVC atomic intrinsics */ #cmakedefine01 LLVM_HAS_ATOMICS -/* Host triple LLVM will run on */ -#cmakedefine LLVM_HOST_TRIPLE "${LLVM_HOST_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 a06162f92aa..30a935bf9c2 100644 --- a/include/llvm/Config/llvm-config.h.in +++ b/include/llvm/Config/llvm-config.h.in @@ -40,9 +40,6 @@ /* Has gcc/MSVC atomic intrinsics */ #undef LLVM_HAS_ATOMICS -/* Host triple LLVM will run on */ -#undef LLVM_HOST_TRIPLE - /* Installation directory for include files */ #undef LLVM_INCLUDEDIR diff --git a/include/llvm/Support/Host.h b/include/llvm/Support/Host.h index b68a7ae4c99..b3310163226 100644 --- a/include/llvm/Support/Host.h +++ b/include/llvm/Support/Host.h @@ -33,14 +33,6 @@ namespace sys { return !isLittleEndianHost(); } - /// getHostTriple() - Return the host where the compiler will be running. - /// - /// The host triple is a string in the format of: - /// CPU_TYPE-VENDOR-OPERATING_SYSTEM - /// or - /// CPU_TYPE-VENDOR-KERNEL-OPERATING_SYSTEM - std::string getHostTriple(); - /// getDefaultTargetTriple() - Return the default target triple the compiler /// has been configured to produce code for. /// diff --git a/lib/Support/CommandLine.cpp b/lib/Support/CommandLine.cpp index 9e8207baa88..ce9344954bc 100644 --- a/lib/Support/CommandLine.cpp +++ b/lib/Support/CommandLine.cpp @@ -1373,7 +1373,6 @@ public: << " Built " << __DATE__ << " (" << __TIME__ << ").\n" #endif << " Default target: " << sys::getDefaultTargetTriple() << '\n' - << " Host: " << sys::getHostTriple() << '\n' << " Host CPU: " << CPU << '\n'; } void operator=(bool OptionWasSpecified) { diff --git a/lib/Support/TargetRegistry.cpp b/lib/Support/TargetRegistry.cpp index 7497bfe035c..53c8d84e7d4 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 82f717fc39b..726e2fbcf05 100644 --- a/lib/Support/Unix/Host.inc +++ b/lib/Support/Unix/Host.inc @@ -35,9 +35,13 @@ static std::string getOSVersion() { return info.release; } -std::string getTriple(StringRef &TripleString) { - std::pair ArchSplit = TripleString.split('-'); +std::string sys::getDefaultTargetTriple() { + StringRef TargetTripleString(LLVM_DEFAULT_TARGET_TRIPLE); + std::pair ArchSplit = TargetTripleString.split('-'); + + // Normalize the arch, since the target triple may not actually match the target. std::string Arch = ArchSplit.first; + std::string Triple(Arch); Triple += '-'; Triple += ArchSplit.second; @@ -57,13 +61,3 @@ std::string getTriple(StringRef &TripleString) { return Triple; } - -std::string sys::getDefaultTargetTriple() { - StringRef TargetTripleString(LLVM_DEFAULT_TARGET_TRIPLE); - return getTriple(TargetTripleString); -} - -std::string sys::getHostTriple() { - StringRef HostTripleString(LLVM_HOST_TRIPLE); - return getTriple(HostTripleString); -} diff --git a/lib/Support/Windows/Host.inc b/lib/Support/Windows/Host.inc index cce82349cd6..2e6d6f19037 100644 --- a/lib/Support/Windows/Host.inc +++ b/lib/Support/Windows/Host.inc @@ -20,7 +20,3 @@ using namespace llvm; std::string sys::getDefaultTargetTriple() { return LLVM_DEFAULT_TARGET_TRIPLE; } - -std::string sys::getHostTriple() { - return LLVM_HOST_TRIPLE; -} diff --git a/projects/sample/autoconf/configure.ac b/projects/sample/autoconf/configure.ac index 3fd02578c4f..a19e87ddf95 100644 --- a/projects/sample/autoconf/configure.ac +++ b/projects/sample/autoconf/configure.ac @@ -1390,8 +1390,6 @@ 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_HOST_TRIPLE, "$host", - [Host triple LLVM will run on]) AC_DEFINE_UNQUOTED(LLVM_DEFAULT_TARGET_TRIPLE, "$target", [Target triple LLVM will generate code for by default]) diff --git a/projects/sample/configure b/projects/sample/configure index f64383b3bdc..860faa29271 100755 --- a/projects/sample/configure +++ b/projects/sample/configure @@ -8854,7 +8854,7 @@ dgux*) shlibpath_var=LD_LIBRARY_PATH ;; -freebsd1.*) +freebsd1*) dynamic_linker=no ;; @@ -8877,7 +8877,7 @@ freebsd* | dragonfly*) objformat=`/usr/bin/objformat` else case $host_os in - freebsd[123].*) objformat=aout ;; + freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi @@ -8895,7 +8895,7 @@ freebsd* | dragonfly*) esac shlibpath_var=LD_LIBRARY_PATH case $host_os in - freebsd2.*) + freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) @@ -10409,7 +10409,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <>confdefs.h <<_ACEOF _ACEOF -cat >>confdefs.h <<_ACEOF -#define LLVM_HOST_TRIPLE "$host" -_ACEOF - - cat >>confdefs.h <<_ACEOF #define LLVM_DEFAULT_TARGET_TRIPLE "$target" _ACEOF