<div dir="ltr">thanks! </div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Aug 10, 2013 at 12:53 AM, Jakub Staszak <span dir="ltr"><<a href="mailto:kubastaszak@gmail.com" target="_blank">kubastaszak@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: kuba<br>
Date: Fri Aug  9 15:53:48 2013<br>
New Revision: 188103<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=188103&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=188103&view=rev</a><br>
Log:<br>
Mark obviously const methods. Also use reference for parameters when possible.<br>
<br>
Modified:<br>
    llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp<br>
<br>
Modified: llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp?rev=188103&r1=188102&r2=188103&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp?rev=188103&r1=188102&r2=188103&view=diff</a><br>

==============================================================================<br>
--- llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp (original)<br>
+++ llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp Fri Aug  9 15:53:48 2013<br>
@@ -488,7 +488,7 @@ struct FunctionStackPoisoner : public In<br>
   void initializeCallbacks(Module &M);<br>
<br>
   // Check if we want (and can) handle this alloca.<br>
-  bool isInterestingAlloca(AllocaInst &AI) {<br>
+  bool isInterestingAlloca(AllocaInst &AI) const {<br>
     return (!AI.isArrayAllocation() &&<br>
             AI.isStaticAlloca() &&<br>
             AI.getAlignment() <= RedzoneSize() &&<br>
@@ -498,24 +498,24 @@ struct FunctionStackPoisoner : public In<br>
   size_t RedzoneSize() const {<br>
     return RedzoneSizeForScale(Mapping.Scale);<br>
   }<br>
-  uint64_t getAllocaSizeInBytes(AllocaInst *AI) {<br>
+  uint64_t getAllocaSizeInBytes(AllocaInst *AI) const {<br>
     Type *Ty = AI->getAllocatedType();<br>
     uint64_t SizeInBytes = ASan.TD->getTypeAllocSize(Ty);<br>
     return SizeInBytes;<br>
   }<br>
-  uint64_t getAlignedSize(uint64_t SizeInBytes) {<br>
+  uint64_t getAlignedSize(uint64_t SizeInBytes) const {<br>
     size_t RZ = RedzoneSize();<br>
     return ((SizeInBytes + RZ - 1) / RZ) * RZ;<br>
   }<br>
-  uint64_t getAlignedAllocaSize(AllocaInst *AI) {<br>
+  uint64_t getAlignedAllocaSize(AllocaInst *AI) const {<br>
     uint64_t SizeInBytes = getAllocaSizeInBytes(AI);<br>
     return getAlignedSize(SizeInBytes);<br>
   }<br>
   /// Finds alloca where the value comes from.<br>
   AllocaInst *findAllocaForValue(Value *V);<br>
-  void poisonRedZones(const ArrayRef<AllocaInst*> &AllocaVec, IRBuilder<> IRB,<br>
+  void poisonRedZones(const ArrayRef<AllocaInst*> &AllocaVec, IRBuilder<> &IRB,<br>
                       Value *ShadowBase, bool DoPoison);<br>
-  void poisonAlloca(Value *V, uint64_t Size, IRBuilder<> IRB, bool DoPoison);<br>
+  void poisonAlloca(Value *V, uint64_t Size, IRBuilder<> &IRB, bool DoPoison);<br>
 };<br>
<br>
 }  // namespace<br>
@@ -1283,7 +1283,7 @@ void FunctionStackPoisoner::initializeCa<br>
 }<br>
<br>
 void FunctionStackPoisoner::poisonRedZones(<br>
-  const ArrayRef<AllocaInst*> &AllocaVec, IRBuilder<> IRB, Value *ShadowBase,<br>
+  const ArrayRef<AllocaInst*> &AllocaVec, IRBuilder<> &IRB, Value *ShadowBase,<br>
   bool DoPoison) {<br>
   size_t ShadowRZSize = RedzoneSize() >> Mapping.Scale;<br>
   assert(ShadowRZSize >= 1 && ShadowRZSize <= 4);<br>
@@ -1460,7 +1460,7 @@ void FunctionStackPoisoner::poisonStack(<br>
 }<br>
<br>
 void FunctionStackPoisoner::poisonAlloca(Value *V, uint64_t Size,<br>
-                                         IRBuilder<> IRB, bool DoPoison) {<br>
+                                         IRBuilder<> &IRB, bool DoPoison) {<br>
   // For now just insert the call to ASan runtime.<br>
   Value *AddrArg = IRB.CreatePointerCast(V, IntptrTy);<br>
   Value *SizeArg = ConstantInt::get(IntptrTy, Size);<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>