[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:41 PDT 2026
================
@@ -0,0 +1,131 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/Object/COFFCxxModuleMetadata.h"
+#include "llvm/Support/ErrorExtras.h"
+
+namespace llvm::object {
+
+COFFCxxModuleMetadataReader::COFFCxxModuleMetadataReader(
+ const COFFCxxModuleMetadata &Map)
+ : ModuleData(Map.ModuleData), NamesData(Map.NamesData),
+ ModuleIndexWidth(Map.ModuleIndexWidth),
+ SymbolIndexWidth(Map.SymbolIndexWidth) {}
+
+bool COFFCxxModuleMetadataReader::hasModuleData() const {
+ return !ModuleData.empty();
+}
+
+Expected<uint32_t> COFFCxxModuleMetadataReader::readModuleID() {
+ switch (ModuleIndexWidth) {
+ case 1: {
+ if (ModuleData.size() < 1)
+ return createStringError("Not enough data");
----------------
jh7370 wrote:
The [LLVM style guide](https://llvm.org/docs/CodingStandards.html#error-and-warning-messages) says to use lower-case letters for the start of error messages. Same applies throughout.
https://github.com/llvm/llvm-project/pull/201695
More information about the llvm-commits
mailing list