forked from OSchip/llvm-project
[libFuzzer] inline the code of __sanitizer_cov_trace_pc_guard into it
llvm-svn: 298032
This commit is contained in:
parent
f7e610eda1
commit
7acabdc497
|
@ -45,13 +45,6 @@ uintptr_t *TracePC::PCs() const {
|
|||
return __sancov_trace_pc_pcs;
|
||||
}
|
||||
|
||||
ATTRIBUTE_NO_SANITIZE_ALL
|
||||
void TracePC::HandleTrace(uint32_t *Guard, uintptr_t PC) {
|
||||
uint32_t Idx = *Guard;
|
||||
__sancov_trace_pc_pcs[Idx] = PC;
|
||||
__sancov_trace_pc_guard_8bit_counters[Idx]++;
|
||||
}
|
||||
|
||||
size_t TracePC::GetTotalPCCoverage() {
|
||||
size_t Res = 0;
|
||||
for (size_t i = 1, N = GetNumPCs(); i < N; i++)
|
||||
|
@ -289,7 +282,9 @@ ATTRIBUTE_INTERFACE
|
|||
ATTRIBUTE_NO_SANITIZE_ALL
|
||||
void __sanitizer_cov_trace_pc_guard(uint32_t *Guard) {
|
||||
uintptr_t PC = reinterpret_cast<uintptr_t>(__builtin_return_address(0));
|
||||
fuzzer::TPC.HandleTrace(Guard, PC);
|
||||
uint32_t Idx = *Guard;
|
||||
__sancov_trace_pc_pcs[Idx] = PC;
|
||||
__sancov_trace_pc_guard_8bit_counters[Idx]++;
|
||||
}
|
||||
|
||||
ATTRIBUTE_INTERFACE
|
||||
|
|
|
@ -49,7 +49,6 @@ class TracePC {
|
|||
public:
|
||||
static const size_t kNumPCs = 1 << 21;
|
||||
|
||||
void HandleTrace(uint32_t *guard, uintptr_t PC);
|
||||
void HandleInit(uint32_t *start, uint32_t *stop);
|
||||
void HandleCallerCallee(uintptr_t Caller, uintptr_t Callee);
|
||||
template <class T> void HandleCmp(uintptr_t PC, T Arg1, T Arg2);
|
||||
|
|
Loading…
Reference in New Issue