diff options
author | Abid Qadeer <haqadeer@amd.com> | 2025-09-17 18:16:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-09-17 18:16:36 +0100 |
commit | 453e4102bd32b892e7fda2aea3f3ef9e9b038580 (patch) | |
tree | 80b22e5c632f146094704a67c6c11722c7cafbf3 /flang/lib/Frontend/CompilerInvocation.cpp | |
parent | 9e3ec0e371e08eaf3a876072ea8ea4187d86e2e0 (diff) | |
download | llvm-453e4102bd32b892e7fda2aea3f3ef9e9b038580.zip llvm-453e4102bd32b892e7fda2aea3f3ef9e9b038580.tar.gz llvm-453e4102bd32b892e7fda2aea3f3ef9e9b038580.tar.bz2 |
[flang] Lowering support for -gdwarf-N flag. (#159137)
This PR builds on the https://github.com/llvm/llvm-project/pull/158314
and adds the lowering support for `-gdwarf-N` flag. The changes to pass
the information to `AddDebugInfo` pass are mostly mechanical. The
`AddDebugInfo` pass adds `ModuleFlagsOp` in the module which gets
translated to correct llvm metadata during mlir->llvmir translation.
There is minor correction where the version is set to 0 in case no
-debug-version flag is provided. Previously it was set to 2 in this case
due to misreading of clang code.
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | flang/lib/Frontend/CompilerInvocation.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp index a00e568..4729f8a 100644 --- a/flang/lib/Frontend/CompilerInvocation.cpp +++ b/flang/lib/Frontend/CompilerInvocation.cpp @@ -157,10 +157,9 @@ static bool parseDebugArgs(Fortran::frontend::CodeGenOptions &opts, clang::DiagnosticsEngine::Warning, "Unsupported debug option: %0"); diags.Report(debugWarning) << arg->getValue(); } - // The default value of 2 here is to match clang. opts.DwarfVersion = getLastArgIntValue(args, clang::driver::options::OPT_dwarf_version_EQ, - /*Default=*/2, diags); + /*Default=*/0, diags); } return true; } |