[cfe-commits] r68151 - in /cfe/trunk/lib/CodeGen: CodeGenFunction.cpp CodeGenFunction.h CodeGenModule.cpp

Chris Lattner sabre at nondot.org
Tue Mar 31 15:17:45 PDT 2009


Author: lattner
Date: Tue Mar 31 17:17:44 2009
New Revision: 68151

URL: http://llvm.org/viewvc/llvm-project?rev=68151&view=rev
Log:
remove some obsolete comments, use an AssertingVH.

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

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

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.cpp Tue Mar 31 17:17:44 2009
@@ -133,8 +133,9 @@
   EmitFunctionEpilog(*CurFnInfo, ReturnValue);
 
   // Remove the AllocaInsertPt instruction, which is just a convenience for us.
-  AllocaInsertPt->eraseFromParent();
+  llvm::Instruction *Ptr = AllocaInsertPt;
   AllocaInsertPt = 0;
+  Ptr->eraseFromParent();
 }
 
 void CodeGenFunction::StartFunction(const Decl *D, QualType RetTy, 

Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.h?rev=68151&r1=68150&r2=68151&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.h (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.h Tue Mar 31 17:17:44 2009
@@ -15,16 +15,13 @@
 #define CLANG_CODEGEN_CODEGENFUNCTION_H
 
 #include "clang/AST/Type.h"
-#include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/SmallVector.h"
-#include "clang/Basic/TargetInfo.h"
-#include "clang/AST/Expr.h"
 #include "clang/AST/ExprCXX.h"
 #include "clang/AST/ExprObjC.h"
-
-#include <vector>
+#include "clang/Basic/TargetInfo.h"
+#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/ValueHandle.h"
 #include <map>
-
 #include "CGBlocks.h"
 #include "CGBuilder.h"
 #include "CGCall.h"
@@ -87,7 +84,7 @@
 
   /// AllocaInsertPoint - This is an instruction in the entry block before which
   /// we prefer to insert allocas.
-  llvm::Instruction *AllocaInsertPt;
+  llvm::AssertingVH<llvm::Instruction> AllocaInsertPt;
 
   const llvm::Type *LLVMIntTy;
   uint32_t LLVMPointerWidth;

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

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Tue Mar 31 17:17:44 2009
@@ -118,17 +118,6 @@
 /// const char* containing the mangled name.  Otherwise, returns
 /// the unmangled name.
 ///
-/// FIXME: Returning an IdentifierInfo* here is a total hack. We
-/// really need some kind of string abstraction that either stores a
-/// mangled name or stores an IdentifierInfo*. This will require
-/// changes to the GlobalDeclMap, too. (I disagree, I think what we
-/// actually need is for Sema to provide some notion of which Decls
-/// refer to the same semantic decl. We shouldn't need to mangle the
-/// names and see what comes out the same to figure this out. - DWD)
-///
-/// FIXME: Performance here is going to be terribly until we start
-/// caching mangled names. However, we should fix the problem above
-/// first.
 const char *CodeGenModule::getMangledName(const NamedDecl *ND) {
   // In C, functions with no attributes never need to be mangled. Fastpath them.
   if (!getLangOptions().CPlusPlus && !ND->hasAttrs()) {





More information about the cfe-commits mailing list