We don't assign counters for implicit Decls, but we were emitting code to increment the (non-existent) counters and adding empty counter lists in the output. This fixes the checks in assignRegionCounters and emitInstrumentationData to do the right thing, and adds an assert for the pathological case of emitting zero counters. llvm-svn: 207203
18 lines
455 B
C++
18 lines
455 B
C++
// Ensure that implicit methods aren't instrumented.
|
|
|
|
// RUN: %clang_cc1 -x c++ %s -triple %itanium_abi_triple -main-file-name cxx-implicit.cpp -o - -emit-llvm -fprofile-instr-generate | FileCheck %s
|
|
|
|
// An implicit constructor is generated for Base. We should not emit counters
|
|
// for it.
|
|
// CHECK-NOT: @__llvm_profile_counters__ZN4BaseC2Ev =
|
|
|
|
struct Base {
|
|
virtual void foo();
|
|
};
|
|
|
|
struct Derived : public Base {
|
|
Derived();
|
|
};
|
|
|
|
Derived::Derived() {}
|