llvm-6502/include/llvm/ProfileData/InstrProf.h
Justin Bogner e153fb33e4 ProfileData: Add support for the indexed instrprof format
This adds support for an indexed instrumentation based profiling
format, which is just a small header and an on disk hash table.  This
format will be used by clang's -fprofile-instr-use= for PGO.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206656 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-18 21:48:40 +00:00

58 lines
1.5 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,
bad_header,
unsupported_version,
unsupported_hash_type,
too_large,
truncated,
malformed,
unknown_function,
hash_mismatch,
count_mismatch,
counter_overflow
};
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_