diff options
author | John McCall <rjmccall@apple.com> | 2010-07-06 18:43:48 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-07-06 18:43:48 +0000 |
commit | 189223e222b2a2ca84ac0ef4fa518df282f0a3e4 (patch) | |
tree | f949b4af1865c5464d14b07521c5ff5374d2c8af | |
parent | ec9c6ae1cbda94479c3b4c185a95996baab88e66 (diff) | |
download | bcm5719-llvm-189223e222b2a2ca84ac0ef4fa518df282f0a3e4.tar.gz bcm5719-llvm-189223e222b2a2ca84ac0ef4fa518df282f0a3e4.zip |
Make CGBuilderTy a typedef again; its functionality has been rolled back
into IRBuilder.
llvm-svn: 107687
-rw-r--r-- | clang/lib/CodeGen/CGBuilder.h | 51 |
1 files changed, 2 insertions, 49 deletions
diff --git a/clang/lib/CodeGen/CGBuilder.h b/clang/lib/CodeGen/CGBuilder.h index 33d868920dc..8120217ac87 100644 --- a/clang/lib/CodeGen/CGBuilder.h +++ b/clang/lib/CodeGen/CGBuilder.h @@ -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 |