[all-commits] [llvm/llvm-project] 040f5e: Add flags check to createVariantMemberType (#139261)

Tom Tromey via All-commits all-commits at lists.llvm.org
Thu May 29 10:26:28 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 040f5ee41014724af7dc4941ff9f4223b4db67d4
      https://github.com/llvm/llvm-project/commit/040f5ee41014724af7dc4941ff9f4223b4db67d4
  Author: Tom Tromey <tromey at adacore.com>
  Date:   2025-05-29 (Thu, 29 May 2025)

  Changed paths:
    M llvm/include/llvm/IR/DebugInfoMetadata.h
    M llvm/lib/IR/DIBuilder.cpp

  Log Message:
  -----------
  Add flags check to createVariantMemberType (#139261)

I noticed that DIDerivedType overloads the "ExtraData" member depending
on the precise type being implemented. A variant part uses this to store
the discriminant (a reference to another member), but a bit field uses
it to store the storage offset.

This patch changes createVariantMemberType to ensure that the
FlagBitField is not used when creating a variant part. If this flag is
used, the ExtraData field would be erroneously used in two different
ways.

The patch also updates a comment in DIDerivedType to list a couple more
cases.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list