mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Use inline constexpr where appropriate. (#6374)
This fixes various violations of C++'s One Definition Rule, where we accidentally gave the same static data member multiple definitions in different translation units. Clang happens to emit such definitions with weak linkage, which allows us to get away with this without link errors, but it's still formally incorrect. Also switch keyword order around for a handful of instances of `constexpr inline`, per agreement in open discussion. This happens to reduce the size of a `-c dbg` toolchain binary by 7.2 MiB, presumably by making more of our symbols and especially debug info discardable.
This commit is contained in:
@@ -637,7 +637,7 @@ class NodeStack {
|
||||
llvm::SmallVector<Entry> stack_;
|
||||
};
|
||||
|
||||
constexpr NodeStack::IdKindTableType NodeStack::IdKindTable =
|
||||
inline constexpr NodeStack::IdKindTableType NodeStack::IdKindTable =
|
||||
ComputeIdKindTable();
|
||||
|
||||
inline auto NodeStack::PopExprWithNodeId()
|
||||
|
||||
Reference in New Issue
Block a user