From 7b1e013089b699ee25191ff9017d3964686d3463 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 6 Mar 2014 09:37:51 -0800 Subject: Improve linker messages when modules differ in triple or data layout. This is a backport of r203009 from LLVM trunk. Since we recently changed triples and data layouts, this is particularly apropos. --- lib/Linker/LinkModules.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp index a7a1cc2b94..ab5eaf027c 100644 --- a/lib/Linker/LinkModules.cpp +++ b/lib/Linker/LinkModules.cpp @@ -1151,14 +1151,21 @@ bool ModuleLinker::run() { DstM->setTargetTriple(SrcM->getTargetTriple()); if (!SrcM->getDataLayout().empty() && !DstM->getDataLayout().empty() && - SrcM->getDataLayout() != DstM->getDataLayout()) - errs() << "WARNING: Linking two modules of different data layouts!\n"; + SrcM->getDataLayout() != DstM->getDataLayout()) { + // XXX EMSCRIPTEN: backport r203009 from LLVM trunk: + errs() << "WARNING: Linking two modules of different data layouts: '" + << SrcM->getModuleIdentifier() << "' is '" + << SrcM->getDataLayout() << "' whereas '" + << DstM->getModuleIdentifier() << "' is '" + << DstM->getDataLayout() << "'\n"; + } if (!SrcM->getTargetTriple().empty() && DstM->getTargetTriple() != SrcM->getTargetTriple()) { - errs() << "WARNING: Linking two modules of different target triples: "; - if (!SrcM->getModuleIdentifier().empty()) - errs() << SrcM->getModuleIdentifier() << ": "; - errs() << "'" << SrcM->getTargetTriple() << "' and '" + // XXX EMSCRIPTEN: backport r203009 from LLVM trunk: + errs() << "WARNING: Linking two modules of different target triples: " + << SrcM->getModuleIdentifier() << "' is '" + << SrcM->getTargetTriple() << "' whereas '" + << DstM->getModuleIdentifier() << "' is '" << DstM->getTargetTriple() << "'\n"; } -- cgit v1.2.3-18-g5258