aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorKrystian Stasiowski <sdkrystian@gmail.com>2024-07-15 13:57:56 -0400
committerGitHub <noreply@github.com>2024-07-15 13:57:56 -0400
commite6ec7c8f74d1be778f4ddf794d0e2fb63b0dc3be (patch)
treed4e341f33bd7961952e31173a1fb769fdf16d12d /clang/lib/CodeGen/CodeGenModule.cpp
parent290537238b45106e30bb082b9affde345d8a5482 (diff)
downloadllvm-e6ec7c8f74d1be778f4ddf794d0e2fb63b0dc3be.zip
llvm-e6ec7c8f74d1be778f4ddf794d0e2fb63b0dc3be.tar.gz
llvm-e6ec7c8f74d1be778f4ddf794d0e2fb63b0dc3be.tar.bz2
[Clang][AST] Move NamespaceDecl bits to DeclContext (#98567)
Currently, `NamespaceDecl` has a member `AnonOrFirstNamespaceAndFlags` which stores a few pieces of data: - a bit indicating whether the namespace was declared `inline`, and - a bit indicating whether the namespace was declared as a _nested-namespace-definition_, and - a pointer a `NamespaceDecl` that either stores: - a pointer to the first declaration of that namespace if the declaration is no the first declaration, or - a pointer to the unnamed namespace that inhabits the namespace otherwise. `Redeclarable` already stores a pointer to the first declaration of an entity, so it's unnecessary to store this in `NamespaceDecl`. `DeclContext` has 8 bytes in which various bitfields can be stored for a declaration, so it's not necessary to store these in `NamespaceDecl` either. We only need to store a pointer to the unnamed namespace that inhabits the first declaration of a namespace. This patch moves the two bits currently stored in `NamespaceDecl` to `DeclContext`, and only stores a pointer to the unnamed namespace that inhabits a namespace in the first declaration of that namespace. Since `getOriginalNamespace` always returns the same `NamespaceDecl` as `getFirstDecl`, this function is removed to avoid confusion.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions