LLVM API Documentation
00001 //=-- InstrProf.h - Instrumented profiling format support ---------*- 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 // Instrumentation-based profiling data is generated by instrumented 00011 // binaries through library functions in compiler-rt, and read by the clang 00012 // frontend to feed PGO. 00013 // 00014 //===----------------------------------------------------------------------===// 00015 00016 #ifndef LLVM_PROFILEDATA_INSTRPROF_H_ 00017 #define LLVM_PROFILEDATA_INSTRPROF_H_ 00018 00019 #include <system_error> 00020 00021 namespace llvm { 00022 const std::error_category &instrprof_category(); 00023 00024 enum class instrprof_error { 00025 success = 0, 00026 eof, 00027 bad_magic, 00028 bad_header, 00029 unsupported_version, 00030 unsupported_hash_type, 00031 too_large, 00032 truncated, 00033 malformed, 00034 unknown_function, 00035 hash_mismatch, 00036 count_mismatch, 00037 counter_overflow 00038 }; 00039 00040 inline std::error_code make_error_code(instrprof_error E) { 00041 return std::error_code(static_cast<int>(E), instrprof_category()); 00042 } 00043 00044 } // end namespace llvm 00045 00046 namespace std { 00047 template <> 00048 struct is_error_code_enum<llvm::instrprof_error> : std::true_type {}; 00049 } 00050 00051 #endif // LLVM_PROFILEDATA_INSTRPROF_H_