diff options
author | Chris Lattner <sabre@nondot.org> | 2001-09-18 17:03:14 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2001-09-18 17:03:14 +0000 |
commit | 6ec11d4eb00fbf90df12a1b8ef94af6178533737 (patch) | |
tree | ab3332431239318d7d75817d5763d12c5cdb8ba8 /include/llvm/Assembly | |
parent | 20f8d5d093400bc7f33f25facd0b99b1e2d8c8c9 (diff) | |
download | llvm-6ec11d4eb00fbf90df12a1b8ef94af6178533737.tar.gz llvm-6ec11d4eb00fbf90df12a1b8ef94af6178533737.tar.bz2 llvm-6ec11d4eb00fbf90df12a1b8ef94af6178533737.tar.xz |
Move operator << from Value.h to Assembly/Writer.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@626 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Assembly')
-rw-r--r-- | include/llvm/Assembly/Writer.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/llvm/Assembly/Writer.h b/include/llvm/Assembly/Writer.h index 6ce3b92681..76c71a52eb 100644 --- a/include/llvm/Assembly/Writer.h +++ b/include/llvm/Assembly/Writer.h @@ -89,4 +89,19 @@ inline ostream &operator<<(ostream &o, const Type *T) { return o << T->getDescription(); } +inline ostream &operator<<(ostream &o, const Value &I) { + switch (I.getValueType()) { + case Value::TypeVal: return o << I.castTypeAsserting(); + case Value::ConstantVal: WriteToAssembly((const ConstPoolVal*)&I,o);break; + case Value::MethodArgumentVal: return o << I.getType() << " "<< I.getName(); + case Value::InstructionVal:WriteToAssembly((const Instruction *)&I, o);break; + case Value::BasicBlockVal: WriteToAssembly((const BasicBlock *)&I, o);break; + case Value::MethodVal: WriteToAssembly((const Method *)&I, o);break; + case Value::GlobalVal: WriteToAssembly((const GlobalVariable*)&I,o);break; + case Value::ModuleVal: WriteToAssembly((const Module *)&I,o); break; + default: return o << "<unknown value type: " << I.getValueType() << ">"; + } + return o; +} + #endif |