diff options
author | Larisse Voufo <lvoufo@google.com> | 2015-02-15 08:16:37 +0000 |
---|---|---|
committer | Larisse Voufo <lvoufo@google.com> | 2015-02-15 08:16:37 +0000 |
commit | d79504c432017443eadbee5ca26f56951ed7e4bc (patch) | |
tree | 7000a1d6cd8823da157f8d0ccf810e2cbf79d63a /lib/CodeGen/CodeGenModule.cpp | |
parent | dddcd7129233476dff0ed4699c21909957fd08b2 (diff) | |
download | clang-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.cpp | 13 |
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 |