Triple: Make setEnvironment not override the object format
authorReid Kleckner <reid@kleckner.net>
Fri, 13 Feb 2015 22:05:50 +0000 (22:05 +0000)
committerReid Kleckner <reid@kleckner.net>
Fri, 13 Feb 2015 22:05:50 +0000 (22:05 +0000)
commit86b5c3a8449be277675109e5db953a7ef64bc800
tree69e2aa18c5651c959c08334eb4ff2df8b233eb8a
parentfa1b3ba1f0c3cf74394b6bf24a801a33d3e477b8
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
lib/Support/Triple.cpp