This is an archive of the discontinued LLVM Phabricator instance.

[NFC][Lexer] Make access to LangOpts more consistent
ClosedPublic

Authored by yurai007 on Feb 22 2022, 8:34 AM.

Details

Summary

Before this change without any good reason Lexer::LangOpts is sometimes accessed by getter and another time read directly in Lexer functions.
Since getLangOpts is a bit more verbose prefer direct access to LangOpts member when possible.

Diff Detail

Event Timeline

yurai007 requested review of this revision.Feb 22 2022, 8:34 AM
yurai007 created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 22 2022, 8:34 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
cor3ntin accepted this revision.Feb 22 2022, 10:15 AM

This looks good to me, thanks!

This revision is now accepted and ready to land.Feb 22 2022, 10:15 AM

I don't object to the change but it may me wonder if there would be a way to remove the apparent redundancy in the API here?

Thank you all for review!

I don't object to the change but it may me wonder if there would be a way to remove the apparent redundancy in the API here?

If you don't mind let me address getLangOpts() removal in follow-up change since this one as it is already got LG.

This revision was landed with ongoing or failed builds.Feb 23 2022, 3:46 AM
This revision was automatically updated to reflect the committed changes.