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)
commit5fe405df36c30aedf2acd0a713bc851c0189d97a
tree8bebadef5893e7029f9e9070980bf18095e3cfc5
parent98c22539f2f4b96857be65a5a2797e4707451f2e
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.

llvm-svn: 229160
llvm/lib/Support/Triple.cpp