From 072ddb1dac5afbf5c789a4ea7c7a2a4205508011 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 30 Oct 2003 23:41:19 +0000 Subject: [PATCH] Expose new print methods git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9620 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/BasicBlock.h | 3 ++- include/llvm/Function.h | 3 ++- include/llvm/Instruction.h | 5 ++++- include/llvm/Module.h | 4 +++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/include/llvm/BasicBlock.h b/include/llvm/BasicBlock.h index 506bf3a3c23..1a996bcf265 100644 --- a/include/llvm/BasicBlock.h +++ b/include/llvm/BasicBlock.h @@ -122,7 +122,8 @@ public: const InstListType &getInstList() const { return InstList; } InstListType &getInstList() { return InstList; } - virtual void print(std::ostream &OS) const; + virtual void print(std::ostream &OS) const { print(OS, 0); } + void print(std::ostream &OS, AssemblyAnnotationWriter *AAW) const; /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const BasicBlock *BB) { return true; } diff --git a/include/llvm/Function.h b/include/llvm/Function.h index 7d4f43fb76a..3c44b3658f2 100644 --- a/include/llvm/Function.h +++ b/include/llvm/Function.h @@ -181,7 +181,8 @@ public: const Argument &aback() const { return ArgumentList.back(); } Argument &aback() { return ArgumentList.back(); } - virtual void print(std::ostream &OS) const; + virtual void print(std::ostream &OS) const { print(OS, 0); } + void print(std::ostream &OS, AssemblyAnnotationWriter *AAW) const; /// viewCFG - This function is meant for use from the debugger. You can just /// say 'call F->viewCFG()' and a ghostview window should pop up from the diff --git a/include/llvm/Instruction.h b/include/llvm/Instruction.h index f23fe32ef35..264356ca91e 100644 --- a/include/llvm/Instruction.h +++ b/include/llvm/Instruction.h @@ -17,6 +17,8 @@ #include "llvm/User.h" +class AssemblyAnnotationWriter; + template struct ilist_traits; template class SymbolTableListTraits; @@ -108,7 +110,8 @@ public: } static bool isTrapping(unsigned op); - virtual void print(std::ostream &OS) const; + virtual void print(std::ostream &OS) const { print(OS, 0); } + void print(std::ostream &OS, AssemblyAnnotationWriter *AAW) const; /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const Instruction *I) { return true; } diff --git a/include/llvm/Module.h b/include/llvm/Module.h index bb9159678d7..19626aea03b 100644 --- a/include/llvm/Module.h +++ b/include/llvm/Module.h @@ -187,7 +187,9 @@ public: inline const Function &back() const { return FunctionList.back(); } inline Function &back() { return FunctionList.back(); } - void print(std::ostream &OS) const; + void print(std::ostream &OS) const { print(OS, 0); } + void print(std::ostream &OS, AssemblyAnnotationWriter *AAW) const; + void dump() const; /// dropAllReferences() - This function causes all the subinstructions to "let