jansvoboda11 added inline comments.

================
Comment at: clang/lib/Frontend/FrontendAction.cpp:424
       // Include this header as part of the umbrella directory.
       Module->addTopHeader(H.second);
       addHeaderInclude(H.first, Includes, LangOpts, Module->IsExternC);
----------------
Debian CI is complaining about this:

```
error: no viable conversion from 
'clang::CustomizableOptional<clang::FileEntryRef>' to 'const clang::FileEntry *'
```

You might need to refactor `Module::addTopHeader()` too, or use 
`OptionalFileEntryRefDegradesToFileEntryPtr` in the local `Headers` variable.


================
Comment at: clang/lib/Lex/ModuleMap.cpp:2514
+      if (auto FE = SourceMgr.getFileManager().getOptionalFileRef(I->path())) {
         Module::Header Header = {"", std::string(I->path()), *FE};
         Headers.push_back(std::move(Header));
----------------
Does it make sense to unwrap the optional here? It'll be instantly wrapped in 
`OptionalFileEntryRefDegradesToFileEntryPtr` anyways.


================
Comment at: clang/lib/Serialization/ASTReader.cpp:1950
     Module::Header H = {std::string(key.Filename), "",
-                        *FileMgr.getFile(Filename)};
+                        *FileMgr.getOptionalFileRef(Filename)};
     ModMap.addHeader(Mod, H, HeaderRole, /*Imported*/true);
----------------
Does it make sense to unwrap the optional here? It'll be instantly wrapped in 
`OptionalFileEntryRefDegradesToFileEntryPtr` anyways.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142113

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

Reply via email to