[lib/Fuzzer] don't record traces when trace collection is off

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237067 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Kostya Serebryany 2015-05-11 23:25:28 +00:00
parent 6eb095d7ae
commit 66c6a4c240

View File

@ -191,6 +191,7 @@ class TraceState {
size_t DataSize); size_t DataSize);
void StartTraceRecording() { void StartTraceRecording() {
if (!Options.UseTraces) return;
RecordingTraces = true; RecordingTraces = true;
Mutations.clear(); Mutations.clear();
} }
@ -294,7 +295,7 @@ int TraceState::TryToAddDesiredData(uint64_t PresentData, uint64_t DesiredData,
void TraceState::TraceCmpCallback(size_t CmpSize, size_t CmpType, uint64_t Arg1, void TraceState::TraceCmpCallback(size_t CmpSize, size_t CmpType, uint64_t Arg1,
uint64_t Arg2) { uint64_t Arg2) {
if (!Options.UseTraces) return; if (!RecordingTraces) return;
int Added = 0; int Added = 0;
if (Options.Verbosity >= 3) if (Options.Verbosity >= 3)
std::cerr << "TraceCmp: " << Arg1 << " " << Arg2 << "\n"; std::cerr << "TraceCmp: " << Arg1 << " " << Arg2 << "\n";