[all-commits] [llvm/llvm-project] debe7b: [memprof] Migrate away from PointerUnion::dyn_cast...

Kazu Hirata via All-commits all-commits at lists.llvm.org
Tue Jan 21 15:03:03 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: debe7bd9168b3e7c2fdcef4f66a0ce033b6b4b54
      https://github.com/llvm/llvm-project/commit/debe7bd9168b3e7c2fdcef4f66a0ce033b6b4b54
  Author: Kazu Hirata <kazu at google.com>
  Date:   2025-01-21 (Tue, 21 Jan 2025)

  Changed paths:
    M llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp

  Log Message:
  -----------
  [memprof] Migrate away from PointerUnion::dyn_cast (NFC) (#123716)

Note that PointerUnion::dyn_cast has been soft deprecated in
PointerUnion.h:

  // FIXME: Replace the uses of is(), get() and dyn_cast() with
  //        isa<T>, cast<T> and the llvm::dyn_cast<T>

Literal migration would result in dyn_cast_if_present (see the
definition of PointerUnion::dyn_cast), but this patch uses cast
because we expect the arguments to be of the requested types.  Note
that all these cases have assert and/or dereferences just after cast,
implying that the return value from cast must be nonnull.

---------

Co-authored-by: Nikita Popov <github at npopov.com>



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