summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
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