[all-commits] [llvm/llvm-project] 563c7c: [clang] Migrate away from PointerUnion::dyn_cast (...

Kazu Hirata via All-commits all-commits at lists.llvm.org
Sat Jan 25 14:05:22 PST 2025


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

  Changed paths:
    M clang/include/clang/AST/APValue.h
    M clang/include/clang/AST/ASTContext.h
    M clang/include/clang/AST/Decl.h
    M clang/include/clang/AST/DeclBase.h
    M clang/include/clang/AST/DeclTemplate.h
    M clang/include/clang/AST/Expr.h
    M clang/include/clang/AST/ExprCXX.h
    M clang/include/clang/Basic/IdentifierTable.h
    M clang/include/clang/Lex/Preprocessor.h
    M clang/lib/APINotes/APINotesManager.cpp
    M clang/lib/AST/Decl.cpp
    M clang/lib/AST/DeclCXX.cpp
    M clang/lib/AST/DeclTemplate.cpp
    M clang/lib/AST/TemplateName.cpp
    M clang/lib/Frontend/SerializedDiagnosticPrinter.cpp
    M clang/lib/Sema/SemaDecl.cpp
    M clang/tools/libclang/CIndexDiagnostic.cpp

  Log Message:
  -----------
  [clang] Migrate away from PointerUnion::dyn_cast (NFC) (#124425)

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>

This patch migrates uses of PointerUnion::dyn_cast to
dyn_cast_if_present (see the definition of PointerUnion::dyn_cast).
Note that we cannot use dyn_cast in any of the migrations in this
patch; placing

  assert(!X.isNull());

just before any of dyn_cast_if_present in this patch triggers some
failure in check-clang.



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