[PATCH] D61880: [IRMover] Improve diagnostic messages for conflicting metadata

Igor Kudrin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 15 22:22:01 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL360857: [IRMover] Improve diagnostic messages for conflicting metadata (authored by ikudrin, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D61880?vs=199363&id=199746#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61880/new/

https://reviews.llvm.org/D61880

Files:
  llvm/trunk/lib/Linker/IRMover.cpp
  llvm/trunk/test/Linker/module-flags-5-a.ll
  llvm/trunk/test/Linker/module-flags-6-a.ll
  llvm/trunk/test/Linker/module-flags-7-a.ll


Index: llvm/trunk/test/Linker/module-flags-7-a.ll
===================================================================
--- llvm/trunk/test/Linker/module-flags-7-a.ll
+++ llvm/trunk/test/Linker/module-flags-7-a.ll
@@ -2,7 +2,7 @@
 
 ; Test module flags error messages.
 
-; CHECK: linking module flags 'foo': IDs have conflicting behaviors
+; CHECK: linking module flags 'foo': IDs have conflicting behaviors in '{{.*}}module-flags-7-b.ll' and 'llvm-link'
 
 !0 = !{ i32 1, !"foo", i32 37 }
 
Index: llvm/trunk/test/Linker/module-flags-5-a.ll
===================================================================
--- llvm/trunk/test/Linker/module-flags-5-a.ll
+++ llvm/trunk/test/Linker/module-flags-5-a.ll
@@ -2,7 +2,7 @@
 
 ; Test the 'override' error.
 
-; CHECK: linking module flags 'foo': IDs have conflicting override values
+; CHECK: linking module flags 'foo': IDs have conflicting override values in '{{.*}}module-flags-5-b.ll' and 'llvm-link'
 
 !0 = !{ i32 4, !"foo", i32 927 }
 
Index: llvm/trunk/test/Linker/module-flags-6-a.ll
===================================================================
--- llvm/trunk/test/Linker/module-flags-6-a.ll
+++ llvm/trunk/test/Linker/module-flags-6-a.ll
@@ -2,7 +2,7 @@
 
 ; Test module flags error messages.
 
-; CHECK: linking module flags 'foo': IDs have conflicting values
+; CHECK: linking module flags 'foo': IDs have conflicting values in '{{.*}}module-flags-6-b.ll' and 'llvm-link'
 
 !0 = !{ i32 1, !"foo", i32 37 }
 
Index: llvm/trunk/lib/Linker/IRMover.cpp
===================================================================
--- llvm/trunk/lib/Linker/IRMover.cpp
+++ llvm/trunk/lib/Linker/IRMover.cpp
@@ -1223,7 +1223,9 @@
       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 @@
     // 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 @@
       // 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: {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61880.199746.patch
Type: text/x-patch
Size: 3327 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190516/3e191154/attachment.bin>


More information about the llvm-commits mailing list