forked from OSchip/llvm-project
34 lines
1002 B
C++
34 lines
1002 B
C++
//===- llvm/Support/DiagnosticInfo.cpp - Diagnostic Definitions -*- C++ -*-===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This file defines the different classes involved in codegen diagnostics.
|
|
//
|
|
// Diagnostics reporting is still done as part of the LLVMContext.
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "llvm/IR/DiagnosticInfo.h"
|
|
#include "llvm/IR/DiagnosticPrinter.h"
|
|
|
|
namespace llvm {
|
|
|
|
void DiagnosticInfoUnsupported::print(DiagnosticPrinter &DP) const {
|
|
std::string Str;
|
|
raw_string_ostream OS(Str);
|
|
|
|
OS << getLocationStr() << ": in function " << getFunction().getName() << ' '
|
|
<< *getFunction().getFunctionType() << ": " << Msg;
|
|
if (Value)
|
|
Value->print(OS);
|
|
OS << '\n';
|
|
OS.flush();
|
|
DP << Str;
|
|
}
|
|
|
|
}
|