Page MenuHomePhabricator

[CodeGen][TLS] Set TLS Model for __tls_guard as well.

Authored by junparser on Jun 10 2020, 2:03 AM.



For now we do not set tls model for tls_guard with/without option -ftls-model which is suboptimal.
This patch set model from command line for tls_guard as well. This keeps same behavior with gcc.

TestPlan: check-clang

Diff Detail

Event Timeline

junparser created this revision.Jun 10 2020, 2:03 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 10 2020, 2:03 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
junparser edited the summary of this revision. (Show Details)Jun 10 2020, 2:04 AM

Changes generally LGTM, but this is not my area of expertise.


Do we need a similar change in MicrosoftCXXABI::EmitGuardedInit()? I notice it sets thread local to true but does not set the thread local mode.

junparser marked an inline comment as done.

address the comments.

junparser added a comment.EditedJun 15 2020, 11:33 PM

@aaron.ballman thanks for the review. I have updated the patch.


Yes, It should be changed as well.

aaron.ballman accepted this revision.Jun 16 2020, 5:18 AM

LGTM, thanks!

This revision is now accepted and ready to land.Jun 16 2020, 5:18 AM
This revision was automatically updated to reflect the committed changes.