Update clang to r339409b.
Change-Id: Ied8a188bb072c40035320acedc86164b66d920af
diff --git a/linux-x64/clang/include/llvm/ADT/IntervalMap.h b/linux-x64/clang/include/llvm/ADT/IntervalMap.h
index f713668..b75c492 100644
--- a/linux-x64/clang/include/llvm/ADT/IntervalMap.h
+++ b/linux-x64/clang/include/llvm/ADT/IntervalMap.h
@@ -101,6 +101,7 @@
#include "llvm/ADT/PointerIntPair.h"
#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/bit.h"
#include "llvm/Support/AlignOf.h"
#include "llvm/Support/Allocator.h"
#include "llvm/Support/RecyclingAllocator.h"
@@ -963,6 +964,7 @@
private:
// The root data is either a RootLeaf or a RootBranchData instance.
+ LLVM_ALIGNAS(RootLeaf) LLVM_ALIGNAS(RootBranchData)
AlignedCharArrayUnion<RootLeaf, RootBranchData> data;
// Tree height.
@@ -977,15 +979,10 @@
// Allocator used for creating external nodes.
Allocator &allocator;
- /// dataAs - Represent data as a node type without breaking aliasing rules.
+ /// Represent data as a node type without breaking aliasing rules.
template <typename T>
T &dataAs() const {
- union {
- const char *d;
- T *t;
- } u;
- u.d = data.buffer;
- return *u.t;
+ return *bit_cast<T *>(const_cast<char *>(data.buffer));
}
const RootLeaf &rootLeaf() const {