Use a reference instead of making an unnecessary copy. Also use 'const'.
authorBill Wendling <isanbard@gmail.com>
Thu, 15 Aug 2013 20:21:49 +0000 (20:21 +0000)
committerBill Wendling <isanbard@gmail.com>
Thu, 15 Aug 2013 20:21:49 +0000 (20:21 +0000)
llvm-svn: 188483

llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

index d8a20f800b9d835d33aa04e86e11b6e399591410..4d9497a96bdeb2cf8896e32c613af5dfacacdac2 100644 (file)
@@ -658,11 +658,11 @@ void AsmPrinter::emitPrologLabel(const MachineInstr &MI) {
     OutStreamer.EmitCompactUnwindEncoding(MMI->getCompactUnwindEncoding());
 
   MachineModuleInfo &MMI = MF->getMMI();
-  std::vector<MCCFIInstruction> Instructions = MMI.getFrameInstructions();
+  const std::vector<MCCFIInstruction> &Instrs = MMI.getFrameInstructions();
   bool FoundOne = false;
   (void)FoundOne;
-  for (std::vector<MCCFIInstruction>::iterator I = Instructions.begin(),
-         E = Instructions.end(); I != E; ++I) {
+  for (std::vector<MCCFIInstruction>::const_iterator I = Instrs.begin(),
+         E = Instrs.end(); I != E; ++I) {
     if (I->getLabel() == Label) {
       emitCFIInstruction(*I);
       FoundOne = true;