From 5526f4f094294a7f5c63f80c0fb096ee9dbc3867 Mon Sep 17 00:00:00 2001 From: Larisse Voufo Date: Sat, 14 Feb 2015 05:42:57 +0000 Subject: 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. llvm-svn: 229241 --- clang/lib/CodeGen/CodeGenModule.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index bc52028..fdcbe2a 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/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(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 -- cgit v1.1