summaryrefslogtreecommitdiffstats
path: root/include/llvm/Support/ValueHandle.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-03 00:26:01 +0000
committerChris Lattner <sabre@nondot.org>2009-04-03 00:26:01 +0000
commitb7a00daa1165576dd2bb9d17970c249d536f4a82 (patch)
tree9ea76cf2d74afc2ff76b0aec9657b12d62e7cb00 /include/llvm/Support/ValueHandle.h
parent8f9643f0f768d5dcff0ffea1de6191dba1b5b083 (diff)
downloadexternal_llvm-b7a00daa1165576dd2bb9d17970c249d536f4a82.zip
external_llvm-b7a00daa1165576dd2bb9d17970c249d536f4a82.tar.gz
external_llvm-b7a00daa1165576dd2bb9d17970c249d536f4a82.tar.bz2
Work around an apparent GCC miscompilation by specializing different,
this fixes a regression on some compilers from r68147. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68356 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/ValueHandle.h')
-rw-r--r--include/llvm/Support/ValueHandle.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/llvm/Support/ValueHandle.h b/include/llvm/Support/ValueHandle.h
index 2771464..a668656 100644
--- a/include/llvm/Support/ValueHandle.h
+++ b/include/llvm/Support/ValueHandle.h
@@ -18,6 +18,18 @@
#include "llvm/Value.h"
namespace llvm {
+class ValueHandleBase;
+
+// ValueHandleBase** is only 4-byte aligned.
+template<>
+class PointerLikeTypeTraits<ValueHandleBase**> {
+public:
+ static inline void *getAsVoidPointer(ValueHandleBase** P) { return P; }
+ static inline ValueHandleBase **getFromVoidPointer(void *P) {
+ return static_cast<ValueHandleBase**>(P);
+ }
+ enum { NumLowBitsAvailable = 2 };
+};
/// ValueHandleBase - This is the common base class of value handles.
/// ValueHandle's are smart pointers to Value's that have special behavior when