]> granicus.if.org Git - clang/commitdiff
remove some obsolete comments, use an AssertingVH.
authorChris Lattner <sabre@nondot.org>
Tue, 31 Mar 2009 22:17:44 +0000 (22:17 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 31 Mar 2009 22:17:44 +0000 (22:17 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68151 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CodeGenFunction.cpp
lib/CodeGen/CodeGenFunction.h
lib/CodeGen/CodeGenModule.cpp

index 68d10ff56ed7e510bb87521ccec382d5e97536b4..dc00a76ff91012ebdab59ff6f8debcad71d8c58d 100644 (file)
@@ -133,8 +133,9 @@ void CodeGenFunction::FinishFunction(SourceLocation EndLoc) {
   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, 
index f850cfdc5bc34d3a4334b9654f66fbfd41906efc..9dbbb25b220036938281b76ee4c7859e794b5860 100644 (file)
 #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 @@ public:
 
   /// 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;
index 907ade569bbcc8ca2d37c8b588a1461e0f57a441..3de8156fe513e78c5c6fd49ef7645985789999a0 100644 (file)
@@ -118,17 +118,6 @@ static void setGlobalVisibility(llvm::GlobalValue *GV,
 /// 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()) {