LLVM
3.7.0
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
work
release_test
rc4
llvm.src
lib
ProfileData
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
15
#include "
llvm/ProfileData/InstrProf.h
"
16
#include "
llvm/Support/ErrorHandling.h
"
17
#include "
llvm/Support/ManagedStatic.h
"
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) {
27
case
instrprof_error::success
:
28
return
"Success"
;
29
case
instrprof_error::eof
:
30
return
"End of File"
;
31
case
instrprof_error::bad_magic
:
32
return
"Invalid profile data (bad magic)"
;
33
case
instrprof_error::bad_header
:
34
return
"Invalid profile data (file header is corrupt)"
;
35
case
instrprof_error::unsupported_version
:
36
return
"Unsupported profiling format version"
;
37
case
instrprof_error::unsupported_hash_type
:
38
return
"Unsupported profiling hash"
;
39
case
instrprof_error::too_large
:
40
return
"Too much profile data"
;
41
case
instrprof_error::truncated
:
42
return
"Truncated profile data"
;
43
case
instrprof_error::malformed
:
44
return
"Malformed profile data"
;
45
case
instrprof_error::unknown_function
:
46
return
"No profile data available for function"
;
47
case
instrprof_error::hash_mismatch
:
48
return
"Function hash mismatch"
;
49
case
instrprof_error::count_mismatch
:
50
return
"Function count mismatch"
;
51
case
instrprof_error::counter_overflow
:
52
return
"Counter overflow"
;
53
}
54
llvm_unreachable
(
"A value of instrprof_error has no message."
);
55
}
56
};
57
}
58
59
static
ManagedStatic<InstrProfErrorCategoryType>
ErrorCategory
;
60
61
const
std::error_category
&
llvm::instrprof_category
() {
62
return
*
ErrorCategory
;
63
}
llvm::coveragemap_error::truncated
llvm::ARM_PROC::IE
Definition:
ARMBaseInfo.h:91
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition:
ErrorHandling.h:98
llvm::instrprof_category
const std::error_category & instrprof_category()
Definition:
InstrProf.cpp:61
ErrorHandling.h
LLVM_NOEXCEPT
#define LLVM_NOEXCEPT
Definition:
Compiler.h:70
llvm::instrprof_error::bad_magic
ErrorCategory
static ManagedStatic< InstrProfErrorCategoryType > ErrorCategory
Definition:
InstrProf.cpp:59
ManagedStatic.h
InstrProf.h
llvm::instrprof_error::unsupported_hash_type
llvm::instrprof_error::too_large
error_category
static ManagedStatic< _object_error_category > error_category
Definition:
Object/Error.cpp:61
llvm::instrprof_error::success
llvm::coveragemap_error::unsupported_version
llvm::coveragemap_error::eof
llvm::instrprof_error::unknown_function
llvm::coveragemap_error::malformed
llvm::instrprof_error::hash_mismatch
llvm::instrprof_error
instrprof_error
Definition:
InstrProf.h:27
llvm::instrprof_error::count_mismatch
const
aarch64 promote const
Definition:
AArch64PromoteConstant.cpp:213
name
static const char * name
Definition:
PPCLoopPreIncPrep.cpp:93
llvm::ManagedStatic
ManagedStatic - This transparently changes the behavior of global statics to be lazily constructed on...
Definition:
ManagedStatic.h:61
llvm::instrprof_error::counter_overflow
llvm::instrprof_error::bad_header
Generated on Mon Aug 31 2015 11:01:41 for LLVM by
1.8.6