Skip to content

Commit c708ef1

Browse files
committed
Change callback return type and add Doxygen comment
Sets the `PreModuleImportCallback`'s setter return type to void to account for the lambda functions in LLDB's progress reporting not actually using its return value. Also adds a Doxygen comment for `SetPreModuleImportCallback`
1 parent 799eb1b commit c708ef1

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

include/swift/AST/ASTContext.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,8 @@ class ASTContext final {
294294
/// OutputBackend for writing outputs.
295295
llvm::IntrusiveRefCntPtr<llvm::vfs::OutputBackend> OutputBackend;
296296

297-
void SetPreModuleImportCallback(std::function<bool(llvm::StringRef ModuleName, bool IsOverlay)> callback);
297+
/// Set the callback function that is invoked before Swift module importing is performed
298+
void SetPreModuleImportCallback(std::function<void(llvm::StringRef ModuleName, bool IsOverlay)> callback);
298299

299300
/// If the shared pointer is not a \c nullptr and the pointee is \c true,
300301
/// all operations working on this ASTContext should be aborted at the next
@@ -406,7 +407,7 @@ class ASTContext final {
406407
getAllocator(AllocationArena arena = AllocationArena::Permanent) const;
407408

408409
/// An optional generic callback function invoked prior to importing a module.
409-
mutable std::function<bool(llvm::StringRef ModuleName, bool IsOverlay)>
410+
mutable std::function<void(llvm::StringRef ModuleName, bool IsOverlay)>
410411
PreModuleImportCallback;
411412

412413
public:

lib/AST/ASTContext.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -714,8 +714,8 @@ ASTContext::~ASTContext() {
714714
getImpl().~Implementation();
715715
}
716716

717-
void ASTContext::SetPreModuleImportCallback(std::function<bool(llvm::StringRef ModuleName, bool IsOverlay)> callback) {
718-
ASTContext::PreModuleImportCallback = callback;
717+
void ASTContext::SetPreModuleImportCallback(std::function<void(llvm::StringRef ModuleName, bool IsOverlay)> callback) {
718+
PreModuleImportCallback = callback;
719719
}
720720

721721
llvm::BumpPtrAllocator &ASTContext::getAllocator(AllocationArena arena) const {

0 commit comments

Comments
 (0)