This is an archive of the discontinued LLVM Phabricator instance.

MS ABI: Always emit dllexported in-class initialized static data members (PR20140)
ClosedPublic

Authored by hans on Jul 17 2014, 9:47 AM.

Details

Summary

This patch makes us emit dllexported in-class initialized static data members (which are treated as definitions in MSVC), even when they're not referenced.

It also makes their special linkage reflected in the GVA linkage instead of getting massaged in CodeGen.

Please take a look!

Diff Detail

Repository
rL LLVM

Event Timeline

hans updated this revision to Diff 11582.Jul 17 2014, 9:47 AM
hans retitled this revision from to MS ABI: Always emit dllexported in-class initialized static data members (PR20140).
hans updated this object.
hans edited the test plan for this revision. (Show Details)
hans added reviewers: rnk, majnemer.
hans added subscribers: Unknown Object (MLST), hansw.
majnemer added inline comments.Jul 17 2014, 10:08 AM
lib/AST/ASTContext.cpp
4787 ↗(On Diff #11582)

I believe this should be controlled by -fms-compatibility not that ABI. MSDN says that compiling with /Za would disable this behavior: http://msdn.microsoft.com/en-us/library/34h23df8.aspx

hans updated this revision to Diff 11601.Jul 17 2014, 11:17 AM
hans updated this object.

I believe this should be controlled by -fms-compatibility not that ABI. MSDN says that compiling with /Za would disable this behavior: http://msdn.microsoft.com/en-us/library/34h23df8.aspx

Sounds reasonable. I've updated the patch.

rnk accepted this revision.Jul 17 2014, 1:15 PM
rnk edited edge metadata.

lgtm

I guess I agree with David w.r.t. -fms-compatibility vs ABI.

This revision is now accepted and ready to land.Jul 17 2014, 1:15 PM
hans closed this revision.Jul 17 2014, 1:34 PM
hans updated this revision to Diff 11611.

Closed by commit rL213304 (authored by @hans).