LLVM API Documentation

Writer.h

Go to the documentation of this file.
00001 //===-- llvm/Assembly/Writer.h - Printer for LLVM assembly files --*- C++ -*-=//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file was developed by the LLVM research group and is distributed under
00006 // the University of Illinois Open Source License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This functionality is implemented by lib/VMCore/AsmWriter.cpp.
00011 // This library is used to print LLVM assembly language files to an iostream. It
00012 // can print LLVM code at a variety of granularities, including Modules,
00013 // BasicBlocks, and Instructions.  This makes it useful for debugging.
00014 //
00015 //===----------------------------------------------------------------------===//
00016 
00017 #ifndef LLVM_ASSEMBLY_WRITER_H
00018 #define LLVM_ASSEMBLY_WRITER_H
00019 
00020 #include <iosfwd>
00021 
00022 namespace llvm {
00023 
00024 class Type;
00025 class Module;
00026 class Value;
00027 
00028 // WriteTypeSymbolic - This attempts to write the specified type as a symbolic
00029 // type, iff there is an entry in the Module's symbol table for the specified
00030 // type or one of its component types.  This is slower than a simple x << Type;
00031 //
00032 std::ostream &WriteTypeSymbolic(std::ostream &, const Type *, const Module *M);
00033 
00034 // WriteAsOperand - Write the name of the specified value out to the specified
00035 // ostream.  This can be useful when you just want to print int %reg126, not the
00036 // whole instruction that generated it.  If you specify a Module for context,
00037 // then even constants get pretty-printed; for example, the type of a null
00038 // pointer is printed symbolically.
00039 //
00040 std::ostream &WriteAsOperand(std::ostream &, const Value *, bool PrintTy = true,
00041                              bool PrintName = true, const Module *Context = 0);
00042 
00043 std::ostream &WriteAsOperand(std::ostream&, const Type*, bool PrintTy = true,
00044                              bool PrintName = true, const Module* Context = 0);
00045 
00046 } // End llvm namespace
00047 
00048 #endif