summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9e80837)
raw | patch | inline | side by side (parent: 9e80837)
author | Alexey Samsonov <vonosmas@gmail.com> | |
Thu, 4 Dec 2014 23:00:50 +0000 (23:00 +0000) | ||
committer | Alexey Samsonov <vonosmas@gmail.com> | |
Thu, 4 Dec 2014 23:00:50 +0000 (23:00 +0000) |
This reverts commit r223402. Some bots fail with -Winvalid-offsetof
warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223407 91177308-0d34-0410-b5e6-96231b3b80d8
warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223407 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ADT/StringMap.h | patch | blob | history |
index 06afe8426919b823f341fe81a688f627438a7cf6..2feb2ab0074d406a04fbd1c8bc92edcf56674352 100644 (file)
/// GetStringMapEntryFromValue - Given a value that is known to be embedded
/// into a StringMapEntry, return the StringMapEntry itself.
static StringMapEntry &GetStringMapEntryFromValue(ValueTy &V) {
- char *Ptr = reinterpret_cast<char *>(&V) - offsetof(StringMapEntry, second);
+ StringMapEntry *EPtr = 0;
+ char *Ptr = reinterpret_cast<char*>(&V) -
+ (reinterpret_cast<char*>(&EPtr->second) -
+ reinterpret_cast<char*>(EPtr));
return *reinterpret_cast<StringMapEntry*>(Ptr);
}
static const StringMapEntry &GetStringMapEntryFromValue(const ValueTy &V) {