summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Linker
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2018-10-09 01:17:27 +0000
committerDavid Blaikie <dblaikie@gmail.com>2018-10-09 01:17:27 +0000
commit40a64c4c08d3c1f4c2cdca657d691c97bf09e580 (patch)
treef27c9680b4123eb74e10ea803e085857d34c2ddf /llvm/lib/Linker
parent63a8b6c3046d2aaa83f1410c32771e7eb21e7a6c (diff)
downloadbcm5719-llvm-40a64c4c08d3c1f4c2cdca657d691c97bf09e580.tar.gz
bcm5719-llvm-40a64c4c08d3c1f4c2cdca657d691c97bf09e580.zip
llvm-link: Improve diagnostic for module-level metadata mismatch
This might produce hard to read/illegible diagnostics for especially weird/non-trivial module metadata but integers are about all we are using these days, so seems more useful than not. Patch based on work by Kristina Brooks - thanks! Differential Revision: https://reviews.llvm.org/D52952 llvm-svn: 344011
Diffstat (limited to 'llvm/lib/Linker')
-rw-r--r--llvm/lib/Linker/IRMover.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/lib/Linker/IRMover.cpp b/llvm/lib/Linker/IRMover.cpp
index 48b746a22fc..b304bfc401a 100644
--- a/llvm/lib/Linker/IRMover.cpp
+++ b/llvm/lib/Linker/IRMover.cpp
@@ -1230,8 +1230,14 @@ Error IRLinker::linkModuleFlagsMetadata() {
case Module::Warning: {
// Emit a warning if the values differ.
if (SrcOp->getOperand(2) != DstOp->getOperand(2)) {
- emitWarning("linking module flags '" + ID->getString() +
- "': IDs have conflicting values");
+ std::string str;
+ raw_string_ostream(str)
+ << "linking module flags '" << ID->getString()
+ << "': IDs have conflicting values ('" << *SrcOp->getOperand(2)
+ << "' from " << SrcM->getModuleIdentifier() << " with '"
+ << *DstOp->getOperand(2) << "' from " << DstM.getModuleIdentifier()
+ << ')';
+ emitWarning(str);
}
continue;
}
OpenPOWER on IntegriCloud