diff options
author | Chris Lattner <sabre@nondot.org> | 2009-05-12 20:58:15 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-05-12 20:58:15 +0000 |
commit | eb7466d24a8b2bc7e6495fc97060b831fc8a8ffe (patch) | |
tree | d810356dece70099ab4892dc4adc0bfdc48a1d42 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | da7a0977d69019395ecd65b8c4847566751f7d25 (diff) | |
download | bcm5719-llvm-eb7466d24a8b2bc7e6495fc97060b831fc8a8ffe.tar.gz bcm5719-llvm-eb7466d24a8b2bc7e6495fc97060b831fc8a8ffe.zip |
cleanups, no functionality change.
llvm-svn: 71590
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 08f2b27bea5..c2dc629680c 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/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<const char*, GlobalDecl>::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()) { |