Fix for bug 39218
This patch seems to fix this issue. However, from a code standpoint, I'm not sure it is up to standards. I am submitting this to see if it is directionally correct, and seeking feedback for a better way to accomplish this.
Questions I have:
- Are the modifications to the test correct? The code seems to function (it passes check-llvm, check-clang, and manual testing of the example with GCC). I am not very familiar with comdats or COFF, and therefore I am not 100% confident in the test case.
- Is GO->getComdat()->getName() the correct place to get the name, or is it a coincidence that it contains the right data?
Any feedback is welcome, and I am happy to submit another patch incorporating any suggested changes.
I think this needs a bit of massaging. I don't think we want to check for isArch32Bit, we should just always use the name of the comdat if it's available. However, GO->getComdat() may return null, and this code should fall back to getting the IR name of the global in that case. I'll try to put something together for this later today.