[cfe-commits] r69025 - /cfe/trunk/lib/CodeGen/CodeGenModule.cpp
Chris Lattner
clattner at apple.com
Tue Apr 14 11:06:49 PDT 2009
On Apr 14, 2009, at 8:22 AM, Fariborz Jahanian wrote:
> I always wondered what is LLVM's assumption about default visibility
> setting and no setting of
> visibility. Can you provide and add a test case which highlights these
> changes. My concern is
> that in the next routine of building projects we start running into
> mysterious linkage problems.
> Also, on a related note, how do we turn-off 'no dead code stripping'
> attribute on globals. It seems
> to be set by default.
This change should not have had a semantic effect. If something has
internal linkage in LLVM IR, the visibility is ignored.
-Chris
>
>
> - Fariborz
>
> On Apr 13, 2009, at 10:27 PM, Chris Lattner wrote:
>
>> Author: lattner
>> Date: Tue Apr 14 00:27:13 2009
>> New Revision: 69025
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=69025&view=rev
>> Log:
>> do not set visibility on "private" or "available externally" linkage
>> objects.
>>
>> Modified:
>> cfe/trunk/lib/CodeGen/CodeGenModule.cpp
>>
>> Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=69025&r1=69024&r2=69025&view=diff
>>
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =====================================================================
>> --- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
>> +++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Tue Apr 14 00:27:13 2009
>> @@ -100,7 +100,7 @@
>> static void setGlobalVisibility(llvm::GlobalValue *GV,
>> VisibilityAttr::VisibilityTypes Vis) {
>> // Internal definitions should always have default visibility.
>> - if (GV->hasInternalLinkage()) {
>> + if (GV->hasLocalLinkage()) {
>> GV->setVisibility(llvm::GlobalValue::DefaultVisibility);
>> return;
>> }
>> @@ -122,7 +122,7 @@
>> static void setGlobalOptionVisibility(llvm::GlobalValue *GV,
>> LangOptions::VisibilityMode
>> Vis) {
>> // Internal definitions should always have default visibility.
>> - if (GV->hasInternalLinkage()) {
>> + if (GV->hasLocalLinkage()) {
>> GV->setVisibility(llvm::GlobalValue::DefaultVisibility);
>> return;
>> }
>>
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
More information about the cfe-commits
mailing list