summaryrefslogtreecommitdiff
path: root/include/llvm/Instruction.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-06-25 16:12:52 +0000
committerChris Lattner <sabre@nondot.org>2002-06-25 16:12:52 +0000
commit18961504fc2b299578dba817900a0696cf3ccc4d (patch)
treec34853ffc064b841932d0897e25305c81c3a7338 /include/llvm/Instruction.h
parenta2204e1ff25265a1da00ecbb3ebb22c05acf7194 (diff)
downloadllvm-18961504fc2b299578dba817900a0696cf3ccc4d.tar.gz
llvm-18961504fc2b299578dba817900a0696cf3ccc4d.tar.bz2
llvm-18961504fc2b299578dba817900a0696cf3ccc4d.tar.xz
*** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2777 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Instruction.h')
-rw-r--r--include/llvm/Instruction.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/include/llvm/Instruction.h b/include/llvm/Instruction.h
index 9ab6f8a106..7cdee5d2c1 100644
--- a/include/llvm/Instruction.h
+++ b/include/llvm/Instruction.h
@@ -9,11 +9,19 @@
#define LLVM_INSTRUCTION_H
#include "llvm/User.h"
+template<typename SC> struct ilist_traits;
+template<typename ValueSubClass, typename ItemParentClass, typename SymTabClass,
+ typename SubClass> class SymbolTableListTraits;
class Instruction : public User {
BasicBlock *Parent;
+ Instruction *Prev, *Next; // Next and Prev links for our intrusive linked list
- friend class ValueHolder<Instruction,BasicBlock,Function>;
+ void setNext(Instruction *N) { Next = N; }
+ void setPrev(Instruction *N) { Prev = N; }
+
+ friend class SymbolTableListTraits<Instruction, BasicBlock, Function,
+ ilist_traits<Instruction> >;
inline void setParent(BasicBlock *P) { Parent = P; }
protected:
unsigned iType; // InstructionType
@@ -37,6 +45,14 @@ public:
//
inline const BasicBlock *getParent() const { return Parent; }
inline BasicBlock *getParent() { return Parent; }
+
+ // getNext/Prev - Return the next or previous instruction in the list. The
+ // last node in the list is a terminator instruction.
+ Instruction *getNext() { return Next; }
+ const Instruction *getNext() const { return Next; }
+ Instruction *getPrev() { return Prev; }
+ const Instruction *getPrev() const { return Prev; }
+
virtual bool hasSideEffects() const { return false; } // Memory & Call insts
// ---------------------------------------------------------------------------