[clang] 0bf5845 - [Tooling/Inclusions] ensure the Mapping is inititalized in
Haojian Wu via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 3 07:10:21 PST 2023
Author: Haojian Wu
Date: 2023-02-03T16:10:05+01:00
New Revision: 0bf58458d31e238b4ae850e2a0d934190c6682cc
URL: https://github.com/llvm/llvm-project/commit/0bf58458d31e238b4ae850e2a0d934190c6682cc
DIFF: https://github.com/llvm/llvm-project/commit/0bf58458d31e238b4ae850e2a0d934190c6682cc.diff
LOG: [Tooling/Inclusions] ensure the Mapping is inititalized in
Symbol/Header::all() calls
Added:
Modified:
clang/lib/Tooling/Inclusions/Stdlib/StandardLibrary.cpp
Removed:
################################################################################
diff --git a/clang/lib/Tooling/Inclusions/Stdlib/StandardLibrary.cpp b/clang/lib/Tooling/Inclusions/Stdlib/StandardLibrary.cpp
index cc084c4d5689..9d06657df18a 100644
--- a/clang/lib/Tooling/Inclusions/Stdlib/StandardLibrary.cpp
+++ b/clang/lib/Tooling/Inclusions/Stdlib/StandardLibrary.cpp
@@ -93,6 +93,7 @@ static void ensureInitialized() {
}
std::vector<Header> Header::all() {
+ ensureInitialized();
std::vector<Header> Result;
Result.reserve(HeaderIDs->size());
for (unsigned I = 0, E = HeaderIDs->size(); I < E; ++I)
@@ -109,6 +110,7 @@ std::optional<Header> Header::named(llvm::StringRef Name) {
llvm::StringRef Header::name() const { return HeaderNames[ID]; }
std::vector<Symbol> Symbol::all() {
+ ensureInitialized();
std::vector<Symbol> Result;
Result.reserve(SymbolCount);
for (unsigned I = 0, E = SymbolCount; I < E; ++I)
More information about the cfe-commits
mailing list