[llvm] r203009 - Improve LinkModules warnings
JF Bastien
jfb at google.com
Wed Mar 5 13:26:42 PST 2014
Author: jfb
Date: Wed Mar 5 15:26:42 2014
New Revision: 203009
URL: http://llvm.org/viewvc/llvm-project?rev=203009&view=rev
Log:
Improve LinkModules warnings
Provide triple and data layout as well as module names (or empty string) when there's a mismatch.
Differential Revision: http://llvm-reviews.chandlerc.com/D2971
Modified:
llvm/trunk/lib/Linker/LinkModules.cpp
Modified: llvm/trunk/lib/Linker/LinkModules.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkModules.cpp?rev=203009&r1=203008&r2=203009&view=diff
==============================================================================
--- llvm/trunk/lib/Linker/LinkModules.cpp (original)
+++ llvm/trunk/lib/Linker/LinkModules.cpp Wed Mar 5 15:26:42 2014
@@ -1210,16 +1210,20 @@ bool ModuleLinker::run() {
if (SrcM->getDataLayout() && DstM->getDataLayout() &&
*SrcM->getDataLayout() != *DstM->getDataLayout()) {
if (!SuppressWarnings) {
- errs() << "WARNING: Linking two modules of different data layouts!\n";
+ errs() << "WARNING: Linking two modules of different data layouts: '"
+ << SrcM->getModuleIdentifier() << "' is '"
+ << SrcM->getDataLayoutStr() << "' whereas '"
+ << DstM->getModuleIdentifier() << "' is '"
+ << DstM->getDataLayoutStr() << "'\n";
}
}
if (!SrcM->getTargetTriple().empty() &&
DstM->getTargetTriple() != SrcM->getTargetTriple()) {
if (!SuppressWarnings) {
- errs() << "WARNING: Linking two modules of different target triples: ";
- if (!SrcM->getModuleIdentifier().empty())
- errs() << SrcM->getModuleIdentifier() << ": ";
- errs() << "'" << SrcM->getTargetTriple() << "' and '"
+ errs() << "WARNING: Linking two modules of different target triples: "
+ << SrcM->getModuleIdentifier() << "' is '"
+ << SrcM->getTargetTriple() << "' whereas '"
+ << DstM->getModuleIdentifier() << "' is '"
<< DstM->getTargetTriple() << "'\n";
}
}
More information about the llvm-commits
mailing list