Use back() instead of [size()-1].
[oota-llvm.git] / lib / ExecutionEngine / JIT / JITDwarfEmitter.cpp
index b73b0bd76c322b89262a542eb4e554414836123c..7f015369d56b460d2541b8fc8075baf2ae31d7bd 100644 (file)
@@ -172,6 +172,8 @@ static bool PadLT(const LandingPadInfo *L, const LandingPadInfo *R) {
   return LSize < RSize;
 }
 
+namespace {
+
 struct KeyInfo {
   static inline unsigned getEmptyKey() { return -1U; }
   static inline unsigned getTombstoneKey() { return -2U; }
@@ -205,6 +207,8 @@ struct CallSiteEntry {
   unsigned Action;
 };
 
+}
+
 unsigned char* JITDwarfEmitter::EmitExceptionTable(MachineFunction* MF,
                                          unsigned char* StartFunction,
                                          unsigned char* EndFunction) const {
@@ -360,7 +364,7 @@ unsigned char* JITDwarfEmitter::EmitExceptionTable(MachineFunction* MF,
 
       // Try to merge with the previous call-site.
       if (CallSites.size()) {
-        CallSiteEntry &Prev = CallSites[CallSites.size()-1];
+        CallSiteEntry &Prev = CallSites.back();
         if (Site.PadLabel == Prev.PadLabel && Site.Action == Prev.Action) {
           // Extend the range of the previous entry.
           Prev.EndLabel = Site.EndLabel;
@@ -975,7 +979,7 @@ JITDwarfEmitter::GetExceptionTableSizeInBytes(MachineFunction* MF) const {
 
       // Try to merge with the previous call-site.
       if (CallSites.size()) {
-        CallSiteEntry &Prev = CallSites[CallSites.size()-1];
+        CallSiteEntry &Prev = CallSites.back();
         if (Site.PadLabel == Prev.PadLabel && Site.Action == Prev.Action) {
           // Extend the range of the previous entry.
           Prev.EndLabel = Site.EndLabel;