mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-20 14:29:27 +00:00
Added isTargetWindowsMSVC(), renamed isTargetMingw() to isTargetWindowsGNU()
and isTargetCygwin() to isTargetWindowsCygwin() to be consistent with the four Windows environments in Triple.h. Suggestion by Saleem Abdulrasool! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205393 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
081e6fcd17
commit
9ee14e3522
@ -275,7 +275,7 @@ void X86TargetLowering::resetOperationActions() {
|
|||||||
// Darwin should use _setjmp/_longjmp instead of setjmp/longjmp.
|
// Darwin should use _setjmp/_longjmp instead of setjmp/longjmp.
|
||||||
setUseUnderscoreSetJmp(false);
|
setUseUnderscoreSetJmp(false);
|
||||||
setUseUnderscoreLongJmp(false);
|
setUseUnderscoreLongJmp(false);
|
||||||
} else if (Subtarget->isTargetMingw()) {
|
} else if (Subtarget->isTargetWindowsGNU()) {
|
||||||
// MS runtime is weird: it exports _setjmp, but longjmp!
|
// MS runtime is weird: it exports _setjmp, but longjmp!
|
||||||
setUseUnderscoreSetJmp(true);
|
setUseUnderscoreSetJmp(true);
|
||||||
setUseUnderscoreLongJmp(false);
|
setUseUnderscoreLongJmp(false);
|
||||||
@ -8494,7 +8494,8 @@ X86TargetLowering::LowerGlobalTLSAddress(SDValue Op, SelectionDAG &DAG) const {
|
|||||||
Chain.getValue(1));
|
Chain.getValue(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Subtarget->isTargetKnownWindowsMSVC() || Subtarget->isTargetMingw()) {
|
if (Subtarget->isTargetKnownWindowsMSVC() ||
|
||||||
|
Subtarget->isTargetWindowsGNU()) {
|
||||||
// Just use the implicit TLS architecture
|
// Just use the implicit TLS architecture
|
||||||
// Need to generate someting similar to:
|
// Need to generate someting similar to:
|
||||||
// mov rdx, qword [gs:abs 58H]; Load pointer to ThreadLocalStorage
|
// mov rdx, qword [gs:abs 58H]; Load pointer to ThreadLocalStorage
|
||||||
@ -8522,13 +8523,16 @@ X86TargetLowering::LowerGlobalTLSAddress(SDValue Op, SelectionDAG &DAG) const {
|
|||||||
: Type::getInt32PtrTy(*DAG.getContext(),
|
: Type::getInt32PtrTy(*DAG.getContext(),
|
||||||
257));
|
257));
|
||||||
|
|
||||||
SDValue TlsArray = Subtarget->is64Bit() ? DAG.getIntPtrConstant(0x58) :
|
SDValue TlsArray =
|
||||||
(Subtarget->isTargetMingw() ? DAG.getIntPtrConstant(0x2C) :
|
Subtarget->is64Bit()
|
||||||
DAG.getExternalSymbol("_tls_array", getPointerTy()));
|
? DAG.getIntPtrConstant(0x58)
|
||||||
|
: (Subtarget->isTargetWindowsGNU()
|
||||||
|
? DAG.getIntPtrConstant(0x2C)
|
||||||
|
: DAG.getExternalSymbol("_tls_array", getPointerTy()));
|
||||||
|
|
||||||
SDValue ThreadPointer = DAG.getLoad(getPointerTy(), dl, Chain, TlsArray,
|
SDValue ThreadPointer =
|
||||||
MachinePointerInfo(Ptr),
|
DAG.getLoad(getPointerTy(), dl, Chain, TlsArray,
|
||||||
false, false, false, 0);
|
MachinePointerInfo(Ptr), false, false, false, 0);
|
||||||
|
|
||||||
// Load the _tls_index variable
|
// Load the _tls_index variable
|
||||||
SDValue IDX = DAG.getExternalSymbol("_tls_index", getPointerTy());
|
SDValue IDX = DAG.getExternalSymbol("_tls_index", getPointerTy());
|
||||||
|
@ -343,13 +343,23 @@ public:
|
|||||||
bool isTargetNaCl() const { return TargetTriple.isOSNaCl(); }
|
bool isTargetNaCl() const { return TargetTriple.isOSNaCl(); }
|
||||||
bool isTargetNaCl32() const { return isTargetNaCl() && !is64Bit(); }
|
bool isTargetNaCl32() const { return isTargetNaCl() && !is64Bit(); }
|
||||||
bool isTargetNaCl64() const { return isTargetNaCl() && is64Bit(); }
|
bool isTargetNaCl64() const { return isTargetNaCl() && is64Bit(); }
|
||||||
|
|
||||||
|
bool isTargetWindowsMSVC() const {
|
||||||
|
return TargetTriple.isWindowsMSVCEnvironment();
|
||||||
|
}
|
||||||
|
|
||||||
bool isTargetKnownWindowsMSVC() const {
|
bool isTargetKnownWindowsMSVC() const {
|
||||||
return TargetTriple.isKnownWindowsMSVCEnvironment();
|
return TargetTriple.isKnownWindowsMSVCEnvironment();
|
||||||
}
|
}
|
||||||
bool isTargetMingw() const { return TargetTriple.isWindowsGNUEnvironment(); }
|
|
||||||
bool isTargetCygwin() const {
|
bool isTargetWindowsCygwin() const {
|
||||||
return TargetTriple.isWindowsCygwinEnvironment();
|
return TargetTriple.isWindowsCygwinEnvironment();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isTargetWindowsGNU() const {
|
||||||
|
return TargetTriple.isWindowsGNUEnvironment();
|
||||||
|
}
|
||||||
|
|
||||||
bool isTargetCygMing() const { return TargetTriple.isOSCygMing(); }
|
bool isTargetCygMing() const { return TargetTriple.isOSCygMing(); }
|
||||||
|
|
||||||
bool isOSWindows() const { return TargetTriple.isOSWindows(); }
|
bool isOSWindows() const { return TargetTriple.isOSWindows(); }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user