diff options
author | Dan Gohman <sunfish@mozilla.com> | 2014-03-06 09:37:51 -0800 |
---|---|---|
committer | Dan Gohman <sunfish@mozilla.com> | 2014-03-06 09:37:51 -0800 |
commit | 7b1e013089b699ee25191ff9017d3964686d3463 (patch) | |
tree | d093f80bb1f81df72f1498aa1ad48443a725b2c6 | |
parent | 805f34e607fadc603eefa3120ff514a2f3432392 (diff) |
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.
-rw-r--r-- | lib/Linker/LinkModules.cpp | 19 |
1 files 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"; } |