[clang] [WIP] Implement `print-deserialized-declarations` flag to dump source… (PR #133910)

Ilya Biryukov via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 2 04:54:25 PDT 2025


================
@@ -121,6 +252,19 @@ FrontendAction::CreateWrappedASTConsumer(CompilerInstance &CI,
   if (!Consumer)
     return nullptr;
 
+  std::vector<std::unique_ptr<ASTConsumer>> Consumers;
+  llvm::StringRef PrintDeserializedDeclarationsPath = CI.getFrontendOpts().PrintDeserializedDeclarationsPath;
+  if (!PrintDeserializedDeclarationsPath.empty()) {
+    std::error_code ErrorCode;
+    auto* FileStream = new llvm::raw_fd_ostream(PrintDeserializedDeclarationsPath, ErrorCode, llvm::sys::fs::OF_None);
----------------
ilya-biryukov wrote:

Use `make_unique<raw_fd_ostream>(...)` here to avoid plain new.

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


More information about the cfe-commits mailing list