[PATCH] D35181: Defer addition of keywords to identifier table when loading AST

Johann Klähn via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 10 10:02:02 PST 2017


jklaehn added a comment.

In https://reviews.llvm.org/D35181#948925, @rsmith wrote:

> LGTM, but I'd like the old `IdentifierTable` constructor to be removed if there are no callers left.


It's still being used in e.g. `FormatTokenLexer`, where the populated `IdentifierTable` is passed to the constructor of another member:

  FormatTokenLexer::FormatTokenLexer(const SourceManager &SourceMgr, FileID ID,
                                     unsigned Column, const FormatStyle &Style,
                                     encoding::Encoding Encoding)
      : ..., IdentTable(getFormattingLangOpts(Style)),
        Keywords(IdentTable), ... {

  struct AdditionalKeywords {
    AdditionalKeywords(IdentifierTable &IdentTable) {
      kw_final = &IdentTable.get("final");
      ...

Apart from this case (for which I would opt to keep the old constructor) there are three other uses which could easily be changed to the new signature.
Would you prefer to land this change with the old constructor in place or should I make the required changes to remove it?


https://reviews.llvm.org/D35181





More information about the cfe-commits mailing list