aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-04-08 21:56:02 +0000
committerChris Lattner <sabre@nondot.org>2002-04-08 21:56:02 +0000
commit5109f75f50501e3bd8ade66029ca485aeb359ff6 (patch)
treee05d97fd8d95031f6583c20a2cf5a8f1a5986652
parent5e1cfc58c1907eb70710c54808762657cf625180 (diff)
downloadexternal_llvm-5109f75f50501e3bd8ade66029ca485aeb359ff6.zip
external_llvm-5109f75f50501e3bd8ade66029ca485aeb359ff6.tar.gz
external_llvm-5109f75f50501e3bd8ade66029ca485aeb359ff6.tar.bz2
* Add virtual print methods
* s/Method/Function git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2172 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/BasicBlock.h2
-rw-r--r--include/llvm/Constants.h2
-rw-r--r--include/llvm/Function.h1
-rw-r--r--include/llvm/GlobalVariable.h2
-rw-r--r--include/llvm/Instruction.h4
-rw-r--r--include/llvm/Module.h2
-rw-r--r--include/llvm/iOther.h2
7 files changed, 14 insertions, 1 deletions
diff --git a/include/llvm/BasicBlock.h b/include/llvm/BasicBlock.h
index 16f2ffe..d8bb660 100644
--- a/include/llvm/BasicBlock.h
+++ b/include/llvm/BasicBlock.h
@@ -104,6 +104,8 @@ public:
const InstListType &getInstList() const { return InstList; }
InstListType &getInstList() { return InstList; }
+ virtual void print(std::ostream &OS) const;
+
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const BasicBlock *BB) { return true; }
static inline bool classof(const Value *V) {
diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h
index 1a4ebda..dd7147e 100644
--- a/include/llvm/Constants.h
+++ b/include/llvm/Constants.h
@@ -47,6 +47,8 @@ public:
// getNullConstant.
virtual bool isNullValue() const = 0;
+ virtual void print(std::ostream &O) const;
+
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const Constant *) { return true; }
static inline bool classof(const Value *V) {
diff --git a/include/llvm/Function.h b/include/llvm/Function.h
index 4621694..322cb8a 100644
--- a/include/llvm/Function.h
+++ b/include/llvm/Function.h
@@ -83,6 +83,7 @@ public:
inline const BasicBlock *back() const { return BasicBlocks.back(); }
inline BasicBlock *back() { return BasicBlocks.back(); }
+ virtual void print(std::ostream &OS) const;
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const Function *) { return true; }
diff --git a/include/llvm/GlobalVariable.h b/include/llvm/GlobalVariable.h
index 9f10f71..79507a5 100644
--- a/include/llvm/GlobalVariable.h
+++ b/include/llvm/GlobalVariable.h
@@ -59,6 +59,8 @@ public:
//
inline bool isConstant() const { return isConstantGlobal; }
+ virtual void print(std::ostream &OS) const;
+
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const GlobalVariable *) { return true; }
static inline bool classof(const Value *V) {
diff --git a/include/llvm/Instruction.h b/include/llvm/Instruction.h
index ba39fd2..cf7ce7d 100644
--- a/include/llvm/Instruction.h
+++ b/include/llvm/Instruction.h
@@ -13,7 +13,7 @@
class Instruction : public User {
BasicBlock *Parent;
- friend class ValueHolder<Instruction,BasicBlock,Method>;
+ friend class ValueHolder<Instruction,BasicBlock,Function>;
inline void setParent(BasicBlock *P) { Parent = P; }
protected:
unsigned iType; // InstructionType
@@ -60,6 +60,8 @@ public:
return iType >= FirstBinaryOp && iType < NumBinaryOps;
}
+ virtual void print(std::ostream &OS) const;
+
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const Instruction *I) { return true; }
static inline bool classof(const Value *V) {
diff --git a/include/llvm/Module.h b/include/llvm/Module.h
index bc7f564..d94500a 100644
--- a/include/llvm/Module.h
+++ b/include/llvm/Module.h
@@ -120,6 +120,8 @@ public:
return V->getValueType() == Value::ModuleVal;
}
+ virtual void print(std::ostream &OS) const;
+
// dropAllReferences() - This function causes all the subinstructions to "let
// go" of all references that they are maintaining. This allows one to
// 'delete' a whole class at a time, even though there may be circular
diff --git a/include/llvm/iOther.h b/include/llvm/iOther.h
index a961eca..3e3bfc4 100644
--- a/include/llvm/iOther.h
+++ b/include/llvm/iOther.h
@@ -66,6 +66,8 @@ public:
inline const Function *getParent() const { return Parent; }
inline Function *getParent() { return Parent; }
+ virtual void print(std::ostream &OS) const;
+
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const FunctionArgument *) { return true; }
static inline bool classof(const Value *V) {