Names of GlobalVariables may not be preserved depending on compilation options, so prefer a structural diff
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Which linkage types specifically? hasUniqueInitializer() checks !isExternallyInitialized() and isStrongDefinitionForLinker(), which expands to !isDeclarationForLinker() (!hasAvailableExternallyLinkage() && !isDeclaration()) and !isWeakForLinker()), which I believe limits the variable to private and internal linkages.
Comment Actions
No, that's not true; something with External linkage would not trip any of those conditions normally. ("Externally initialized" in particular is basically unrelated to linkage.) I think you want a condition something like L->getName() == R->getName() || (L->hasLocalLinkage() && R->hasLocalLinkage()).