This is an archive of the discontinued LLVM Phabricator instance.

[Clang][CodeGen] Fix linkage and visibility of template parameter objects
ClosedPublic

Authored by alexander-shaposhnikov on Mar 11 2023, 9:38 PM.

Details

Summary

This diff fixes linkage and visibility of template parameter objects.
The associated GitHub issue: https://github.com/llvm/llvm-project/issues/51571#

Test plan:
1/ ninja check-all
2/ bootstrapped Clang passes tests

Diff Detail

Event Timeline

alexander-shaposhnikov created this object with visibility "All Users".
Herald added a project: Restricted Project. · View Herald TranscriptMar 11 2023, 9:38 PM
alexander-shaposhnikov requested review of this revision.Mar 11 2023, 9:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 11 2023, 9:38 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Looks good. If you want to look at the visibility side of this separately I think that's fine (I only called it out here because we often consider them at the same time).

clang/lib/CodeGen/CodeGenModule.cpp
3241–3248

I think we should be taking the visibility into account in some way too. For example, if the type of the template parameter object involves a type with hidden visibility, then the template parameter object itself should have hidden visibility.

Can we call setGVProperties(GV, TPO); here? It looks like that would do the right thing for visibility.

rsmith accepted this revision.Mar 13 2023, 3:58 PM
This revision is now accepted and ready to land.Mar 13 2023, 3:58 PM
efriedma changed the visibility from "All Users" to "Public (No Login Required)".Mar 13 2023, 4:01 PM
alexander-shaposhnikov retitled this revision from [Clang][CodeGen] Fix linkage of template parameter objects to [Clang][CodeGen] Fix linkage and visibility of template parameter objects.
alexander-shaposhnikov edited the summary of this revision. (Show Details)
alexander-shaposhnikov marked an inline comment as done.
This revision was landed with ongoing or failed builds.Mar 14 2023, 11:23 AM
This revision was automatically updated to reflect the committed changes.