Currently, an assertion fails in ThinLTOCodeGenerator::addModule when the target triple of the module being added doesn't match that of the one stored in TMBuilder. This patch relaxes the constraint and makes changes to allow target triples that only differ in their version numbers on Apple platforms, similarly to what r228999 did.
Note that this patch only checks whether the target triples of the modules are compatible, but doesn't do anything to change the target triple in the IR when different but compatible triples are seen. Should we overwrite the triples in the IR so that they are identical to the one in TargetMachine? If the answer is yes, where or when should that happen?
rdar://problem/30133904
match isn't very clear to me, I wouldn't know the difference between "match" and "equal", do you have a better name?
I'd suggest isCompatibleWith or something like this.