[llvm] [llvm-readobj][COFF] Dump .modmeta section (PR #201695)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 9 01:00:43 PDT 2026


================
@@ -2558,3 +2561,74 @@ void COFFDumper::printCOFFTLSDirectory(
                ArrayRef(ImageSectionCharacteristics),
                COFF::SectionCharacteristics(COFF::IMAGE_SCN_ALIGN_MASK));
 }
+
+void COFFDumper::printCOFFCxxModuleMetadata() {
+  SectionRef Sect;
+  for (const SectionRef &S : Obj->sections()) {
+    StringRef SectionName = unwrapOrError(Obj->getFileName(), S.getName());
----------------
jh7370 wrote:

`unwrapOrError` is considered deprecated in llvm-readobj code, because it raises a hard error and prevents further dumping of other sections etc from continuing. Prefer instead to report as a warning and bail out of this function.

Same goes throughout.

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


More information about the llvm-commits mailing list