Use ArrayRef instead of a std::vector&.
authorBill Wendling <isanbard@gmail.com>
Thu, 7 Jul 2011 04:42:01 +0000 (04:42 +0000)
committerBill Wendling <isanbard@gmail.com>
Thu, 7 Jul 2011 04:42:01 +0000 (04:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134595 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Target/TargetFrameLowering.h
lib/Target/X86/X86FrameLowering.cpp
lib/Target/X86/X86FrameLowering.h

index 70cecbd37fb4366f6cd5a6969c9fe4f9ad1cecee..e3d77cf7625dcc89c42d17a29388216a910eba72 100644 (file)
@@ -14,8 +14,9 @@
 #ifndef LLVM_TARGET_TARGETFRAMELOWERING_H
 #define LLVM_TARGET_TARGETFRAMELOWERING_H
 
-#include "llvm/MC/MCDwarf.h"
 #include "llvm/CodeGen/MachineBasicBlock.h"
+#include "llvm/MC/MCDwarf.h"
+#include "llvm/ADT/ArrayRef.h"
 
 #include <utility>
 #include <vector>
@@ -193,9 +194,9 @@ public:
 
   /// getCompactUnwindEncoding - Get the compact unwind encoding for the
   /// function. Return 0 if the compact unwind isn't available.
-  virtual uint32_t getCompactUnwindEncoding(const std::vector<MCCFIInstruction>&,
-                                            int /*DataAlignmentFactor*/,
-                                            bool /*IsEH*/) const {
+  virtual uint32_t getCompactUnwindEncoding(ArrayRef<MCCFIInstruction> Instrs,
+                                            int DataAlignmentFactor,
+                                            bool IsEH) const {
     return 0;
   }
 };
index 08c381f13a37d31f66db3639ad3adb7545b65286..fb53e2734aaf671e4d86785cd0f6d504fad11a0b 100644 (file)
@@ -1032,7 +1032,7 @@ X86FrameLowering::processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
 }
 
 uint32_t X86FrameLowering::
-getCompactUnwindEncoding(const std::vector<MCCFIInstruction> &Instrs,
+getCompactUnwindEncoding(ArrayRef<MCCFIInstruction> Instrs,
                          int DataAlignmentFactor, bool IsEH) const {
   uint32_t Encoding = 0;
   int CFAOffset = 0;
@@ -1040,7 +1040,7 @@ getCompactUnwindEncoding(const std::vector<MCCFIInstruction> &Instrs,
   SmallVector<unsigned, 8> SavedRegs;
   int FramePointerReg = -1;
 
-  for (std::vector<MCCFIInstruction>::const_iterator
+  for (ArrayRef<MCCFIInstruction>::const_iterator
          I = Instrs.begin(), E = Instrs.end(); I != E; ++I) {
     const MCCFIInstruction &Inst = *I;
     MCSymbol *Label = Inst.getLabel();
index f2b8dab6a5a750c844b7d94931c596df2b785514..14c31ed47cf14a12b03f9a35bdd59f5e28dbd3ff 100644 (file)
@@ -60,7 +60,7 @@ public:
   void getInitialFrameState(std::vector<MachineMove> &Moves) const;
   int getFrameIndexOffset(const MachineFunction &MF, int FI) const;
 
-  uint32_t getCompactUnwindEncoding(const std::vector<MCCFIInstruction> &Instrs,
+  uint32_t getCompactUnwindEncoding(ArrayRef<MCCFIInstruction> Instrs,
                                     int DataAlignmentFactor, bool IsEH) const;
 };