LLVM  3.7.0
InstrProf.cpp
Go to the documentation of this file.
1 //=-- InstrProf.cpp - Instrumented profiling format support -----------------=//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains support for clang's instrumentation based PGO and
11 // coverage.
12 //
13 //===----------------------------------------------------------------------===//
14 
18 
19 using namespace llvm;
20 
21 namespace {
22 class InstrProfErrorCategoryType : public std::error_category {
23  const char *name() const LLVM_NOEXCEPT override { return "llvm.instrprof"; }
24  std::string message(int IE) const override {
25  instrprof_error E = static_cast<instrprof_error>(IE);
26  switch (E) {
28  return "Success";
30  return "End of File";
32  return "Invalid profile data (bad magic)";
34  return "Invalid profile data (file header is corrupt)";
36  return "Unsupported profiling format version";
38  return "Unsupported profiling hash";
40  return "Too much profile data";
42  return "Truncated profile data";
44  return "Malformed profile data";
46  return "No profile data available for function";
48  return "Function hash mismatch";
50  return "Function count mismatch";
52  return "Counter overflow";
53  }
54  llvm_unreachable("A value of instrprof_error has no message.");
55  }
56 };
57 }
58 
60 
62  return *ErrorCategory;
63 }
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:98
const std::error_category & instrprof_category()
Definition: InstrProf.cpp:61
#define LLVM_NOEXCEPT
Definition: Compiler.h:70
static ManagedStatic< InstrProfErrorCategoryType > ErrorCategory
Definition: InstrProf.cpp:59
static ManagedStatic< _object_error_category > error_category
instrprof_error
Definition: InstrProf.h:27
aarch64 promote const
static const char * name
ManagedStatic - This transparently changes the behavior of global statics to be lazily constructed on...
Definition: ManagedStatic.h:61