This is an archive of the discontinued LLVM Phabricator instance.

Eliminating static destructor for the BitCodeErrorCategory by converting to a ManagedStatic.
ClosedPublic

Authored by beanz on Sep 19 2014, 1:16 PM.

Diff Detail

Event Timeline

beanz updated this revision to Diff 13884.Sep 19 2014, 1:16 PM
beanz retitled this revision from to Eliminating static destructor for the BitCodeErrorCategory by converting to a ManagedStatic..
beanz updated this object.
beanz edited the test plan for this revision. (Show Details)
beanz added a subscriber: Unknown Object (MLST).
chandlerc accepted this revision.Sep 19 2014, 1:23 PM
chandlerc added a reviewer: chandlerc.
chandlerc added a subscriber: chandlerc.

Looks good with a small tweak below...

lib/Bitcode/Reader/BitcodeReader.cpp
3510

Since we can't rely on MSVC's thread safe function local statics we have to use a ManagedStatic here... but once we do, on non MSVC we pay the once-init cost twice.

I would just make these globals (sadly) until we only rely on MSVC versions with support for killing managed static entirely.

This revision is now accepted and ready to land.Sep 19 2014, 1:23 PM
beanz updated this revision to Diff 13885.Sep 19 2014, 1:28 PM
beanz edited edge metadata.

Something more like this?

Diffusion closed this revision.Sep 19 2014, 1:38 PM
Diffusion updated this revision to Diff 13887.

Closed by commit rL218149 (authored by cbieneman).