[llvm-mca] Use llvm::ArrayRef in class SourceMgr. NFCI
Class SourceMgr now uses type ArrayRef<MCInst> to reference the
sequence of code from a "CodeRegion".
llvm-svn: 344911
diff --git a/llvm/tools/llvm-mca/CodeRegion.cpp b/llvm/tools/llvm-mca/CodeRegion.cpp
index 8968659..c26658a 100644
--- a/llvm/tools/llvm-mca/CodeRegion.cpp
+++ b/llvm/tools/llvm-mca/CodeRegion.cpp
@@ -52,15 +52,15 @@
CurrentRegion.setEndLocation(Loc);
}
-void CodeRegions::addInstruction(std::unique_ptr<const MCInst> Instruction) {
- const SMLoc &Loc = Instruction->getLoc();
+void CodeRegions::addInstruction(const MCInst &Instruction) {
+ const SMLoc &Loc = Instruction.getLoc();
const auto It =
std::find_if(Regions.rbegin(), Regions.rend(),
[Loc](const std::unique_ptr<CodeRegion> &Region) {
return Region->isLocInRange(Loc);
});
if (It != Regions.rend())
- (*It)->addInstruction(std::move(Instruction));
+ (*It)->addInstruction(Instruction);
}
} // namespace mca