<div dir="ltr">Looking over the apple code path for Host::GetArchitecture, I'm a little confused about why all this custom logic is needed. What are the situations in which llvm::sys::getDefaultTargetTriple() will return something other than what we want? Specifically, a concrete example might help illustrate the problem.<div>
<br></div><div>I understand from the comment that it has something to do with being able to run 32 and 64-bit executables in the same operating system. Isn't this the case everywhere? I can run 32-bit executables on Windows x64 as well. llvm::Triple has a function called get32BitArchVariant() that I thought returns a 32-bit triple for this case. Does this not work for some Apple configuration?</div>
<div><br></div><div>It seems like this logic should be able to be sunk into llvm::Triple somehow. Conceptually speaking, it seems like there should be two cases:</div><div><br></div><div>64-bit:</div><div>host_arch_64 = llvm::Triple::getDefaultTargetTriple()</div>
<div>host_arch_32 = llvm::Triple::getDefaultTargetTriple().get32BitArchVariant()</div><div><br></div><div>32-bit</div><div>host_arch_64 = <empty></div><div>host_arch_32 = llvm::Triple::getDefaultTargetTriple()</div>
<div><br></div><div>Why doesn't this work?</div></div>