Remove m_MemoryBuffers completely

This commit is contained in:
Devajith Valaparambil Sreeramaswamy 2024-04-23 17:35:01 +02:00 committed by jenkins
parent ab2f942c8e
commit 4f2c339d5c
2 changed files with 4 additions and 7 deletions

View File

@ -873,7 +873,8 @@ namespace cling {
PP.enableIncrementalProcessing();
smallstream source_name;
source_name << "input_line_" << (m_MemoryBuffers.size() + 1);
// FIXME: Pre-increment to avoid failing tests.
source_name << "input_line_" << ++InputCount;
// Create an uninitialized memory buffer, copy code in and append "\n"
size_t InputSize = input.size(); // don't include trailing 0
@ -891,8 +892,6 @@ namespace cling {
// candidates for example
SourceLocation NewLoc = getNextAvailableUniqueSourceLoc();
llvm::MemoryBuffer* MBNonOwn = MB.get();
// Create FileID for the current buffer.
FileID FID;
// Create FileEntry and FileID for the current buffer.
@ -909,8 +908,6 @@ namespace cling {
CO.CodeCompletionOffset+1/* 1-based column*/);
}
m_MemoryBuffers.push_back(std::make_pair(MBNonOwn, FID));
// NewLoc only used for diags.
PP.EnterSourceFile(FID, /*DirLookup*/nullptr, NewLoc);
m_Consumer->getTransaction()->setBufferFID(FID);

View File

@ -64,8 +64,8 @@ namespace cling {
// parser (incremental)
std::unique_ptr<clang::Parser> m_Parser;
// One buffer for each command line, owner by the source file manager
std::deque<std::pair<llvm::MemoryBuffer*, clang::FileID>> m_MemoryBuffers;
/// Counts the number of direct user input lines that have been parsed.
unsigned InputCount = 0;
// file ID of the memory buffer
clang::FileID m_VirtualFileID;