Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[compilationContext]:Drop the const modifier for CompilationContext #3032

Closed

Conversation

Projects
None yet
5 participants
@ZchiPitt
Copy link
Contributor

commented May 31, 2019

Summary:

Drop the const modifier for CompilationContext. Because I need to add a member variable that can be modified later.

I propose to add a member variable (LogContext) into CompilationContext class in next PR.
The LogContext will be able to:

  • Keep track the log scope (Together with another to-be-implemented class ScopedLogBlock)
  • Store all the log strings
  • Provide method to dump all the log strings

The coupling between LogContext and CompilationContext will make sure that:

  • Logging will not be affected by multiple compilations that happen alternatively.
  • Have a private stack for each LogContext instead of one static stack for the entire run of Glow, such that it's thread safe.

@ZchiPitt ZchiPitt requested a review from nickgg May 31, 2019

@ZchiPitt ZchiPitt requested review from opti-mix, SplitInfinity and jfix71 May 31, 2019

@nickgg

This comment has been minimized.

Copy link
Contributor

commented May 31, 2019

Having discussed with @ZchiPitt I think it makes sense to store the log in the CompilationContext, similar to how we store trace events in the ExecutionContext.

@opti-mix
Copy link
Contributor

left a comment

LGTM

@jfix71

jfix71 approved these changes Jun 3, 2019

Copy link
Contributor

left a comment

🚢

@facebook-github-bot
Copy link

left a comment

@ZchiPitt has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot

This comment has been minimized.

Copy link

commented Jun 3, 2019

@ZchiPitt merged this pull request in 2f773c9.

@ZchiPitt ZchiPitt deleted the ZchiPitt:dropConstOfCompilationContext branch Jun 4, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.