Update for new FileNotFound callback

This commit is contained in:
Jonas Hahnfeld 2023-01-20 12:15:58 +01:00 committed by jenkins
parent 2c98e68e68
commit aa2213e121
3 changed files with 8 additions and 11 deletions

View File

@ -116,8 +116,7 @@ namespace cling {
clang::SourceLocation /*ImportLoc*/,
bool /*ForPragma*/) {}
virtual bool FileNotFound(llvm::StringRef FileName,
llvm::SmallVectorImpl<char>& RecoveryPath);
virtual bool FileNotFound(llvm::StringRef FileName);
/// \brief This callback is invoked whenever the interpreter needs to
/// resolve the type and the adress of an object, which has been marked for

View File

@ -57,12 +57,12 @@ namespace cling {
m_Callbacks->EnteredSubmodule(M, ImportLoc, ForPragma);
}
bool FileNotFound(llvm::StringRef FileName,
llvm::SmallVectorImpl<char>& RecoveryPath) override {
bool FileNotFound(llvm::StringRef FileName) override {
if (m_Callbacks)
return m_Callbacks->FileNotFound(FileName, RecoveryPath);
return m_Callbacks->FileNotFound(FileName);
// Returning true would mean that the preprocessor should try to recover.
// Returning true would mean that the preprocessor should silently skip
// this file.
return false;
}
};
@ -387,8 +387,7 @@ namespace cling {
return m_DeserializationListener.get();
}
bool InterpreterCallbacks::FileNotFound(llvm::StringRef,
llvm::SmallVectorImpl<char>&) {
bool InterpreterCallbacks::FileNotFound(llvm::StringRef) {
// Default implementation is no op.
return false;
}

View File

@ -48,11 +48,10 @@ namespace cling {
cb->EnteredSubmodule(M, ImportLoc, ForPragma);
}
bool FileNotFound(llvm::StringRef FileName,
llvm::SmallVectorImpl<char>& RecoveryPath) override {
bool FileNotFound(llvm::StringRef FileName) override {
bool result = false;
for (auto&& cb : m_Callbacks)
result = cb->FileNotFound(FileName, RecoveryPath) || result;
result = cb->FileNotFound(FileName) || result;
return result;
}