From: Chris Lattner Date: Tue, 12 May 2009 20:58:15 +0000 (+0000) Subject: cleanups, no functionality change. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9fa959d5bfbbb17d7c6ba71252219201fc8dc971;p=clang cleanups, no functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71590 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 08f2b27bea..c2dc629680 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -600,7 +600,7 @@ llvm::Constant *CodeGenModule::GetOrCreateLLVMFunction(const char *MangledName, // deferred decl with this name, remember that we need to emit it at the end // of the file. llvm::DenseMap::iterator DDI = - DeferredDecls.find(MangledName); + DeferredDecls.find(MangledName); if (DDI != DeferredDecls.end()) { // Move the potentially referenced deferred decl to the DeferredDeclsToEmit // list, and remove it from DeferredDecls (since we don't need it anymore). @@ -938,7 +938,7 @@ void CodeGenModule::EmitGlobalFunctionDefinition(const FunctionDecl *D) { } } - // Get or create the prototype for teh function. + // Get or create the prototype for the function. llvm::Constant *Entry = GetAddrOfFunction(D, Ty); // Strip off a bitcast if we got one back. @@ -970,8 +970,10 @@ void CodeGenModule::EmitGlobalFunctionDefinition(const FunctionDecl *D) { // If this is an implementation of a function without a prototype, try to // replace any existing uses of the function (which may be calls) with uses // of the new function - if (D->getType()->isFunctionNoProtoType()) + if (D->getType()->isFunctionNoProtoType()) { ReplaceUsesOfNonProtoTypeWithRealFunction(OldFn, NewFn); + OldFn->removeDeadConstantUsers(); + } // Replace uses of F with the Function we will endow with a body. if (!Entry->use_empty()) {