aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2012-02-14 00:52:07 +0000
committerKostya Serebryany <kcc@google.com>2012-02-14 00:52:07 +0000
commit3eccaa6625a8032bee6b84706cb46ed8eb915acf (patch)
tree0b670285cd6482b2e7efe40bf779bc9e047d8098
parent1a4cb1caf0be953e5d7b201aca4ad54579751020 (diff)
downloadexternal_llvm-3eccaa6625a8032bee6b84706cb46ed8eb915acf.zip
external_llvm-3eccaa6625a8032bee6b84706cb46ed8eb915acf.tar.gz
external_llvm-3eccaa6625a8032bee6b84706cb46ed8eb915acf.tar.bz2
[tsan] fix compiler warnings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150449 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/Instrumentation/ThreadSanitizer.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Transforms/Instrumentation/ThreadSanitizer.cpp b/lib/Transforms/Instrumentation/ThreadSanitizer.cpp
index ab88d1c..d822535 100644
--- a/lib/Transforms/Instrumentation/ThreadSanitizer.cpp
+++ b/lib/Transforms/Instrumentation/ThreadSanitizer.cpp
@@ -52,7 +52,7 @@ struct ThreadSanitizer : public FunctionPass {
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 @@ bool ThreadSanitizer::doInitialization(Module &M) {
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 @@ bool ThreadSanitizer::instrumentLoadOrStore(Instruction *I) {
// 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()));