[PATCH] D53866: [Preamble] Stop circular inclusion of main file when building preamble

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 8 07:19:13 PDT 2019


ilya-biryukov added a comment.

Sorry for losing this.
Neat change, minimal and focused, thanks!

Just wanted to clarify why we need the change in `SourceManager.cpp`, will LGTM as soon as we resolve this



================
Comment at: lib/Basic/SourceManager.cpp:1594
         SourceFileName = llvm::sys::path::filename(SourceFile->getName());
-        if (*SourceFileName == llvm::sys::path::filename(MainFile->getName())) {
+        if (MainFile && *SourceFileName == llvm::sys::path::filename(MainFile->getName())) {
           SourceFileUID = getActualFileUID(SourceFile);
----------------
Can this actually be`null`? 


Repository:
  rC Clang

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

https://reviews.llvm.org/D53866





More information about the cfe-commits mailing list