diff options
author | Mikhail Maltsev <mikhail.maltsev@arm.com> | 2021-01-14 10:56:53 +0000 |
---|---|---|
committer | Mikhail Maltsev <mikhail.maltsev@arm.com> | 2021-01-14 10:56:53 +0000 |
commit | 17f8c458de631c0311828931a5bdf72b1a13c29d (patch) | |
tree | 97f65ffa4b8812af168d8320460fea8aeee96395 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | d58512b2e31a255dccc2c9a351a4e47b2b4c9f79 (diff) | |
download | llvm-17f8c458de631c0311828931a5bdf72b1a13c29d.zip llvm-17f8c458de631c0311828931a5bdf72b1a13c29d.tar.gz llvm-17f8c458de631c0311828931a5bdf72b1a13c29d.tar.bz2 |
[clang] Use SourceLocations in unions [NFCI]
Currently, there are many instances where `SourceLocation` objects are
converted to raw representation to be stored in structs that are
used as fields of tagged unions.
This is done to make the corresponding structs trivial.
Triviality allows avoiding undefined behavior when implicitly changing
the active member of the union.
However, in most cases, we can explicitly construct an active member
using placement new. This patch adds the required active member
selections and replaces `SourceLocation`-s represented as
`unsigned int` with proper `SourceLocation`-s.
One notable exception is `DeclarationNameLoc`: the objects of this class
are often not properly initialized (so the code currently relies on
its default constructor which uses memset). This class will be fixed
in a separate patch.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D94237
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions