aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Verifier.cpp
diff options
context:
space:
mode:
authorpeter mckinna <peter.mckinna@gmail.com>2025-08-29 16:56:37 +1000
committerGitHub <noreply@github.com>2025-08-29 07:56:37 +0100
commitcdf30f0bc2362f8ac0b0a946372d7114229c34fd (patch)
treebb5e0dbb46ecff8a5b718589c8a1fbd6b68f3664 /llvm/lib/IR/Verifier.cpp
parent9470113495a79ee4f857b566c60a0adcd48c9d2a (diff)
downloadllvm-cdf30f0bc2362f8ac0b0a946372d7114229c34fd.zip
llvm-cdf30f0bc2362f8ac0b0a946372d7114229c34fd.tar.gz
llvm-cdf30f0bc2362f8ac0b0a946372d7114229c34fd.tar.bz2
[llvm][DebugInfo] Fix set debug validation with the addition of the new subrange debug (#154665)
Set debug was failing validation where the base type was subrange. This has happened with the addition of the new functionality for proper subrange debugging. This fix just allows set types to be based on subranges.
Diffstat (limited to 'llvm/lib/IR/Verifier.cpp')
-rw-r--r--llvm/lib/IR/Verifier.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index 9fda086..6e11d6a 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -1298,9 +1298,11 @@ void Verifier::visitDIDerivedType(const DIDerivedType &N) {
if (N.getTag() == dwarf::DW_TAG_set_type) {
if (auto *T = N.getRawBaseType()) {
auto *Enum = dyn_cast_or_null<DICompositeType>(T);
+ auto *Subrange = dyn_cast_or_null<DISubrangeType>(T);
auto *Basic = dyn_cast_or_null<DIBasicType>(T);
CheckDI(
(Enum && Enum->getTag() == dwarf::DW_TAG_enumeration_type) ||
+ (Subrange && Subrange->getTag() == dwarf::DW_TAG_subrange_type) ||
(Basic && (Basic->getEncoding() == dwarf::DW_ATE_unsigned ||
Basic->getEncoding() == dwarf::DW_ATE_signed ||
Basic->getEncoding() == dwarf::DW_ATE_unsigned_char ||