Page MenuHomePhabricator

[clangd] Change PreambleOnlyAction with content truncation

Authored by kadircet on May 5 2020, 8:59 AM.



Lexing until the token location is past preamble bound could be wrong
in some cases as preprocessor lexer can lex multiple tokens in a single call.

Diff Detail

Event Timeline

kadircet created this revision.May 5 2020, 8:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 5 2020, 8:59 AM
kadircet updated this revision to Diff 262132.May 5 2020, 9:06 AM
  • Add test
sammccall accepted this revision.May 25 2020, 4:55 AM
sammccall added inline comments.

Maybe add a comment here:

// This means we're scanning (though not preprocessing) the preamble section twice.
// However, it's important to precisely follow the preamble bounds used elsewhere.

This guards somewhat against someone sending the reverse patch. Chesterton's fence etc.

This revision is now accepted and ready to land.May 25 2020, 4:55 AM
kadircet marked an inline comment as done.May 25 2020, 10:38 PM
This revision was automatically updated to reflect the committed changes.