[all-commits] [llvm/llvm-project] 7bf188: [NFC] Minor fix to tryEmitAbstract type in EmitCXX...

Andy Kaylor via All-commits all-commits at lists.llvm.org
Wed Jan 22 10:12:15 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7bf188fa991338e981e8dff120a4ed341ad7f4bd
      https://github.com/llvm/llvm-project/commit/7bf188fa991338e981e8dff120a4ed341ad7f4bd
  Author: Andy Kaylor <akaylor at nvidia.com>
  Date:   2025-01-22 (Wed, 22 Jan 2025)

  Changed paths:
    M clang/lib/CodeGen/CGExprCXX.cpp

  Log Message:
  -----------
  [NFC] Minor fix to tryEmitAbstract type in EmitCXXNewAllocSize (#123433)

In EmitCXXNewAllocSize, when handling a constant array size, we were
calling tryEmitAbstract with the type of the object being allocated rather
than the expected type of the array size. This worked out because the
allocated type was always a pointer and tryEmitAbstract only ends up
using the size of the type to extend or truncate the constant, and in this
case the destination type should be size_t, which is usually the same
width as the pointer. This change fixes the type, but it makes no
functional difference with the current constant emitter implementation.



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