aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGExprCXX.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/CGExprCXX.cpp')
-rw-r--r--clang/lib/CodeGen/CGExprCXX.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/clang/lib/CodeGen/CGExprCXX.cpp b/clang/lib/CodeGen/CGExprCXX.cpp
index 290c2e0..c52526c 100644
--- a/clang/lib/CodeGen/CGExprCXX.cpp
+++ b/clang/lib/CodeGen/CGExprCXX.cpp
@@ -1655,16 +1655,11 @@ llvm::Value *CodeGenFunction::EmitCXXNewExpr(const CXXNewExpr *E) {
RValue RV =
EmitNewDeleteCall(*this, allocator, allocatorType, allocatorArgs);
- if (auto *newCall = dyn_cast<llvm::CallBase>(RV.getScalarVal())) {
- if (auto *CGDI = getDebugInfo()) {
- // Set !heapallocsite metadata on the call to operator new.
- CGDI->addHeapAllocSiteMetadata(newCall, allocType, E->getExprLoc());
- }
- if (SanOpts.has(SanitizerKind::AllocToken)) {
- // Set !alloc_token metadata.
- EmitAllocToken(newCall, allocType);
- }
- }
+ // Set !heapallocsite metadata on the call to operator new.
+ if (getDebugInfo())
+ if (auto *newCall = dyn_cast<llvm::CallBase>(RV.getScalarVal()))
+ getDebugInfo()->addHeapAllocSiteMetadata(newCall, allocType,
+ E->getExprLoc());
// If this was a call to a global replaceable allocation function that does
// not take an alignment argument, the allocator is known to produce