[cfe-commits] r71590 - /cfe/trunk/lib/CodeGen/CodeGenModule.cpp

Chris Lattner sabre at nondot.org
Tue May 12 13:58:15 PDT 2009


Author: lattner
Date: Tue May 12 15:58:15 2009
New Revision: 71590

URL: http://llvm.org/viewvc/llvm-project?rev=71590&view=rev
Log:
cleanups, no functionality change.

Modified:
    cfe/trunk/lib/CodeGen/CodeGenModule.cpp

Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=71590&r1=71589&r2=71590&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Tue May 12 15:58:15 2009
@@ -600,7 +600,7 @@
   // 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 @@
     }
   }
 
-  // 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 @@
     // 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()) {





More information about the cfe-commits mailing list