Override use_back in instruction/basicblock to provide more type information.

llvm-svn: 30678
This commit is contained in:
Chris Lattner 2006-09-30 22:20:34 +00:00
parent 87732cfb71
commit 456a806692
2 changed files with 10 additions and 1 deletions

View File

@ -85,6 +85,11 @@ public:
BasicBlock *getPrev() { return Prev; }
const BasicBlock *getPrev() const { return Prev; }
/// use_back - Specialize the methods defined in Value, as we know that an
/// BasicBlock can only be used by Instructions (specifically PHI and terms).
Instruction *use_back() { return cast<Instruction>(*use_begin());}
const Instruction *use_back() const { return cast<Instruction>(*use_begin());}
/// getTerminator() - If this is a well formed basic block, then this returns
/// a pointer to the terminator instruction. If it is not, then you get a
/// null pointer back.

View File

@ -71,7 +71,11 @@ public:
/// extra information (e.g. load is volatile) agree.
bool isIdenticalTo(Instruction *I) const;
/// use_back - Specialize the methods defined in Value, as we know that an
/// instruction can only be used by other instructions.
Instruction *use_back() { return cast<Instruction>(*use_begin());}
const Instruction *use_back() const { return cast<Instruction>(*use_begin());}
// Accessor methods...
//
inline const BasicBlock *getParent() const { return Parent; }