aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pop <spop@codeaurora.org>2011-11-01 21:32:20 +0000
committerSebastian Pop <spop@codeaurora.org>2011-11-01 21:32:20 +0000
commit0173864d8a87d9243d304fbf91b556e20b5a32fc (patch)
tree664b5b6cf13cc718f8779b8de94d85079c52f5cf
parentde2e0b5e6d5aa7eccf62df17b86c31b39732bf86 (diff)
rename getHostTriple into getDefaultTargetTriple
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143502 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Support/Host.h4
-rw-r--r--lib/ExecutionEngine/TargetSelect.cpp2
-rw-r--r--lib/Support/CommandLine.cpp2
-rw-r--r--lib/Support/TargetRegistry.cpp2
-rw-r--r--lib/Support/Unix/Host.inc10
-rw-r--r--lib/Support/Windows/Host.inc2
-rw-r--r--lib/Target/CBackend/CBackend.cpp4
-rw-r--r--tools/bugpoint/BugDriver.cpp2
-rw-r--r--tools/llc/llc.cpp2
-rw-r--r--tools/llvm-mc/llvm-mc.cpp2
-rw-r--r--tools/lto/LTOCodeGenerator.cpp2
-rw-r--r--tools/lto/LTOModule.cpp2
12 files changed, 18 insertions, 18 deletions
diff --git a/include/llvm/Support/Host.h b/include/llvm/Support/Host.h
index f77d4c1182..d52f631956 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 004b8656bf..45480a6d59 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 238adcce0a..4b43ae9cf2 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 7497bfe035..53c8d84e7d 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 dc1641722b..726e2fbcf0 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 5bbc74e5a3..2e6d6f1903 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 69d8c46a50..06e812bc6f 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 0b59a7885f..6b219bf085 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 be6afec20a..1694e01cdf 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 280a1bbd99..c188a76f54 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 6c8dbad460..c8a0bf1d58 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 4ba8985e72..8deaf4c427 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);