aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGCall.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2020-06-01 17:11:06 -0700
committerReid Kleckner <rnk@google.com>2020-06-05 12:52:38 -0700
commit672ed5386024ba5cee53e19d637b7920a4889837 (patch)
treeb8f7cfeb513b70128c9c3072a6c741cedccff2a2 /clang/lib/CodeGen/CGCall.cpp
parent7e7ec2b32598083eec0c2a54e04e19f1b7c83594 (diff)
downloadllvm-672ed5386024ba5cee53e19d637b7920a4889837.zip
llvm-672ed5386024ba5cee53e19d637b7920a4889837.tar.gz
llvm-672ed5386024ba5cee53e19d637b7920a4889837.tar.bz2
[codeview] Put !heapallocsite on calls to operator new
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. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D80966
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
-rw-r--r--clang/lib/CodeGen/CGCall.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index 6bde312..136782f 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -4951,7 +4951,7 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
// Add metadata for calls to MSAllocator functions
if (getDebugInfo() && TargetDecl &&
TargetDecl->hasAttr<MSAllocatorAttr>())
- getDebugInfo()->addHeapAllocSiteMetadata(CI, RetTy, Loc);
+ getDebugInfo()->addHeapAllocSiteMetadata(CI, RetTy->getPointeeType(), Loc);
// 4. Finish the call.