summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorLarisse Voufo <lvoufo@google.com>2015-02-15 08:16:37 +0000
committerLarisse Voufo <lvoufo@google.com>2015-02-15 08:16:37 +0000
commitd79504c432017443eadbee5ca26f56951ed7e4bc (patch)
tree7000a1d6cd8823da157f8d0ccf810e2cbf79d63a /lib/CodeGen/CodeGenModule.cpp
parentdddcd7129233476dff0ed4699c21909957fd08b2 (diff)
downloadclang-d79504c432017443eadbee5ca26f56951ed7e4bc.tar.gz
More on fixing sized deallocation implementation logic: Fix PR21754.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@229291 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--lib/CodeGen/CodeGenModule.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index fdcbe2a42e..ea7da8c5ce 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/lib/CodeGen/CodeGenModule.cpp
@@ -1617,11 +1617,14 @@ CodeGenModule::GetOrCreateLLVMFunction(StringRef MangledName,
DeferredDecls.erase(DDI);
// Otherwise, if this is a sized deallocation function, emit a weak
- // definition for it at the end of the translation unit.
- } else if (D && cast<FunctionDecl>(D)
- ->getCorrespondingUnsizedGlobalDeallocationFunction()) {
- if (getLangOpts().DefaultSizedDelete)
- addDeferredDeclToEmit(F, GD);
+ // definition for it at the end of the translation unit (if allowed),
+ // unless the sized deallocation function is aliased.
+ } else if (D &&
+ cast<FunctionDecl>(D)
+ ->getCorrespondingUnsizedGlobalDeallocationFunction() &&
+ !getLangOpts().DefaultSizedDelete &&
+ !D->hasAttr<AliasAttr>()) {
+ addDeferredDeclToEmit(F, GD);
// Otherwise, there are cases we have to worry about where we're
// using a declaration for which we must emit a definition but where