#include "llvm/IR/PassTimingInfo.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/IR/PassInstrumentation.h"
#include "llvm/Pass.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/Mutex.h"
#include "llvm/Support/TypeName.h"
#include "llvm/Support/raw_ostream.h"
#include <string>
usingnamespacellvm;
#define DEBUG_TYPE …
namespace llvm {
bool TimePassesIsEnabled = …;
bool TimePassesPerRun = …;
static cl::opt<bool, true> EnableTiming(
"time-passes", cl::location(TimePassesIsEnabled), cl::Hidden,
cl::desc("Time each pass, printing elapsed time for each on exit"));
static cl::opt<bool, true> EnableTimingPerRun(
"time-passes-per-run", cl::location(TimePassesPerRun), cl::Hidden,
cl::desc("Time each pass run, printing elapsed time for each run on exit"),
cl::callback([](const bool &) { … }));
namespace {
namespace legacy {
class PassTimingInfo { … };
static ManagedStatic<sys::SmartMutex<true>> TimingInfoMutex;
PassTimingInfo::PassTimingInfo() : … { … }
PassTimingInfo::~PassTimingInfo() { … }
void PassTimingInfo::init() { … }
void PassTimingInfo::print(raw_ostream *OutStream) { … }
Timer *PassTimingInfo::newPassTimer(StringRef PassID, StringRef PassDesc) { … }
Timer *PassTimingInfo::getPassTimer(Pass *P, PassInstanceID Pass) { … }
PassTimingInfo *PassTimingInfo::TheTimeInfo;
}
}
Timer *getPassTimer(Pass *P) { … }
void reportAndResetTimings(raw_ostream *OutStream) { … }
Timer &TimePassesHandler::getPassTimer(StringRef PassID, bool IsPass) { … }
TimePassesHandler::TimePassesHandler(bool Enabled, bool PerRun)
: … { … }
TimePassesHandler::TimePassesHandler()
: … { … }
void TimePassesHandler::setOutStream(raw_ostream &Out) { … }
void TimePassesHandler::print() { … }
LLVM_DUMP_METHOD void TimePassesHandler::dump() const { … }
static bool shouldIgnorePass(StringRef PassID) { … }
void TimePassesHandler::startPassTimer(StringRef PassID) { … }
void TimePassesHandler::stopPassTimer(StringRef PassID) { … }
void TimePassesHandler::startAnalysisTimer(StringRef PassID) { … }
void TimePassesHandler::stopAnalysisTimer(StringRef PassID) { … }
void TimePassesHandler::registerCallbacks(PassInstrumentationCallbacks &PIC) { … }
}