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
Loading
Please sign in to comment