[llvm] Handle typeidCompatibleVTable in skipModuleSummaryEntry (PR #196849)
Owen Rodley via llvm-commits
llvm-commits at lists.llvm.org
Mon May 11 17:14:03 PDT 2026
https://github.com/orodley updated https://github.com/llvm/llvm-project/pull/196849
>From 976211fff274ea07b5ef91cce23962e3297cc4bd Mon Sep 17 00:00:00 2001
From: orodley <orodley at google.com>
Date: Mon, 11 May 2026 00:24:17 +0000
Subject: [PATCH 1/4] Handle typeidCompatibleVTable in skipModuleSummaryEntry
This method needs to match the set of cases handled in parseSummaryEntry.
---
llvm/lib/AsmParser/LLParser.cpp | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp
index 820f64bf30ba7..502f1a5767131 100644
--- a/llvm/lib/AsmParser/LLParser.cpp
+++ b/llvm/lib/AsmParser/LLParser.cpp
@@ -1067,11 +1067,12 @@ bool LLParser::skipModuleSummaryEntry() {
// support is in place we will look for the tokens corresponding to the
// expected tags.
if (Lex.getKind() != lltok::kw_gv && Lex.getKind() != lltok::kw_module &&
- Lex.getKind() != lltok::kw_typeid && Lex.getKind() != lltok::kw_flags &&
- Lex.getKind() != lltok::kw_blockcount)
- return tokError(
- "Expected 'gv', 'module', 'typeid', 'flags' or 'blockcount' at the "
- "start of summary entry");
+ Lex.getKind() != lltok::kw_typeid &&
+ Lex.getKind() != lltok::kw_typeidCompatibleVTable &&
+ Lex.getKind() != lltok::kw_flags && Lex.getKind() != lltok::kw_blockcount)
+ return tokError("Expected 'gv', 'module', 'typeid', "
+ "'typeidCompatibleVTable', 'flags' or 'blockcount' at the "
+ "start of summary entry");
if (Lex.getKind() == lltok::kw_flags)
return parseSummaryIndexFlags();
if (Lex.getKind() == lltok::kw_blockcount)
>From cc63ae81205e062235578e3c8f11b9503b57f5fb Mon Sep 17 00:00:00 2001
From: orodley <orodley at google.com>
Date: Mon, 11 May 2026 23:59:53 +0000
Subject: [PATCH 2/4] Add a regression test
---
llvm/test/Assembler/thinlto-vtable-skip.ll | 7 +++++++
1 file changed, 7 insertions(+)
create mode 100644 llvm/test/Assembler/thinlto-vtable-skip.ll
diff --git a/llvm/test/Assembler/thinlto-vtable-skip.ll b/llvm/test/Assembler/thinlto-vtable-skip.ll
new file mode 100644
index 0000000000000..70143f0e07d27
--- /dev/null
+++ b/llvm/test/Assembler/thinlto-vtable-skip.ll
@@ -0,0 +1,7 @@
+; RUN: opt %s -disable-output
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+^0 = module: (path: "test.ll", hash: (0, 0, 0, 0, 0))
+^1 = typeidCompatibleVTable: (name: "_ZTS1A", summary: ((offset: 16, ^0)))
>From 2830fabf59a1d166b9dcfd019549fc68731cf9e9 Mon Sep 17 00:00:00 2001
From: orodley <orodley at google.com>
Date: Tue, 12 May 2026 00:10:01 +0000
Subject: [PATCH 3/4] Fix test broken by the change to the error message
---
llvm/test/Assembler/thinlto-bad-summary1.ll | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/test/Assembler/thinlto-bad-summary1.ll b/llvm/test/Assembler/thinlto-bad-summary1.ll
index 8ff5e06b189a6..900ad73cc8435 100644
--- a/llvm/test/Assembler/thinlto-bad-summary1.ll
+++ b/llvm/test/Assembler/thinlto-bad-summary1.ll
@@ -2,7 +2,7 @@
; summary type label.
; RUN: not opt %s 2>&1 | FileCheck %s
-; CHECK: error: Expected 'gv', 'module', 'typeid', 'flags' or 'blockcount' at the start of summary entry
+; CHECK: error: Expected 'gv', 'module', 'typeid', 'typeidCompatibleVTable', 'flags' or 'blockcount' at the start of summary entry
; ModuleID = 'thinlto-function-summary-callgraph.ll'
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
>From cab00af92d3761b78b93e3da5d7eca84c313ea11 Mon Sep 17 00:00:00 2001
From: orodley <orodley at google.com>
Date: Tue, 12 May 2026 00:13:45 +0000
Subject: [PATCH 4/4] Fix filename
---
llvm/test/Assembler/thinlto-vtable-skip.ll | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/test/Assembler/thinlto-vtable-skip.ll b/llvm/test/Assembler/thinlto-vtable-skip.ll
index 70143f0e07d27..ce528e8d48b46 100644
--- a/llvm/test/Assembler/thinlto-vtable-skip.ll
+++ b/llvm/test/Assembler/thinlto-vtable-skip.ll
@@ -3,5 +3,5 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
-^0 = module: (path: "test.ll", hash: (0, 0, 0, 0, 0))
+^0 = module: (path: "thinlto-vtable-skip.ll", hash: (0, 0, 0, 0, 0))
^1 = typeidCompatibleVTable: (name: "_ZTS1A", summary: ((offset: 16, ^0)))
More information about the llvm-commits
mailing list