mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-26 06:22:56 +02:00
53 lines
1.4 KiB
C
53 lines
1.4 KiB
C
|
//=-- InstrProf.h - Instrumented profiling format support ---------*- C++ -*-=//
|
||
|
//
|
||
|
// The LLVM Compiler Infrastructure
|
||
|
//
|
||
|
// This file is distributed under the University of Illinois Open Source
|
||
|
// License. See LICENSE.TXT for details.
|
||
|
//
|
||
|
//===----------------------------------------------------------------------===//
|
||
|
//
|
||
|
// Instrumentation-based profiling data is generated by instrumented
|
||
|
// binaries through library functions in compiler-rt, and read by the clang
|
||
|
// frontend to feed PGO.
|
||
|
//
|
||
|
//===----------------------------------------------------------------------===//
|
||
|
|
||
|
#ifndef LLVM_PROFILEDATA_INSTRPROF_H__
|
||
|
#define LLVM_PROFILEDATA_INSTRPROF_H__
|
||
|
|
||
|
#include "llvm/Support/system_error.h"
|
||
|
|
||
|
namespace llvm {
|
||
|
|
||
|
const error_category &instrprof_category();
|
||
|
|
||
|
struct instrprof_error {
|
||
|
enum ErrorType {
|
||
|
success = 0,
|
||
|
eof,
|
||
|
bad_magic,
|
||
|
unsupported_version,
|
||
|
too_large,
|
||
|
truncated,
|
||
|
malformed,
|
||
|
unknown_function
|
||
|
};
|
||
|
ErrorType V;
|
||
|
|
||
|
instrprof_error(ErrorType V) : V(V) {}
|
||
|
operator ErrorType() const { return V; }
|
||
|
};
|
||
|
|
||
|
inline error_code make_error_code(instrprof_error E) {
|
||
|
return error_code(static_cast<int>(E), instrprof_category());
|
||
|
}
|
||
|
|
||
|
template <> struct is_error_code_enum<instrprof_error> : std::true_type {};
|
||
|
template <> struct is_error_code_enum<instrprof_error::ErrorType>
|
||
|
: std::true_type {};
|
||
|
|
||
|
} // end namespace llvm
|
||
|
|
||
|
#endif // LLVM_PROFILEDATA_INSTRPROF_H__
|