Index: src/IceConverter.cpp |
diff --git a/src/IceConverter.cpp b/src/IceConverter.cpp |
index df64cff9ab92db0510b3630fac16f60a81c98cea..42dec12f05149723e3f528845bead218fd7b7e4d 100644 |
--- a/src/IceConverter.cpp |
+++ b/src/IceConverter.cpp |
@@ -61,13 +61,13 @@ public: |
Ice::Cfg *convertFunction(const Function *F) { |
static Ice::TimerIdT IDllvmConvert = |
Ice::GlobalContext::getTimerID("llvmConvert"); |
- Ice::TimerMarker T(IDllvmConvert, Ctx); |
VarMap.clear(); |
NodeMap.clear(); |
Func = new Ice::Cfg(Ctx); |
Func->setFunctionName(F->getName()); |
Func->setReturnType(convertToIceType(F->getReturnType())); |
Func->setInternal(F->hasInternalLinkage()); |
+ Ice::TimerMarker T(IDllvmConvert, Func); |
// The initial definition/use of each arg is the entry node. |
for (auto ArgI = F->arg_begin(), ArgE = F->arg_end(); ArgI != ArgE; |
@@ -626,13 +626,18 @@ void Converter::convertToIce() { |
} |
void Converter::convertFunctions() { |
+ TimerStackIdT StackID = GlobalContext::TSK_Funcs; |
for (const Function &I : *Mod) { |
if (I.empty()) |
continue; |
+ if (Ctx->getFlags().TimeEachFunction) |
+ Ctx->pushTimer(GlobalContext::getTimerID(I.getName()), StackID); |
LLVM2ICEConverter FunctionConverter(Ctx, Mod->getContext()); |
Cfg *Fcn = FunctionConverter.convertFunction(&I); |
translateFcn(Fcn); |
+ if (Ctx->getFlags().TimeEachFunction) |
+ Ctx->popTimer(GlobalContext::getTimerID(I.getName()), StackID); |
} |
emitConstants(); |