[llvm-branch-commits] [Remarks] BitstreamRemarkParser: Refactor error handling (PR #156511)

Florian Hahn via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Sep 3 10:48:46 PDT 2025


================
@@ -52,171 +92,144 @@ static Error parseRecord(BitstreamMetaParserHelper &Parser, unsigned Code) {
   switch (*RecordID) {
   case RECORD_META_CONTAINER_INFO: {
     if (Record.size() != 2)
-      return malformedRecord("BLOCK_META", "RECORD_META_CONTAINER_INFO");
-    Parser.ContainerVersion = Record[0];
-    Parser.ContainerType = Record[1];
+      return malformedRecord(MetaContainerInfoName);
+    Container.emplace();
+    Container->Version = Record[0];
+    Container->Type = Record[1];
----------------
fhahn wrote:

can we construct directly in `emplace`?

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


More information about the llvm-branch-commits mailing list