-inline ostream &operator<<(ostream &o, const Module *C) {
- WriteToAssembly(C, o); return o;
-}
-
-inline ostream &operator<<(ostream &o, const GlobalVariable *G) {
- WriteToAssembly(G, o); return o;
-}
-
-inline ostream &operator<<(ostream &o, const Method *M) {
- WriteToAssembly(M, o); return o;
-}
-
-inline ostream &operator<<(ostream &o, const BasicBlock *B) {
- WriteToAssembly(B, o); return o;
-}
-
-inline ostream &operator<<(ostream &o, const Instruction *I) {
- WriteToAssembly(I, o); return o;
-}
-
-inline ostream &operator<<(ostream &o, const ConstPoolVal *I) {
- WriteToAssembly(I, o); return o;
-}
-
-
-inline ostream &operator<<(ostream &o, const Type *T) {
- if (!T) return o << "<null Type>";
- 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;
-}
+void WriteAsOperand(std::ostream &, const Value *, bool PrintTy = true,
+ const Module *Context = 0);
+void WriteAsOperand(raw_ostream &, const Value *, bool PrintTy = true,
+ const Module *Context = 0);