5798ae8ac78628610ec9164141f22056e4feacd7
[oota-llvm.git] / include / llvm / Assembly / Writer.h
1 //===-- llvm/Assembly/Writer.h - Printer for VM assembly files --*- C++ -*-===//
2 // 
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
7 // 
8 //===----------------------------------------------------------------------===//
9 //
10 // This functionality is implemented by the lib/Assembly/Writer library.
11 // This library is used to print VM assembly language files to an iostream. It
12 // can print VM code at a variety of granularities, ranging from a whole class
13 // down to an individual instruction.  This makes it useful for debugging.
14 //
15 // This file also defines functions that allow it to output files that a program
16 // called VCG can read.
17 //
18 // This library uses the Analysis library to figure out offsets for
19 // variables in the method tables...
20 //
21 //===----------------------------------------------------------------------===//
22
23 #ifndef LLVM_ASSEMBLY_WRITER_H
24 #define LLVM_ASSEMBLY_WRITER_H
25
26 #include <iosfwd>
27 class Type;
28 class Module;
29 class Value;
30
31 // WriteTypeSymbolic - This attempts to write the specified type as a symbolic
32 // type, iff there is an entry in the modules symbol table for the specified
33 // type or one of it's component types.  This is slower than a simple x << Type;
34 //
35 std::ostream &WriteTypeSymbolic(std::ostream &, const Type *, const Module *M);
36
37 // WriteAsOperand - Write the name of the specified value out to the specified
38 // ostream.  This can be useful when you just want to print int %reg126, not the
39 // whole instruction that generated it.  If you specify a Module for context,
40 // then even constants get pretty printed (for example the type of a null 
41 // pointer is printed symbolically).
42 //
43 std::ostream &WriteAsOperand(std::ostream &, const Value *, bool PrintTy = true,
44                              bool PrintName = true, const Module *Context = 0);
45
46 #endif