This is reduced from: https://llvm.org/bugs/show_bug.cgi?id=30702
If -coverage is passed, but -g is not, clang populates the PassManager pipeline with StripSymbols(debugOnly = true).
The stripSymbol pass therefore scans the list of named metadata, drops !llvm.dbg.cu, but leaves !llvm.gcov and !0 (the compileUnit MD) around. The verifier runs, and finds out that there's a CU not listed in !llvm.dbg.cu (as it was previously dropped) -> assertion.
When we strip debug info, so, check if there's coverage data around, and strip it as well, in order to avoid pending metadata left around.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
Once this lands I'll submit a clang patch to warn if -coverage is passed but -g is not in the clang Driver (as discussed with Justin/Adrian)