[llvm-mca] Simplify the logic in FetchStage. NFCI
Only method 'getNextInstruction()' needs to interact with the SourceMgr.
llvm-svn: 345185
diff --git a/llvm/tools/llvm-mca/lib/Pipeline.cpp b/llvm/tools/llvm-mca/lib/Pipeline.cpp
index 2d9aa6b..ad49522 100644
--- a/llvm/tools/llvm-mca/lib/Pipeline.cpp
+++ b/llvm/tools/llvm-mca/lib/Pipeline.cpp
@@ -39,13 +39,14 @@
Error Pipeline::run() {
assert(!Stages.empty() && "Unexpected empty pipeline found!");
- while (hasWorkToProcess()) {
+ do {
notifyCycleBegin();
if (Error Err = runCycle())
return Err;
notifyCycleEnd();
++Cycles;
- }
+ } while (hasWorkToProcess());
+
return ErrorSuccess();
}