mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-30 02:25:19 +00:00
Triple: Make setEnvironment not override the object format
Discovered by Halide users who had C++ code like this: Triple.setArch(Triple::x86); Triple.setOS(Triple::Windows); Triple.setObjectFormat(Triple::ELF); Triple.setEnvironment(Triple::MSVC); This would produce the stringified triple of x86-windows-msvc, instead of the x86-windows-msvc-elf string needed to run MCJIT. With this change, they retain the -elf suffix. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229160 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -816,7 +816,11 @@ void Triple::setOS(OSType Kind) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Triple::setEnvironment(EnvironmentType Kind) {
|
void Triple::setEnvironment(EnvironmentType Kind) {
|
||||||
setEnvironmentName(getEnvironmentTypeName(Kind));
|
if (ObjectFormat == getDefaultFormat(*this))
|
||||||
|
return setEnvironmentName(getEnvironmentTypeName(Kind));
|
||||||
|
|
||||||
|
setEnvironmentName((getEnvironmentTypeName(Kind) + Twine("-") +
|
||||||
|
getObjectFormatTypeName(ObjectFormat)).str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Triple::setObjectFormat(ObjectFormatType Kind) {
|
void Triple::setObjectFormat(ObjectFormatType Kind) {
|
||||||
|
Reference in New Issue
Block a user