[PATCH] D11372: Add 'const' to a few more functions in MachineFrameInfo

Krzysztof Parzyszek kparzysz at codeaurora.org
Mon Jul 20 15:00:06 PDT 2015


kparzysz created this revision.
kparzysz added a reviewer: echristo.
kparzysz added a subscriber: llvm-commits.
kparzysz set the repository for this revision to rL LLVM.

A few "get" functions were not marked as "const".  There is no obvious reason for that.

Repository:
  rL LLVM

http://reviews.llvm.org/D11372

Files:
  include/llvm/CodeGen/MachineFrameInfo.h

Index: include/llvm/CodeGen/MachineFrameInfo.h
===================================================================
--- include/llvm/CodeGen/MachineFrameInfo.h
+++ include/llvm/CodeGen/MachineFrameInfo.h
@@ -337,14 +337,14 @@
   }
 
   /// Get the local offset mapping for a for an object.
-  std::pair<int, int64_t> getLocalFrameObjectMap(int i) {
+  std::pair<int, int64_t> getLocalFrameObjectMap(int i) const {
     assert (i >= 0 && (unsigned)i < LocalFrameObjects.size() &&
             "Invalid local object reference!");
     return LocalFrameObjects[i];
   }
 
   /// Return the number of objects allocated into the local object block.
-  int64_t getLocalFrameObjectCount() { return LocalFrameObjects.size(); }
+  int64_t getLocalFrameObjectCount() const { return LocalFrameObjects.size(); }
 
   /// Set the size of the local object blob.
   void setLocalFrameSize(int64_t sz) { LocalFrameSize = sz; }
@@ -361,7 +361,9 @@
 
   /// Get whether the local allocation blob should be allocated together or
   /// let PEI allocate the locals in it directly.
-  bool getUseLocalStackAllocationBlock() {return UseLocalStackAllocationBlock;}
+  bool getUseLocalStackAllocationBlock() const {
+    return UseLocalStackAllocationBlock;
+  }
 
   /// setUseLocalStackAllocationBlock - Set whether the local allocation blob
   /// should be allocated together or let PEI allocate the locals in it


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11372.30197.patch
Type: text/x-patch
Size: 1392 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150720/f24271f6/attachment.bin>


More information about the llvm-commits mailing list