mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Give the -time-passes tool option a global storage location so that its
value can be discovered by the various LLVM tools. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16032 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d0d0a1a08f
commit
1f079267dc
@ -332,6 +332,11 @@ private:
|
|||||||
virtual void addToPassManager(PassManagerT<BasicBlock> *PM,AnalysisUsage &AU);
|
virtual void addToPassManager(PassManagerT<BasicBlock> *PM,AnalysisUsage &AU);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// If the user specifies the -time-passes argument on an LLVM tool command line
|
||||||
|
/// then the value of this boolean will be true, otherwise false.
|
||||||
|
/// @brief This is the storage for the -time-passes option.
|
||||||
|
extern bool TimePassesIsEnabled;
|
||||||
|
|
||||||
} // End llvm namespace
|
} // End llvm namespace
|
||||||
|
|
||||||
// Include support files that contain important APIs commonly used by Passes,
|
// Include support files that contain important APIs commonly used by Passes,
|
||||||
|
@ -110,15 +110,16 @@ bool FunctionPassManager::run(Function &F) {
|
|||||||
// amount of time each pass takes to execute. This only happens with
|
// amount of time each pass takes to execute. This only happens with
|
||||||
// -time-passes is enabled on the command line.
|
// -time-passes is enabled on the command line.
|
||||||
//
|
//
|
||||||
static cl::opt<bool>
|
bool llvm::TimePassesIsEnabled = false;
|
||||||
EnableTiming("time-passes",
|
static cl::opt<bool,true>
|
||||||
|
EnableTiming("time-passes", cl::location(TimePassesIsEnabled),
|
||||||
cl::desc("Time each pass, printing elapsed time for each on exit"));
|
cl::desc("Time each pass, printing elapsed time for each on exit"));
|
||||||
|
|
||||||
// createTheTimeInfo - This method either initializes the TheTimeInfo pointer to
|
// createTheTimeInfo - This method either initializes the TheTimeInfo pointer to
|
||||||
// a non null value (if the -time-passes option is enabled) or it leaves it
|
// a non null value (if the -time-passes option is enabled) or it leaves it
|
||||||
// null. It may be called multiple times.
|
// null. It may be called multiple times.
|
||||||
void TimingInfo::createTheTimeInfo() {
|
void TimingInfo::createTheTimeInfo() {
|
||||||
if (!EnableTiming || TheTimeInfo) return;
|
if (!TimePassesIsEnabled || TheTimeInfo) return;
|
||||||
|
|
||||||
// Constructed the first time this is called, iff -time-passes is enabled.
|
// Constructed the first time this is called, iff -time-passes is enabled.
|
||||||
// This guarantees that the object will be constructed before static globals,
|
// This guarantees that the object will be constructed before static globals,
|
||||||
|
Loading…
Reference in New Issue
Block a user