[all-commits] [llvm/llvm-project] ce7d3e: Reland (again) D80966 [codeview] Put !heapallocsit...

aeubanks via All-commits all-commits at lists.llvm.org
Tue Jun 9 09:28:06 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: ce7d3e1c5531fce828722379cfbd58cb5d4dfab9
      https://github.com/llvm/llvm-project/commit/ce7d3e1c5531fce828722379cfbd58cb5d4dfab9
  Author: Arthur Eubanks <aeubanks at google.com>
  Date:   2020-06-09 (Tue, 09 Jun 2020)

  Changed paths:
    M clang/lib/CodeGen/CGCall.cpp
    M clang/lib/CodeGen/CGDebugInfo.cpp
    M clang/lib/CodeGen/CGDebugInfo.h
    M clang/lib/CodeGen/CGExprCXX.cpp
    M clang/lib/CodeGen/CGExprScalar.cpp
    M clang/test/CodeGen/debug-info-codeview-heapallocsite.c
    A clang/test/CodeGenCXX/debug-info-codeview-heapallocsite.cpp

  Log Message:
  -----------
  Reland (again) D80966 [codeview] Put !heapallocsite on calls to operator new

Check that getDebugInfo() is not null, as in the first revision, before
calling getDebugInfo()->addHeapAllocSiteMetadata().
Else would cause a crash with a new expression in a default arg.

---

Clang marks calls to operator new as heap allocation sites, but the
operator declared at global scope returns a void pointer. There is no
explicit cast in the code, so the compiler has to write down the
allocated type itself.

Also generalize a cast to use CallBase, so that we mark heap alloc sites
when exceptions are enabled.

Differential Revision: https://reviews.llvm.org/D80966




More information about the All-commits mailing list