Skip to content

Commit cc83e1d

Browse files
committed
256 -> 0
1 parent f1aa4d0 commit cc83e1d

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

clang/include/clang/Serialization/ASTReader.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,16 +1343,16 @@ class ASTReader
13431343
bool Complain = true);
13441344

13451345
/// Buffer we use as temporary storage backing resolved paths.
1346-
std::optional<SmallString<256>> PathBuf{{}};
1346+
std::optional<SmallString<0>> PathBuf;
13471347

13481348
/// A RAII wrapper around \c StringRef that temporarily takes ownership of the
13491349
/// underlying buffer and gives it back on destruction.
13501350
class TemporarilyOwnedStringRef {
13511351
StringRef String;
1352-
llvm::SaveAndRestore<std::optional<SmallString<256>>> TemporaryLoan;
1352+
llvm::SaveAndRestore<std::optional<SmallString<0>>> TemporaryLoan;
13531353

13541354
public:
1355-
TemporarilyOwnedStringRef(StringRef S, std::optional<SmallString<256>> &Buf)
1355+
TemporarilyOwnedStringRef(StringRef S, std::optional<SmallString<0>> &Buf)
13561356
: String(S), TemporaryLoan(Buf, {}) {}
13571357

13581358
/// Returns the wrapped \c StringRef that must be outlived by \c this.

clang/lib/Serialization/ASTReader.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10500,6 +10500,9 @@ ASTReader::ASTReader(Preprocessor &PP, InMemoryModuleCache &ModuleCache,
1050010500
UseGlobalIndex(UseGlobalIndex), CurrSwitchCaseStmts(&SwitchCaseStmts) {
1050110501
SourceMgr.setExternalSLocEntrySource(this);
1050210502

10503+
PathBuf.emplace();
10504+
PathBuf->reserve(256);
10505+
1050310506
for (const auto &Ext : Extensions) {
1050410507
auto BlockName = Ext->getExtensionMetadata().BlockName;
1050510508
auto Known = ModuleFileExtensions.find(BlockName);

0 commit comments

Comments
 (0)