HomePhabricator

[Support] Add an enable bit to our DebugCounters

Description

[Support] Add an enable bit to our DebugCounters

r337748 made us start incrementing DebugCounters all of the time. This
makes tsan unhappy in multithreaded environments.

Since it doesn't make much sense to use DebugCounters with multiple
threads, this patch makes us only count anything if the user passed a
-debug-counter option or if some other piece of code explicitly asks
for it (e.g. the pass in D50031).

The amount of global state here makes writing a unittest for this
behavior somewhat awkward. So, no test is provided.

Differential Revision: https://reviews.llvm.org/D50150

Details

Committed
gbivAug 2 2018, 12:50 PM
Differential Revision
D50150: Require users to opt into DebugCounting
Parents
rL338761: Add poster and link to slides/poster for "Measuring the User Debugging…
Branches
Unknown
Tags
Unknown