aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-06-12 01:06:16 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-06-12 01:06:16 +0000
commit3e61374295693beb0a899af44ccf4b5085dffbf3 (patch)
tree2e204d9a4b6ff9550d347e43be541c3b29d5a46b /include/llvm
parent138c2b4e8a4480f4d956980b24c504c27e18cfc1 (diff)
downloadexternal_llvm-3e61374295693beb0a899af44ccf4b5085dffbf3.zip
external_llvm-3e61374295693beb0a899af44ccf4b5085dffbf3.tar.gz
external_llvm-3e61374295693beb0a899af44ccf4b5085dffbf3.tar.bz2
Satisfy C++ aliasing rules, per suggestion by Chandler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158346 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/Support/ThreadLocal.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/llvm/Support/ThreadLocal.h b/include/llvm/Support/ThreadLocal.h
index 1a0a00f..2957034 100644
--- a/include/llvm/Support/ThreadLocal.h
+++ b/include/llvm/Support/ThreadLocal.h
@@ -28,7 +28,12 @@ namespace llvm {
///
/// This is embedded in the class and we avoid malloc'ing/free'ing it,
/// to make this class more safe for use along with CrashRecoveryContext.
- ThreadLocalDataTy data;
+ union {
+ char data[sizeof(ThreadLocalDataTy)];
+ struct {
+ ThreadLocalDataTy align_data;
+ };
+ };
public:
ThreadLocalImpl();
virtual ~ThreadLocalImpl();