本文整理汇总了C++中Pass::Reset方法的典型用法代码示例。如果您正苦于以下问题:C++ Pass::Reset方法的具体用法?C++ Pass::Reset怎么用?C++ Pass::Reset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pass
的用法示例。
在下文中一共展示了Pass::Reset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PassesCollect
void PhaseTracker::PassesCollect(std::vector<Pass>& passes) const
{
unsigned long totalTime = mTimer.elapsedUsecs();
if (mPhases.size() > 0)
{
Pass pass;
for (size_t i = 0; i < mPhases.size(); i++)
{
unsigned long start = mPhases[i]->mStartTime;
unsigned long elapsed = 0;
// Check if it's time to push an completed pass
if (i > 0 && mPhases[i]->mSubPhase == PhaseTracker::kPrimary)
{
passes.push_back(pass);
pass.Reset();
}
if (i < mPhases.size() - 1)
elapsed = mPhases[i + 1]->mStartTime - start;
else
elapsed = totalTime - start;
switch (mPhases[i]->mSubPhase)
{
case PhaseTracker::kPrimary:
pass.mName = mPhases[i]->mName;
pass.mPassId = mPhases[i]->mPassId;
pass.mIndex = (int) passes.size();
pass.mPrimary = elapsed;
break;
case PhaseTracker::kVerify:
pass.mVerify = elapsed;
break;
case PhaseTracker::kCleanAst:
pass.mCleanAst = elapsed;
break;
}
}
passes.push_back(pass);
}
}