<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/62745>62745</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Print gep & pointee type in BitcodeReader error message
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          Seelengrab
      </td>
    </tr>
</table>

<pre>
    This error message

https://github.com/llvm/llvm-project/blob/64d169c74d2cd3730893dffacd0061b937e55169/llvm/lib/Bitcode/Reader/BitcodeReader.cpp#L4964

has cost me about 3 months of debugging, before finally figuring out that it was thrown due to reading some serialized module from before opaque pointers were a thing in LLVM 14+ (at least that's when I noticed it/began getting the error). I should be able to reproduce this with some effort (though I admittedly haven't tried yet after deleting the offending cached code, which solved the issue).

I'd be happy to make a PR printing both pointer & pointee type here, with an optional warning if the failure could be due to the opaque pointers causing the failure (if that is appropriate - I have no idea how to reliably check that), if someone can give me some pointers on how this kind of thing is done in LLVM, as I'm not at all familiar with the codebase. 
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVM2O4zYTfBr60lhDon5sHXTY2YUBA_MBi_2C3FtkS2SGIhWyNYbz9AEle3cnOeWiP7C7qqtKjSnZyRP1onkRzdcDrmxC7P9P5MhPEYfDEPS9_83YBBRjiDBTSjiRKL6K4vN-NcxLEtVnIS9CXibLZh2OKsxCXpx7f94-LTH8QYqFvAwuDEJe2lqXbadOtZZKV6eqOHeVHkdUuijacuiqEzVN2Xa_9LG57sWyCpqEvHwn1BR_ftrfj2pZhKxe666tP_DEBCokhpkAh7AyVDAHzyZBGEHTsE6T9ZOQX2CgMUSC0Xp07g6jndZo_QS5iA0yWIYbJmATw82DXgk4QCTU-VQKM0GiaNHZv0jDHPTqCMYY5mfnsOCfK8ESrGeKCW4UCRDY5Hrr4fX19_9BWQv5AkKekcERph1byFOCmyEPV_CBrSINdpOVJvQwEXNuwoZ2y4TsjnCFZMLqNAx5dvegu8SgV0UZNsHNstmp0ziGyBmYTVgnA1dAPVtm0u4OBt_JC3li4GhJw50YcGSKoMnRD-wwjuQ3ORQqQxp2z77AzViVgdw76e2kTWmlzPJXs65Cnja2BpflnunO-JYl-vYdlmj9hjMENk8NQcj28UzA94XAUNwB82DoISxsg0cHN4x-03nc8Ee0bo0E6inQw85tin_4pHBNzwmfdUKet045FglwWWJYokUm-ATXTS7wAawmBBNuu_LO4uDuoAypt4erXeZqx82C4AlUNtO-U47rZssPEsHvjbJrb9brHN9HchLoXPtIUO6ICbKWc84KIAM6ByPO1lmMuzR5lmzOgImOcNB9pbuqwwP1ZXuuZSuLtj6YvqmaVjdF01ZVNbQdnsZSnlVbNqe2PNd4PtheFrIqmrItz1Ut6yMq3WnqsC6w7E6DEnVBM1p3zL_zMcTpsFnft_JUNweHA7m0bSIpPd2euZB5McV-2yHDOiVRF84mTj-7sGVH_becCpho-XcSrIcPG-LjLjus0fX_eYlt7FJeY5n93wEAAP__VpvHxw">