summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-05-28 18:09:13 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-05-28 18:09:13 +0000
commit34683d10bf1bef61882101413a855c12062be24b (patch)
tree16145ae82dc80a6f86b6f6cb1bc0463ed5d5c6e4 /llvm
parent66f3c9ce158e28b26dc1b1ab02113010d2d08d9d (diff)
downloadbcm5719-llvm-34683d10bf1bef61882101413a855c12062be24b.tar.gz
bcm5719-llvm-34683d10bf1bef61882101413a855c12062be24b.zip
AsmPrinter: Suppress warnings on GCC from r238362, NFC
GCC seems to have some overzealous warnings about strict aliasing. Rafael reports that this patch suppresses them on GCC 4.9, and I'm hoping this will work for GCC 4.7 as well. I'll watch [1] and iterate if necessary. [1]: http://bb.pgr.jp/builders/clang-3stage-x86_64-linux/builds/8597 llvm-svn: 238447
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/CodeGen/DIE.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/include/llvm/CodeGen/DIE.h b/llvm/include/llvm/CodeGen/DIE.h
index c843f3fd1a6..e247d46ba5b 100644
--- a/llvm/include/llvm/CodeGen/DIE.h
+++ b/llvm/include/llvm/CodeGen/DIE.h
@@ -340,11 +340,11 @@ private:
new (reinterpret_cast<void *>(Val.buffer)) T(V);
}
- template <class T> T &get() { return *reinterpret_cast<T *>(Val.buffer); }
- template <class T> const T &get() const {
- return *reinterpret_cast<const T *>(Val.buffer);
+ template <class T> T *get() { return reinterpret_cast<T *>(Val.buffer); }
+ template <class T> const T *get() const {
+ return reinterpret_cast<const T *>(Val.buffer);
}
- template <class T> void destruct() { get<T>().~T(); }
+ template <class T> void destruct() { get<T>()->~T(); }
/// Destroy the underlying value.
///
@@ -378,11 +378,11 @@ private:
return;
#define HANDLE_DIEVALUE_SMALL(T) \
case is##T: \
- construct<DIE##T>(X.get<DIE##T>()); \
+ construct<DIE##T>(*X.get<DIE##T>()); \
return;
#define HANDLE_DIEVALUE_LARGE(T) \
case is##T: \
- construct<const DIE##T *>(X.get<const DIE##T *>()); \
+ construct<const DIE##T *>(*X.get<const DIE##T *>()); \
return;
#include "llvm/CodeGen/DIEValue.def"
}
@@ -425,12 +425,12 @@ public:
#define HANDLE_DIEVALUE_SMALL(T) \
const DIE##T &getDIE##T() const { \
assert(getType() == is##T && "Expected " #T); \
- return get<DIE##T>(); \
+ return *get<DIE##T>(); \
}
#define HANDLE_DIEVALUE_LARGE(T) \
const DIE##T &getDIE##T() const { \
assert(getType() == is##T && "Expected " #T); \
- return *get<const DIE##T *>(); \
+ return **get<const DIE##T *>(); \
}
#include "llvm/CodeGen/DIEValue.def"
OpenPOWER on IntegriCloud