[PATCH] D128319: Survive #pragma once from virtual file.

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 27 07:00:18 PDT 2022


aaron.ballman added a reviewer: aaron.ballman.
aaron.ballman added a comment.

+1, this needs some test coverage for the changes. It should also have a release note to notify users of the fix.



================
Comment at: clang/lib/Lex/Pragma.cpp:415-419
+  if (getCurrentFileLexer()->getFileEntry()) {
+    // Get the current file lexer we're looking at.  Ignore _Pragma 'files' etc.
+    // Mark the file as a once-only file now.
+    HeaderInfo.MarkFileIncludeOnce(getCurrentFileLexer()->getFileEntry());
+  }
----------------
```
if (const auto *FE = getCurrentFileLexer()->getFileEntry())
  HeaderInfo.MarkFileIncludedOnce(FE);
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128319



More information about the cfe-commits mailing list