diff options
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 22 | ||||
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 10 |
2 files changed, 0 insertions, 32 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index dabec15b784..9e80f0a0a1f 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -802,20 +802,6 @@ static void TryMarkNoThrow(llvm::Function *F) { F->setDoesNotThrow(); } -static void EmitSizedDeallocationFunction(CodeGenFunction &CGF, - const FunctionDecl *UnsizedDealloc) { - // This is a weak discardable definition of the sized deallocation function. - CGF.CurFn->setLinkage(llvm::Function::LinkOnceAnyLinkage); - if (CGF.CGM.supportsCOMDAT()) - CGF.CurFn->setComdat( - CGF.CGM.getModule().getOrInsertComdat(CGF.CurFn->getName())); - - // Call the unsized deallocation function and forward the first argument - // unchanged. - llvm::Constant *Unsized = CGF.CGM.GetAddrOfFunction(UnsizedDealloc); - CGF.Builder.CreateCall(Unsized, &*CGF.CurFn->arg_begin()); -} - void CodeGenFunction::GenerateCode(GlobalDecl GD, llvm::Function *Fn, const CGFunctionInfo &FnInfo) { const FunctionDecl *FD = cast<FunctionDecl>(GD.getDecl()); @@ -891,14 +877,6 @@ void CodeGenFunction::GenerateCode(GlobalDecl GD, llvm::Function *Fn, emitImplicitAssignmentOperatorBody(Args); } else if (Stmt *Body = FD->getBody()) { EmitFunctionBody(Args, Body); - } else if (FunctionDecl *UnsizedDealloc = - FD->getCorrespondingUnsizedGlobalDeallocationFunction()) { - // Global sized deallocation functions get an implicit weak definition if - // they don't have an explicit definition, if allowed. - assert(getLangOpts().DefineSizedDeallocation && - "Can't emit unallowed definition."); - EmitSizedDeallocationFunction(*this, UnsizedDealloc); - } else llvm_unreachable("no definition for emitted function"); diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index d1da069437a..f4ae684179a 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -1620,16 +1620,6 @@ 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 (if allowed), - // unless the sized deallocation function is aliased. - } else if (D && - cast<FunctionDecl>(D) - ->getCorrespondingUnsizedGlobalDeallocationFunction() && - getLangOpts().DefineSizedDeallocation && - !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 |