mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-06 06:33:24 +00:00
Revert r142046, "Fix for llvm::sys::getHostTriple on Windows. Instead of relying on the triple"
It extremely breaks builds when optimization is enabled. Twine should not hold temporary objects. By the way, I might feel sad if I saw "i786-" "i1586-" or "iF86-". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142055 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8e3ef11550
commit
569c4a4767
@ -12,44 +12,12 @@
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#include "Windows.h"
|
#include "Windows.h"
|
||||||
#include "llvm/ADT/Twine.h"
|
#include <cstdio>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
std::string sys::getHostTriple() {
|
std::string sys::getHostTriple() {
|
||||||
// Get the execution environment, not the native environment.
|
// FIXME: Adapt to running version.
|
||||||
SYSTEM_INFO info;
|
return LLVM_HOSTTRIPLE;
|
||||||
::GetSystemInfo(&info);
|
|
||||||
|
|
||||||
Twine ret;
|
|
||||||
switch (info.wProcessorArchitecture) {
|
|
||||||
// If we don't know what the processor architecture is, or it is not one
|
|
||||||
// we currently support, then we should fall back on something reasonable.
|
|
||||||
case PROCESSOR_ARCHITECTURE_IA64:
|
|
||||||
default: return LLVM_HOSTTRIPLE;
|
|
||||||
|
|
||||||
case PROCESSOR_ARCHITECTURE_INTEL:
|
|
||||||
// We need to figure out what kind of x86 it is (possible values are
|
|
||||||
// i386 through i986).
|
|
||||||
ret = Twine("i").concat(Twine(info.wProcessorLevel)).concat("86");
|
|
||||||
break;
|
|
||||||
case PROCESSOR_ARCHITECTURE_AMD64:
|
|
||||||
ret = "amd64";
|
|
||||||
break;
|
|
||||||
case PROCESSOR_ARCHITECTURE_MIPS:
|
|
||||||
ret = "mips";
|
|
||||||
break;
|
|
||||||
case PROCESSOR_ARCHITECTURE_ARM:
|
|
||||||
ret = "arm";
|
|
||||||
break;
|
|
||||||
case PROCESSOR_ARCHITECTURE_PPC:
|
|
||||||
ret = "ppc";
|
|
||||||
break;
|
|
||||||
case PROCESSOR_ARCHITECTURE_ALPHA:
|
|
||||||
ret = "alpha";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Since we're on Windows, we're always on pc-win32.
|
|
||||||
return ret.concat("-pc-win32").str();
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user