mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-12-19 11:23:32 +00:00
Give NamedRegionTimer an Enabled flag, allowing all its clients to
switch from this:
if (TimePassesIsEnabled) {
NamedRegionTimer T(Name, GroupName);
do_something();
} else {
do_something(); // duplicate the code, this time without a timer!
}
to this:
{
NamedRegionTimer T(Name, GroupName, TimePassesIsEnabled);
do_something();
}
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106285 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -150,8 +150,10 @@ public:
|
||||
/// is primarily used for debugging and for hunting performance problems.
|
||||
///
|
||||
struct NamedRegionTimer : public TimeRegion {
|
||||
explicit NamedRegionTimer(StringRef Name);
|
||||
explicit NamedRegionTimer(StringRef Name, StringRef GroupName);
|
||||
explicit NamedRegionTimer(StringRef Name,
|
||||
bool Enabled = true);
|
||||
explicit NamedRegionTimer(StringRef Name, StringRef GroupName,
|
||||
bool Enabled = true);
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user