This is an archive of the discontinued LLVM Phabricator instance.

Don't build switch lookup tables for dllimport or TLS variables
ClosedPublic

Authored by hans on Jun 19 2014, 1:19 PM.

Details

Summary

We would previously put dllimport variables in switch lookup tables, which doesn't work because the address cannot be used in a constant initializer. This is basically the same problem that we have in PR19955.

Putting TLS variables in switch tables also desn't work, because the address of such a variable is not constant.

Diff Detail

Event Timeline

hans updated this revision to Diff 10655.Jun 19 2014, 1:19 PM
hans retitled this revision from to Don't build switch lookup tables for dllimport or TLS variables.
hans updated this object.
hans edited the test plan for this revision. (Show Details)
hans added reviewers: rnk, majnemer.
hans added a subscriber: Unknown Object (MLST).
majnemer edited edge metadata.Jun 19 2014, 3:06 PM

We can just make the predicate be a normal function pointer instead of taking a template argument. This may reduce the amount of code generated without inhibiting the compiler from inlining the lambdas if it thought it were profitable.

hans updated this revision to Diff 10662.Jun 19 2014, 3:25 PM
hans edited edge metadata.

We can just make the predicate be a normal function pointer instead of taking a template argument. This may reduce the amount of code generated without inhibiting the compiler from inlining the lambdas if it thought it were profitable.

Done.

majnemer accepted this revision.Jun 19 2014, 4:07 PM
majnemer edited edge metadata.

LGTM

This revision is now accepted and ready to land.Jun 19 2014, 4:07 PM
hans closed this revision.Jun 19 2014, 5:46 PM
hans updated this revision to Diff 10667.

Closed by commit rL211331 (authored by @hans).