9f89b3192fd16f189a93f5c3d67e962efa2ba9cd
[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
28 namespace llvm {
29
30 class Type;
31 class Module;
32 class Value;
33
34 // WriteTypeSymbolic - This attempts to write the specified type as a symbolic
35 // type, iff there is an entry in the modules symbol table for the specified
36 // type or one of it's component types.  This is slower than a simple x << Type;
37 //
38 std::ostream &WriteTypeSymbolic(std::ostream &, const Type *, const Module *M);
39
40 // WriteAsOperand - Write the name of the specified value out to the specified
41 // ostream.  This can be useful when you just want to print int %reg126, not the
42 // whole instruction that generated it.  If you specify a Module for context,
43 // then even constants get pretty printed (for example the type of a null 
44 // pointer is printed symbolically).
45 //
46 std::ostream &WriteAsOperand(std::ostream &, const Value *, bool PrintTy = true,
47                              bool PrintName = true, const Module *Context = 0);
48
49 } // End llvm namespace
50
51 #endif