[clang] [clang][deps] Add dependency scanning support for #embed (PR #247823)

Oliver Hunt via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 2 02:09:41 PST 2026


================
@@ -591,6 +591,19 @@ class ModuleDepCollector::ModuleDepCollectorPP final : public PPCallbacks {
 
     MDC.handleImport(Imported);
   }
+
+  void EmbedDirective(SourceLocation HashLoc, StringRef FileName, bool IsAngled,
+                      OptionalFileEntryRef File,
+                      const LexEmbedParametersResult &Params) override {
+    assert(File);
+    MDC.addFileDep(File->getName());
+  }
+
+  void HasEmbed(SourceLocation Loc, StringRef FileName, bool IsAngled,
+                OptionalFileEntryRef File) override {
+    if (File)
----------------
ojhunt wrote:

I was so confused by this because I misread the if as `if (FileName)` :D

https://github.com/llvm/llvm-project/pull/247823


More information about the cfe-commits mailing list