ldc-developers/ldc — pull request #143 by redstar (2012-07-21 00:32:20+00:00)
Title: Simplify CMakeLists.txt by taking advantage of LLVM 3.1 features

Lot of code in CMakeLists.txt deals with configuration of LLVM.

This can really be simplified by initializing all targets and using LLVM 3.1 features:
* `llvm::sys::getDefaultTargetTriple()` returns the default target triple
* `llvm::Triple` provides parsing of triple strings
* methods `get64BitArchVariant()` and `get32BitArchVariant()` of `llvm::Triple` can be used to implement -m32 and -m64. This also works with other architectures, e.g. ppc/ppc64 and mips/mips64.

I think more simplifications are possible by using llvm::Triple as type for global.params.llvmArch and global.params.os (e.g. using Triple.isOSWindows())

IMHO this is an argument against merging the 3.0 and 3.1 branch (see #107). It looks really complicated to me to create conditional compiled code to achieve this result.