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 | 0c691d029a2a28b5337325e0c49c90ce9e8bfba6 (patch) | |
| tree | 1de98955d0300d01ae32ebf82ff93fbce1d632ae /clang/lib/CodeGen | |
| parent | 6f5a859633867af4040bb7d9fe3d647f1c074b45 (diff) | |
| download | bcm5719-llvm-0c691d029a2a28b5337325e0c49c90ce9e8bfba6.tar.gz bcm5719-llvm-0c691d029a2a28b5337325e0c49c90ce9e8bfba6.zip  | |
More on fixing sized deallocation implementation logic: Fix PR21754.
llvm-svn: 229291
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 13 | 
1 files changed, 8 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index fdcbe2a42e8..ea7da8c5ce7 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/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  | 

