mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
rename getHostTriple into getDefaultTargetTriple
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143502 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
de2e0b5e6d
commit
0173864d8a
@ -33,14 +33,14 @@ namespace sys {
|
|||||||
return !isLittleEndianHost();
|
return !isLittleEndianHost();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getHostTriple() - Return the target triple of the running
|
/// getDefaultTargetTriple() - Return the target triple of the running
|
||||||
/// system.
|
/// system.
|
||||||
///
|
///
|
||||||
/// The target triple is a string in the format of:
|
/// The target triple is a string in the format of:
|
||||||
/// CPU_TYPE-VENDOR-OPERATING_SYSTEM
|
/// CPU_TYPE-VENDOR-OPERATING_SYSTEM
|
||||||
/// or
|
/// or
|
||||||
/// CPU_TYPE-VENDOR-KERNEL-OPERATING_SYSTEM
|
/// CPU_TYPE-VENDOR-KERNEL-OPERATING_SYSTEM
|
||||||
std::string getHostTriple();
|
std::string getDefaultTargetTriple();
|
||||||
|
|
||||||
/// getHostCPUName - Get the LLVM name for the host CPU. The particular format
|
/// 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
|
/// of the name is target dependent, and suitable for passing as -mcpu to the
|
||||||
|
@ -35,7 +35,7 @@ TargetMachine *EngineBuilder::selectTarget(Module *Mod,
|
|||||||
std::string *ErrorStr) {
|
std::string *ErrorStr) {
|
||||||
Triple TheTriple(Mod->getTargetTriple());
|
Triple TheTriple(Mod->getTargetTriple());
|
||||||
if (TheTriple.getTriple().empty())
|
if (TheTriple.getTriple().empty())
|
||||||
TheTriple.setTriple(sys::getHostTriple());
|
TheTriple.setTriple(sys::getDefaultTargetTriple());
|
||||||
|
|
||||||
// Adjust the triple to match what the user requested.
|
// Adjust the triple to match what the user requested.
|
||||||
const Target *TheTarget = 0;
|
const Target *TheTarget = 0;
|
||||||
|
@ -1369,7 +1369,7 @@ public:
|
|||||||
#if (ENABLE_TIMESTAMPS == 1)
|
#if (ENABLE_TIMESTAMPS == 1)
|
||||||
<< " Built " << __DATE__ << " (" << __TIME__ << ").\n"
|
<< " Built " << __DATE__ << " (" << __TIME__ << ").\n"
|
||||||
#endif
|
#endif
|
||||||
<< " Host: " << sys::getHostTriple() << '\n'
|
<< " Default target: " << sys::getDefaultTargetTriple() << '\n'
|
||||||
<< " Host CPU: " << CPU << '\n';
|
<< " Host CPU: " << CPU << '\n';
|
||||||
}
|
}
|
||||||
void operator=(bool OptionWasSpecified) {
|
void operator=(bool OptionWasSpecified) {
|
||||||
|
@ -84,7 +84,7 @@ void TargetRegistry::RegisterTarget(Target &T,
|
|||||||
}
|
}
|
||||||
|
|
||||||
const Target *TargetRegistry::getClosestTargetForJIT(std::string &Error) {
|
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()) {
|
if (TheTarget && !TheTarget->hasJIT()) {
|
||||||
Error = "No JIT compatible target available for this host";
|
Error = "No JIT compatible target available for this host";
|
||||||
|
@ -35,11 +35,11 @@ static std::string getOSVersion() {
|
|||||||
return info.release;
|
return info.release;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string sys::getHostTriple() {
|
std::string sys::getDefaultTargetTriple() {
|
||||||
StringRef HostTripleString(LLVM_DEFAULT_TARGET_TRIPLE);
|
StringRef TargetTripleString(LLVM_DEFAULT_TARGET_TRIPLE);
|
||||||
std::pair<StringRef, StringRef> ArchSplit = HostTripleString.split('-');
|
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 Arch = ArchSplit.first;
|
||||||
|
|
||||||
std::string Triple(Arch);
|
std::string Triple(Arch);
|
||||||
@ -52,7 +52,7 @@ std::string sys::getHostTriple() {
|
|||||||
Triple[1] = '3';
|
Triple[1] = '3';
|
||||||
|
|
||||||
// On darwin, we want to update the version to match that of the
|
// On darwin, we want to update the version to match that of the
|
||||||
// host.
|
// target.
|
||||||
std::string::size_type DarwinDashIdx = Triple.find("-darwin");
|
std::string::size_type DarwinDashIdx = Triple.find("-darwin");
|
||||||
if (DarwinDashIdx != std::string::npos) {
|
if (DarwinDashIdx != std::string::npos) {
|
||||||
Triple.resize(DarwinDashIdx + strlen("-darwin"));
|
Triple.resize(DarwinDashIdx + strlen("-darwin"));
|
||||||
|
@ -17,6 +17,6 @@
|
|||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
std::string sys::getHostTriple() {
|
std::string sys::getDefaultTargetTriple() {
|
||||||
return LLVM_DEFAULT_TARGET_TRIPLE;
|
return LLVM_DEFAULT_TARGET_TRIPLE;
|
||||||
}
|
}
|
||||||
|
@ -1660,7 +1660,7 @@ bool CWriter::doInitialization(Module &M) {
|
|||||||
#if 0
|
#if 0
|
||||||
std::string Triple = TheModule->getTargetTriple();
|
std::string Triple = TheModule->getTargetTriple();
|
||||||
if (Triple.empty())
|
if (Triple.empty())
|
||||||
Triple = llvm::sys::getHostTriple();
|
Triple = llvm::sys::getDefaultTargetTriple();
|
||||||
|
|
||||||
std::string E;
|
std::string E;
|
||||||
if (const Target *Match = TargetRegistry::lookupTarget(Triple, E))
|
if (const Target *Match = TargetRegistry::lookupTarget(Triple, E))
|
||||||
@ -3167,7 +3167,7 @@ std::string CWriter::InterpretASMConstraint(InlineAsm::ConstraintInfo& c) {
|
|||||||
const MCAsmInfo *TargetAsm;
|
const MCAsmInfo *TargetAsm;
|
||||||
std::string Triple = TheModule->getTargetTriple();
|
std::string Triple = TheModule->getTargetTriple();
|
||||||
if (Triple.empty())
|
if (Triple.empty())
|
||||||
Triple = llvm::sys::getHostTriple();
|
Triple = llvm::sys::getDefaultTargetTriple();
|
||||||
|
|
||||||
std::string E;
|
std::string E;
|
||||||
if (const Target *Match = TargetRegistry::lookupTarget(Triple, E))
|
if (const Target *Match = TargetRegistry::lookupTarget(Triple, E))
|
||||||
|
@ -96,7 +96,7 @@ Module *llvm::ParseInputFile(const std::string &Filename,
|
|||||||
Triple TheTriple(Result->getTargetTriple());
|
Triple TheTriple(Result->getTargetTriple());
|
||||||
|
|
||||||
if (TheTriple.getTriple().empty())
|
if (TheTriple.getTriple().empty())
|
||||||
TheTriple.setTriple(sys::getHostTriple());
|
TheTriple.setTriple(sys::getDefaultTargetTriple());
|
||||||
|
|
||||||
TargetTriple.setTriple(TheTriple.getTriple());
|
TargetTriple.setTriple(TheTriple.getTriple());
|
||||||
}
|
}
|
||||||
|
@ -261,7 +261,7 @@ int main(int argc, char **argv) {
|
|||||||
|
|
||||||
Triple TheTriple(mod.getTargetTriple());
|
Triple TheTriple(mod.getTargetTriple());
|
||||||
if (TheTriple.getTriple().empty())
|
if (TheTriple.getTriple().empty())
|
||||||
TheTriple.setTriple(sys::getHostTriple());
|
TheTriple.setTriple(sys::getDefaultTargetTriple());
|
||||||
|
|
||||||
// Allocate target machine. First, check whether the user has explicitly
|
// 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
|
// specified an architecture to compile for. If so we have to look it up by
|
||||||
|
@ -175,7 +175,7 @@ Action(cl::desc("Action to perform:"),
|
|||||||
static const Target *GetTarget(const char *ProgName) {
|
static const Target *GetTarget(const char *ProgName) {
|
||||||
// Figure out the target triple.
|
// Figure out the target triple.
|
||||||
if (TripleName.empty())
|
if (TripleName.empty())
|
||||||
TripleName = sys::getHostTriple();
|
TripleName = sys::getDefaultTargetTriple();
|
||||||
Triple TheTriple(Triple::normalize(TripleName));
|
Triple TheTriple(Triple::normalize(TripleName));
|
||||||
|
|
||||||
const Target *TheTarget = 0;
|
const Target *TheTarget = 0;
|
||||||
|
@ -243,7 +243,7 @@ bool LTOCodeGenerator::determineTarget(std::string& errMsg)
|
|||||||
if ( _target == NULL ) {
|
if ( _target == NULL ) {
|
||||||
std::string Triple = _linker.getModule()->getTargetTriple();
|
std::string Triple = _linker.getModule()->getTargetTriple();
|
||||||
if (Triple.empty())
|
if (Triple.empty())
|
||||||
Triple = sys::getHostTriple();
|
Triple = sys::getDefaultTargetTriple();
|
||||||
|
|
||||||
// create target machine from info for merged modules
|
// create target machine from info for merged modules
|
||||||
const Target *march = TargetRegistry::lookupTarget(Triple, errMsg);
|
const Target *march = TargetRegistry::lookupTarget(Triple, errMsg);
|
||||||
|
@ -151,7 +151,7 @@ LTOModule *LTOModule::makeLTOModule(MemoryBuffer *buffer,
|
|||||||
|
|
||||||
std::string Triple = m->getTargetTriple();
|
std::string Triple = m->getTargetTriple();
|
||||||
if (Triple.empty())
|
if (Triple.empty())
|
||||||
Triple = sys::getHostTriple();
|
Triple = sys::getDefaultTargetTriple();
|
||||||
|
|
||||||
// find machine architecture for this module
|
// find machine architecture for this module
|
||||||
const Target *march = TargetRegistry::lookupTarget(Triple, errMsg);
|
const Target *march = TargetRegistry::lookupTarget(Triple, errMsg);
|
||||||
|
Loading…
Reference in New Issue
Block a user