llvm-project/clang/lib/Parse
Mikhail Maltsev 17f8c458de [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
2021-01-14 10:56:53 +00:00
..
CMakeLists.txt [openmp] Base of tablegen generated OpenMP common declaration 2020-06-23 10:32:32 -04:00
ParseAST.cpp [Support] Add TimeTraceScope constructor without detail arg 2019-12-11 14:32:21 +00:00
ParseCXXInlineMethods.cpp [NFC, Refactor] Modernize enum FunctionDefinitionKind (DeclSpech.h) into a scoped enum 2020-11-21 09:49:52 -06:00
ParseDecl.cpp [OpenCL] Add clang extension for function pointers. 2021-01-06 20:39:57 +00:00
ParseDeclCXX.cpp [clang] Use SourceLocations in unions [NFCI] 2021-01-14 10:56:53 +00:00
ParseExpr.cpp Print source location in the error message when parens are missing around sizeof typename and the expression is inside macro expansion 2020-12-16 12:03:31 -08:00
ParseExprCXX.cpp P0857R0: Parse a requires-clause after an explicit 2020-12-03 15:54:16 -08:00
ParseInit.cpp [clang][CodeComplete] Support for designated initializers 2020-01-28 16:34:15 +01:00
ParseObjc.cpp [NFC, Refactor] Rename the (scoped) enum DeclaratorContext's enumerators to remove duplication 2020-11-10 23:40:12 -06:00
ParseOpenMP.cpp Make LLVM build in C++20 mode 2020-12-17 10:44:10 +00:00
ParsePragma.cpp [Frontend] Add pragma align natural and sort out pragma pack stack effect 2021-01-13 10:53:24 -05:00
ParseStmt.cpp [NFC, Refactor] Rename the (scoped) enum DeclaratorContext's enumerators to remove duplication 2020-11-10 23:40:12 -06:00
ParseStmtAsm.cpp [Parser] ParseMicrosoftAsmStatement - Replace bit '|' operator with logical '||' operator. (PR47071) 2020-10-05 14:23:28 +01:00
ParseTemplate.cpp PR45699: Fix crash if an unexpanded parameter pack appears in a 2020-12-03 15:26:06 -08:00
ParseTentative.cpp [clang] Add a new nullability annotation for swift async: _Nullable_result 2020-12-07 17:19:20 -05:00
Parser.cpp [NFC, Refactor] Modernize enum FunctionDefinitionKind (DeclSpech.h) into a scoped enum 2020-11-21 09:49:52 -06:00