[all-commits] [llvm/llvm-project] 8a06b2: [NFC] let FunctionDecl::isReservedGlobalPlacementO...

Chuanqi Xu via All-commits all-commits at lists.llvm.org
Wed Jan 4 03:00:42 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8a06b2362a4b4da835d7d6041d1c0d706b5281b7
      https://github.com/llvm/llvm-project/commit/8a06b2362a4b4da835d7d6041d1c0d706b5281b7
  Author: Chuanqi Xu <yedeng.yd at linux.alibaba.com>
  Date:   2023-01-04 (Wed, 04 Jan 2023)

  Changed paths:
    M clang/lib/AST/Decl.cpp

  Log Message:
  -----------
  [NFC] let FunctionDecl::isReservedGlobalPlacementOperator return false when the function decl is not allocation functions

Currently `FunctionDecl::isReservedGlobalPlacementOperator` will crash
if the function is not an allocation/deallocation function, which is
surprising. Also, its semantics is not consistent with
isReplaceableGlobalAllocationFunction, which will return false if the
function is not an allocation/deallocation function.

This patch make FunctionDecl::isReservedGlobalPlacementOperator not
crash if the function is not an allocation/deallocation function, which
is consistent with isReplaceableGlobalAllocationFunction too.




More information about the All-commits mailing list