[clang] [flang] [flang][debug] Add compressed DWARF support in Flang (PR #212584)
Tarun Prabhu via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 30 08:12:19 PDT 2026
================
@@ -174,6 +174,23 @@ static bool parseDebugArgs(Fortran::frontend::CodeGenOptions &opts,
opts.DebugInfoForProfiling =
args.hasArg(clang::options::OPT_fdebug_info_for_profiling);
+ if (const llvm::opt::Arg *a =
+ args.getLastArg(clang::options::OPT_compress_debug_sections_EQ)) {
+ auto type = llvm::StringSwitch<std::optional<llvm::DebugCompressionType>>(
+ a->getValue())
+ .Case("none", llvm::DebugCompressionType::None)
+ .Case("zlib", llvm::DebugCompressionType::Zlib)
+ .Case("zstd", llvm::DebugCompressionType::Zstd)
+ .Default(std::nullopt);
+ if (type) {
+ opts.setCompressDebugSections(*type);
+ } else {
+ diags.Report(clang::diag::err_drv_invalid_value)
----------------
tarunprabhu wrote:
We probably don't need to diagnose this here. The driver will have diagnosed this already and ensure that only valid values get passed here. `-fc1` is not intended for end-users, so it is ok to assume that the options passed to it are valid.
https://github.com/llvm/llvm-project/pull/212584
More information about the cfe-commits
mailing list