aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/JSON.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2020-12-02 13:44:16 -0800
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2020-12-04 11:07:42 -0800
commit5b267fb7966157e0d79ea85cbc1d07f92f840d3c (patch)
treefe63b513de9acda298fac79f4195b0d498b513b0 /llvm/lib/Support/JSON.cpp
parentf9c3954a6ec5d1066a67aadab848f02b9b78b056 (diff)
downloadllvm-5b267fb7966157e0d79ea85cbc1d07f92f840d3c.zip
llvm-5b267fb7966157e0d79ea85cbc1d07f92f840d3c.tar.gz
llvm-5b267fb7966157e0d79ea85cbc1d07f92f840d3c.tar.bz2
ADT: Stop peeking inside AlignedCharArrayUnion, NFC
Update all the users of `AlignedCharArrayUnion` to stop peeking inside (to look at `buffer`) so that a follow-up patch can replace it with an alias to `std::aligned_union_t`. This was reviewed as part of https://reviews.llvm.org/D92512, but I'm splitting this bit out to commit first to reduce churn in case the change to `AlignedCharArrayUnion` needs to be reverted for some unexpected reason.
Diffstat (limited to 'llvm/lib/Support/JSON.cpp')
-rw-r--r--llvm/lib/Support/JSON.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Support/JSON.cpp b/llvm/lib/Support/JSON.cpp
index 8471e58..dbfd673 100644
--- a/llvm/lib/Support/JSON.cpp
+++ b/llvm/lib/Support/JSON.cpp
@@ -109,7 +109,7 @@ void Value::copyFrom(const Value &M) {
case T_Boolean:
case T_Double:
case T_Integer:
- memcpy(Union.buffer, M.Union.buffer, sizeof(Union.buffer));
+ memcpy(&Union, &M.Union, sizeof(Union));
break;
case T_StringRef:
create<StringRef>(M.as<StringRef>());
@@ -133,7 +133,7 @@ void Value::moveFrom(const Value &&M) {
case T_Boolean:
case T_Double:
case T_Integer:
- memcpy(Union.buffer, M.Union.buffer, sizeof(Union.buffer));
+ memcpy(&Union, &M.Union, sizeof(Union));
break;
case T_StringRef:
create<StringRef>(M.as<StringRef>());