diff options
| author | Igor Kudrin <ikudrin@accesssoftek.com> | 2019-05-16 05:23:13 +0000 | 
|---|---|---|
| committer | Igor Kudrin <ikudrin@accesssoftek.com> | 2019-05-16 05:23:13 +0000 | 
| commit | 1ff8b7bdf108c61bbcd1b3e0154ea4bab0b5cdaa (patch) | |
| tree | f9f9ebd0f5aade6e5eca16ee93b323caafc8c808 /llvm/lib/Linker | |
| parent | 11be78bc7abf469c2db2d631f11b02ec8cb9f3c5 (diff) | |
| download | bcm5719-llvm-1ff8b7bdf108c61bbcd1b3e0154ea4bab0b5cdaa.tar.gz bcm5719-llvm-1ff8b7bdf108c61bbcd1b3e0154ea4bab0b5cdaa.zip  | |
[IRMover] Improve diagnostic messages for conflicting metadata
This does the similar for error messages as rL344011 has done for warnings.
With llvm::lto::LTO, the error might appear when LTO::run() is executed.
In that case, the calling code cannot know which module causes the error
and, subsequently, cannot hint the user.
Differential Revision: https://reviews.llvm.org/D61880
llvm-svn: 360857
Diffstat (limited to 'llvm/lib/Linker')
| -rw-r--r-- | llvm/lib/Linker/IRMover.cpp | 12 | 
1 files changed, 9 insertions, 3 deletions
diff --git a/llvm/lib/Linker/IRMover.cpp b/llvm/lib/Linker/IRMover.cpp index b21b8f33ab4..7635092dd43 100644 --- a/llvm/lib/Linker/IRMover.cpp +++ b/llvm/lib/Linker/IRMover.cpp @@ -1223,7 +1223,9 @@ Error IRLinker::linkModuleFlagsMetadata() {        if (SrcBehaviorValue == Module::Override &&            SrcOp->getOperand(2) != DstOp->getOperand(2))          return stringErr("linking module flags '" + ID->getString() + -                         "': IDs have conflicting override values"); +                         "': IDs have conflicting override values in '" + +                         SrcM->getModuleIdentifier() + "' and '" + +                         DstM.getModuleIdentifier() + "'");        continue;      } else if (SrcBehaviorValue == Module::Override) {        // Update the destination flag to that of the source. @@ -1234,7 +1236,9 @@ Error IRLinker::linkModuleFlagsMetadata() {      // Diagnose inconsistent merge behavior types.      if (SrcBehaviorValue != DstBehaviorValue)        return stringErr("linking module flags '" + ID->getString() + -                       "': IDs have conflicting behaviors"); +                       "': IDs have conflicting behaviors in '" + +                       SrcM->getModuleIdentifier() + "' and '" + +                       DstM.getModuleIdentifier() + "'");      auto replaceDstValue = [&](MDNode *New) {        Metadata *FlagOps[] = {DstOp->getOperand(0), ID, New}; @@ -1252,7 +1256,9 @@ Error IRLinker::linkModuleFlagsMetadata() {        // Emit an error if the values differ.        if (SrcOp->getOperand(2) != DstOp->getOperand(2))          return stringErr("linking module flags '" + ID->getString() + -                         "': IDs have conflicting values"); +                         "': IDs have conflicting values in '" + +                         SrcM->getModuleIdentifier() + "' and '" + +                         DstM.getModuleIdentifier() + "'");        continue;      }      case Module::Warning: {  | 

