[llvm-commits] [llvm] r150449 - /llvm/trunk/lib/Transforms/Instrumentation/ThreadSanitizer.cpp
Kostya Serebryany
kcc at google.com
Mon Feb 13 16:52:07 PST 2012
Author: kcc
Date: Mon Feb 13 18:52:07 2012
New Revision: 150449
URL: http://llvm.org/viewvc/llvm-project?rev=150449&view=rev
Log:
[tsan] fix compiler warnings
Modified:
llvm/trunk/lib/Transforms/Instrumentation/ThreadSanitizer.cpp
Modified: llvm/trunk/lib/Transforms/Instrumentation/ThreadSanitizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/ThreadSanitizer.cpp?rev=150449&r1=150448&r2=150449&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/ThreadSanitizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/ThreadSanitizer.cpp Mon Feb 13 18:52:07 2012
@@ -52,7 +52,7 @@
Value *TsanFuncEntry;
Value *TsanFuncExit;
// Accesses sizes are powers of two: 1, 2, 4, 8, 16.
- static const int kNumberOfAccessSizes = 5;
+ static const size_t kNumberOfAccessSizes = 5;
Value *TsanRead[kNumberOfAccessSizes];
Value *TsanWrite[kNumberOfAccessSizes];
};
@@ -87,7 +87,7 @@
IRB.getInt8PtrTy(), NULL);
TsanFuncExit = M.getOrInsertFunction("__tsan_func_exit", IRB.getVoidTy(),
NULL);
- for (int i = 0; i < kNumberOfAccessSizes; ++i) {
+ for (size_t i = 0; i < kNumberOfAccessSizes; ++i) {
SmallString<32> ReadName("__tsan_read");
ReadName += itostr(1 << i);
TsanRead[i] = M.getOrInsertFunction(ReadName, IRB.getVoidTy(),
@@ -161,7 +161,7 @@
// Ignore all unusual sizes.
return false;
}
- uint32_t Idx = CountTrailingZeros_32(TypeSize / 8);
+ size_t Idx = CountTrailingZeros_32(TypeSize / 8);
assert(Idx < kNumberOfAccessSizes);
Value *OnAccessFunc = IsWrite ? TsanWrite[Idx] : TsanRead[Idx];
IRB.CreateCall(OnAccessFunc, IRB.CreatePointerCast(Addr, IRB.getInt8PtrTy()));
More information about the llvm-commits
mailing list