riccibruno added a comment.

I looked at how `ASTReader` create the `IdentifierInfo`s returned by 
`IdentifierInfo *ASTReader::get(StringRef Name)`,
and I ended up in `ASTIdentifierLookupTrait::ReadData`, which calls among other 
things `IdentifierTable::getOwn`.
The `IdentifierInfo` created by `getOwn` will always have the `Entry` pointer 
set and therefore I think it is
possible to remove the `if (Entry)` in `IdentifierInfo::getLength` and 
`IdentifierInfo::getNameStart`.

I made a patch implementing this change here D54866 
<https://reviews.llvm.org/D54866>.



================
Comment at: include/clang/Lex/Preprocessor.h:396
+  /// This is an alias for CurLexer.
   PreprocessorLexer *CurPPLexer = nullptr;
 
----------------
Would it make sense to remove this alias now that it
will always refer to `CurLexer` ?


================
Comment at: unittests/Tooling/DiagnosticsYamlTest.cpp:85
             "    FilePath:        'path/to/source2.cpp'\n"
-            "    Replacements:    \n"
+            "    Replacements:    []\n"
             "...\n",
----------------
It was fixed in `r346884 : [Support] Teach YAMLIO about polymorphic types`
so you can remove this from your patch.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D54547/new/

https://reviews.llvm.org/D54547



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to