Add a timer to evaluate bytecode load time and space requirements

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4679 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2002-11-10 06:55:02 +00:00
parent 4f7815f684
commit 49d9a88428

View File

@ -16,6 +16,7 @@
#include "llvm/Assembly/Parser.h" #include "llvm/Assembly/Parser.h"
#include "llvm/Analysis/Verifier.h" #include "llvm/Analysis/Verifier.h"
#include "llvm/Support/PassNameParser.h" #include "llvm/Support/PassNameParser.h"
#include "Support/Timer.h"
#include <algorithm> #include <algorithm>
@ -101,11 +102,14 @@ static cl::list<const PassInfo*, bool,
AnalysesList(cl::desc("Analyses available:")); AnalysesList(cl::desc("Analyses available:"));
static Timer BytecodeLoadTimer("Bytecode Loader");
int main(int argc, char **argv) { int main(int argc, char **argv) {
cl::ParseCommandLineOptions(argc, argv, " llvm analysis printer tool\n"); cl::ParseCommandLineOptions(argc, argv, " llvm analysis printer tool\n");
Module *CurMod = 0; Module *CurMod = 0;
try { try {
TimeRegion RegionTimer(BytecodeLoadTimer);
CurMod = ParseBytecodeFile(InputFilename); CurMod = ParseBytecodeFile(InputFilename);
if (!CurMod && !(CurMod = ParseAssemblyFile(InputFilename))){ if (!CurMod && !(CurMod = ParseAssemblyFile(InputFilename))){
std::cerr << argv[0] << ": input file didn't read correctly.\n"; std::cerr << argv[0] << ": input file didn't read correctly.\n";