diff options
author | Dan Gohman <gohman@apple.com> | 2009-04-22 16:05:50 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-04-22 16:05:50 +0000 |
commit | 6cdc727f2d7f68734526ef078f4632798ad40791 (patch) | |
tree | 59bc5a27f03c90d1face64dc9f4b228c8b3793ea /include/llvm/Analysis/ScalarEvolutionExpander.h | |
parent | b928c57397f61e4c54274818dd63e61e21016d9d (diff) | |
download | llvm-6cdc727f2d7f68734526ef078f4632798ad40791.tar.gz llvm-6cdc727f2d7f68734526ef078f4632798ad40791.tar.bz2 llvm-6cdc727f2d7f68734526ef078f4632798ad40791.tar.xz |
Use BasicBlock::iterator instead of Instruction* for insert points,
to better handle inserting instructions at the end of a block.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69807 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/ScalarEvolutionExpander.h')
-rw-r--r-- | include/llvm/Analysis/ScalarEvolutionExpander.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/include/llvm/Analysis/ScalarEvolutionExpander.h b/include/llvm/Analysis/ScalarEvolutionExpander.h index 5327f9d716..6e2db29f01 100644 --- a/include/llvm/Analysis/ScalarEvolutionExpander.h +++ b/include/llvm/Analysis/ScalarEvolutionExpander.h @@ -32,7 +32,7 @@ namespace llvm { std::map<SCEVHandle, Value*> InsertedExpressions; std::set<Instruction*> InsertedInstructions; - Instruction *InsertPt; + BasicBlock::iterator InsertPt; friend struct SCEVVisitor<SCEVExpander, Value*>; public: @@ -71,12 +71,13 @@ namespace llvm { InsertedInstructions.insert(I); } - Instruction *getInsertionPoint() const { return InsertPt; } - + BasicBlock::iterator getInsertionPoint() const { return InsertPt; } + /// expandCodeFor - Insert code to directly compute the specified SCEV /// expression into the program. The inserted code is inserted into the /// specified block. - Value *expandCodeFor(SCEVHandle SH, const Type *Ty, Instruction *IP); + Value *expandCodeFor(SCEVHandle SH, const Type *Ty, + BasicBlock::iterator IP); /// InsertCastOfTo - Insert a cast of V to the specified type, doing what /// we can to share the casts. @@ -90,7 +91,7 @@ namespace llvm { /// InsertBinop - Insert the specified binary operator, doing a small amount /// of work to avoid inserting an obviously redundant operation. static Value *InsertBinop(Instruction::BinaryOps Opcode, Value *LHS, - Value *RHS, Instruction *InsertPt); + Value *RHS, BasicBlock::iterator InsertPt); private: Value *expand(const SCEV *S); |