]> granicus.if.org Git - clang/commitdiff
Make CGBuilderTy a typedef again; its functionality has been rolled back
authorJohn McCall <rjmccall@apple.com>
Tue, 6 Jul 2010 18:43:48 +0000 (18:43 +0000)
committerJohn McCall <rjmccall@apple.com>
Tue, 6 Jul 2010 18:43:48 +0000 (18:43 +0000)
into IRBuilder.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107687 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGBuilder.h

index 33d868920dcbafaf0de8438c17287d1b69053613..8120217ac873bb0103e265191adb63e685138945 100644 (file)
@@ -17,58 +17,11 @@ namespace CodeGen {
 
 // Don't preserve names on values in an optimized build.
 #ifdef NDEBUG
-typedef llvm::IRBuilder<false> CGBuilderSuperTy;
+typedef llvm::IRBuilder<false> CGBuilderTy;
 #else
-typedef llvm::IRBuilder<> CGBuilderSuperTy;
+typedef llvm::IRBuilder<> CGBuilderTy;
 #endif
 
-/// IR generation's wrapper around an LLVM IRBuilder.
-class CGBuilderTy : public CGBuilderSuperTy {
-public:
-  CGBuilderTy(llvm::LLVMContext &Context) : CGBuilderSuperTy(Context) {}
-  CGBuilderTy(llvm::BasicBlock *Block) : CGBuilderSuperTy(Block) {}
-  CGBuilderTy(llvm::BasicBlock *Block, llvm::BasicBlock::iterator Point)
-    : CGBuilderSuperTy(Block, Point) {}
-
-  CGBuilderTy(const CGBuilderTy &Builder)
-    : CGBuilderSuperTy(Builder.getContext()) {
-
-    if (Builder.GetInsertBlock())
-      SetInsertPoint(Builder.GetInsertBlock(), Builder.GetInsertPoint());
-  }
-
-  /// A saved insertion point.
-  class InsertPoint {
-    llvm::BasicBlock *Block;
-    llvm::BasicBlock::iterator Point;
-
-  public:
-    InsertPoint(llvm::BasicBlock *Block, llvm::BasicBlock::iterator Point)
-      : Block(Block), Point(Point) {}
-
-    bool isSet() const { return (Block != 0); }
-    llvm::BasicBlock *getBlock() const { return Block; }
-    llvm::BasicBlock::iterator getPoint() const { return Point; }
-  };
-
-  InsertPoint saveIP() const {
-    return InsertPoint(GetInsertBlock(), GetInsertPoint());
-  }
-
-  InsertPoint saveAndClearIP() {
-    InsertPoint IP(GetInsertBlock(), GetInsertPoint());
-    ClearInsertionPoint();
-    return IP;
-  }
-
-  void restoreIP(InsertPoint IP) {
-    if (IP.isSet())
-      SetInsertPoint(IP.getBlock(), IP.getPoint());
-    else
-      ClearInsertionPoint();
-  }
-};
-
 }  // end namespace CodeGen
 }  // end namespace clang