[clang] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

Maksim Ivanov via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 8 09:12:39 PDT 2025


================
@@ -121,6 +305,25 @@ FrontendAction::CreateWrappedASTConsumer(CompilerInstance &CI,
   if (!Consumer)
     return nullptr;
 
+  std::vector<std::unique_ptr<ASTConsumer>> Consumers;
+  llvm::StringRef DumpDeserializedDeclarationRangesPath =
+      CI.getFrontendOpts().DumpMinimizationHintsPath;
+  if (!DumpDeserializedDeclarationRangesPath.empty()) {
+    std::error_code ErrorCode;
+    auto FileStream = std::make_unique<llvm::raw_fd_ostream>(
+        DumpDeserializedDeclarationRangesPath, ErrorCode,
+        llvm::sys::fs::OF_None);
+    if (!ErrorCode) {
+      Consumers.push_back(std::make_unique<DeserializedDeclsLineRangePrinter>(
+          CI.getSourceManager(), std::move(FileStream)));
+    } else {
+      llvm::errs() << "Failed to create output file for "
+                      "-dump-deserialized-declaration-ranges flag, file path: "
----------------
emaxx-google wrote:

nit: Update to `-dump-minimization-hints` (and in the PR title as well).

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


More information about the cfe-commits mailing list