aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/ADT/StringMap.h
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-05-05 18:30:58 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-05-05 18:30:58 +0000
commit34cd4a484e532cc463fd5a4bf59b88d13c5467c1 (patch)
treeeefdfb1d225da0317e7f7912079c430b5c3ed92c /include/llvm/ADT/StringMap.h
parentb61bfdb56e1c018f10a2c1c9fb49d7e2a78ed24e (diff)
downloadexternal_llvm-34cd4a484e532cc463fd5a4bf59b88d13c5467c1.tar.gz
external_llvm-34cd4a484e532cc463fd5a4bf59b88d13c5467c1.tar.bz2
external_llvm-34cd4a484e532cc463fd5a4bf59b88d13c5467c1.zip
Fix more -Wshorten-64-to-32 warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50659 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/StringMap.h')
-rw-r--r--include/llvm/ADT/StringMap.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/llvm/ADT/StringMap.h b/include/llvm/ADT/StringMap.h
index 27ea5d3ea1..869a87fdce 100644
--- a/include/llvm/ADT/StringMap.h
+++ b/include/llvm/ADT/StringMap.h
@@ -153,13 +153,14 @@ public:
static StringMapEntry *Create(const char *KeyStart, const char *KeyEnd,
AllocatorTy &Allocator,
InitType InitVal) {
- unsigned KeyLength = KeyEnd-KeyStart;
+ unsigned KeyLength = static_cast<unsigned>(KeyEnd-KeyStart);
// Okay, the item doesn't already exist, and 'Bucket' is the bucket to fill
// in. Allocate a new item with space for the string at the end and a null
// terminator.
- unsigned AllocSize = sizeof(StringMapEntry)+KeyLength+1;
+ unsigned AllocSize = static_cast<unsigned>(sizeof(StringMapEntry))+
+ KeyLength+1;
unsigned Alignment = alignof<StringMapEntry>();
StringMapEntry *NewItem =
@@ -236,9 +237,9 @@ class StringMap : public StringMapImpl {
AllocatorTy Allocator;
typedef StringMapEntry<ValueTy> MapEntryTy;
public:
- StringMap() : StringMapImpl(sizeof(MapEntryTy)) {}
+ StringMap() : StringMapImpl(static_cast<unsigned>(sizeof(MapEntryTy))) {}
explicit StringMap(unsigned InitialSize)
- : StringMapImpl(InitialSize, sizeof(MapEntryTy)) {}
+ : StringMapImpl(InitialSize, static_cast<unsigned>(sizeof(MapEntryTy))) {}
AllocatorTy &getAllocator() { return Allocator; }
const AllocatorTy &getAllocator() const { return Allocator; }