LLVM API Documentation

DiagnosticPrinter.cpp
Go to the documentation of this file.
00001 //===- llvm/Support/DiagnosticInfo.cpp - Diagnostic Definitions -*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file defines a diagnostic printer relying on raw_ostream.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #include "llvm/ADT/Twine.h"
00015 #include "llvm/IR/DiagnosticPrinter.h"
00016 #include "llvm/IR/Module.h"
00017 #include "llvm/IR/Value.h"
00018 #include "llvm/Support/raw_ostream.h"
00019 
00020 using namespace llvm;
00021 
00022 DiagnosticPrinter &DiagnosticPrinterRawOStream::operator<<(char C) {
00023   Stream << C;
00024   return *this;
00025 }
00026 
00027 DiagnosticPrinter &DiagnosticPrinterRawOStream::operator<<(unsigned char C) {
00028   Stream << C;
00029   return *this;
00030 }
00031 
00032 DiagnosticPrinter &DiagnosticPrinterRawOStream::operator<<(signed char C) {
00033   Stream << C;
00034   return *this;
00035 }
00036 
00037 DiagnosticPrinter &DiagnosticPrinterRawOStream::operator<<(StringRef Str) {
00038   Stream << Str;
00039   return *this;
00040 }
00041 
00042 DiagnosticPrinter &DiagnosticPrinterRawOStream::operator<<(const char *Str) {
00043   Stream << Str;
00044   return *this;
00045 }
00046 
00047 DiagnosticPrinter &DiagnosticPrinterRawOStream::operator<<(
00048     const std::string &Str) {
00049   Stream << Str;
00050   return *this;
00051 }
00052 
00053 DiagnosticPrinter &DiagnosticPrinterRawOStream::operator<<(unsigned long N) {
00054   Stream << N;
00055   return *this;
00056 }
00057 DiagnosticPrinter &DiagnosticPrinterRawOStream::operator<<(long N) {
00058   Stream << N;
00059   return *this;
00060 }
00061 
00062 DiagnosticPrinter &DiagnosticPrinterRawOStream::operator<<(
00063     unsigned long long N) {
00064   Stream << N;
00065   return *this;
00066 }
00067 
00068 DiagnosticPrinter &DiagnosticPrinterRawOStream::operator<<(long long N) {
00069   Stream << N;
00070   return *this;
00071 }
00072 
00073 DiagnosticPrinter &DiagnosticPrinterRawOStream::operator<<(const void *P) {
00074   Stream << P;
00075   return *this;
00076 }
00077 
00078 DiagnosticPrinter &DiagnosticPrinterRawOStream::operator<<(unsigned int N) {
00079   Stream << N;
00080   return *this;
00081 }
00082 
00083 DiagnosticPrinter &DiagnosticPrinterRawOStream::operator<<(int N) {
00084   Stream << N;
00085   return *this;
00086 }
00087 
00088 DiagnosticPrinter &DiagnosticPrinterRawOStream::operator<<(double N) {
00089   Stream << N;
00090   return *this;
00091 }
00092 
00093 DiagnosticPrinter &DiagnosticPrinterRawOStream::operator<<(const Twine &Str) {
00094   Str.print(Stream);
00095   return *this;
00096 }
00097 
00098 // IR related types.
00099 DiagnosticPrinter &DiagnosticPrinterRawOStream::operator<<(const Value &V) {
00100   Stream << V.getName();
00101   return *this;
00102 }
00103 
00104 DiagnosticPrinter &DiagnosticPrinterRawOStream::operator<<(const Module &M) {
00105   Stream << M.getModuleIdentifier();
00106   return *this;
00107 }