Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,9 @@ class ASTReader
/// files.
llvm::DenseSet<LoadedMacroInfo> LoadedUndefs;

/// \Token literal data loaded and owned by us.
std::vector<std::string *> TokenLiteralDataLoaded;

/// A vector containing submodules that have already been loaded.
///
/// This vector is indexed by the Submodule ID (-1). NULL submodule entries
Expand Down
11 changes: 11 additions & 0 deletions interpreter/llvm-project/clang/lib/Serialization/ASTReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2135,6 +2135,14 @@ Token ASTReader::ReadToken(ModuleFile &M, const RecordDataImpl &Record,
if (IdentifierInfo *II = getLocalIdentifier(M, Record[Idx++]))
Tok.setIdentifierInfo(II);
}

if (Tok.isLiteral()) {
const RecordData& RD = reinterpret_cast<const RecordData&>(Record);
std::string* Lit = new std::string(ReadString(RD, Idx));
TokenLiteralDataLoaded.push_back(Lit);
Tok.setLiteralData(Lit->c_str());
}

return Tok;
}

Expand Down Expand Up @@ -11268,6 +11276,9 @@ ASTReader::ASTReader(Preprocessor &PP, ModuleCache &ModCache,
ASTReader::~ASTReader() {
if (OwnsDeserializationListener)
delete DeserializationListener;
for (auto PStr: TokenLiteralDataLoaded) {
delete PStr;
}
}

IdentifierResolver &ASTReader::getIdResolver() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5322,6 +5322,9 @@ void ASTWriter::AddToken(const Token &Tok, RecordDataImpl &Record) {
// is needed.
AddIdentifierRef(Tok.getIdentifierInfo(), Record);
}

if (Tok.isLiteral())
AddString(StringRef(Tok.getLiteralData(), Tok.getLength()), Record);
}

void ASTWriter::AddString(StringRef Str, RecordDataImpl &Record) {
Expand Down
2 changes: 1 addition & 1 deletion interpreter/llvm-project/llvm-project.tag
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ROOT-llvm22-20260827-01
ROOT-llvm22-20260902-01
Loading