summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorLarisse Voufo <lvoufo@google.com>2015-02-14 05:42:57 +0000
committerLarisse Voufo <lvoufo@google.com>2015-02-14 05:42:57 +0000
commit4ecf89a2f4759b96d3516f5a03389ec5cc9e78f0 (patch)
tree57972bf0ff5c2e5843d2ada722a20ae261021c54 /lib/CodeGen/CodeGenModule.cpp
parentce39e5c4cb1a0b2d2a0d7f5d9db13e4b477358e4 (diff)
downloadclang-4ecf89a2f4759b96d3516f5a03389ec5cc9e78f0.tar.gz
Revise the implementation logic of sized deallocation: Do not automatically generate weak definitions of the sized operator delete (in terms of unsized operator delete). Instead, provide the funcitonality via a new compiler flag, -fdef-sized-delete.
The current implementation causes link-time ODR violations when the delete symbols are exported into the dynamic table. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@229241 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--lib/CodeGen/CodeGenModule.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index bc52028a06..fdcbe2a42e 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/lib/CodeGen/CodeGenModule.cpp
@@ -1615,13 +1615,13 @@ CodeGenModule::GetOrCreateLLVMFunction(StringRef MangledName,
// don't need it anymore).
addDeferredDeclToEmit(F, DDI->second);
DeferredDecls.erase(DDI);
-
+
// Otherwise, if this is a sized deallocation function, emit a weak
- // definition
- // for it at the end of the translation unit.
+ // definition for it at the end of the translation unit.
} else if (D && cast<FunctionDecl>(D)
->getCorrespondingUnsizedGlobalDeallocationFunction()) {
- addDeferredDeclToEmit(F, GD);
+ if (getLangOpts().DefaultSizedDelete)
+ 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