Skip to content

Commit

Permalink
[clangd] Remove unused+broken InvalidationError class.
Browse files Browse the repository at this point in the history
  • Loading branch information
sam-mccall committed Mar 5, 2020
1 parent ea086d1 commit e6d9b2c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 25 deletions.
10 changes: 0 additions & 10 deletions clang-tools-extra/clangd/TUScheduler.cpp
Expand Up @@ -1093,15 +1093,5 @@ DebouncePolicy DebouncePolicy::fixed(clock::duration T) {
return P;
}

void TUScheduler::InvalidatedError::log(llvm::raw_ostream &OS) const {
switch (Policy) {
case InvalidateOnUpdate:
OS << "Task was cancelled due to a subsequent change to the file.";
break;
case NoInvalidation:
llvm_unreachable("Invalidated for no reason?");
}
}

} // namespace clangd
} // namespace clang
17 changes: 2 additions & 15 deletions clang-tools-extra/clangd/TUScheduler.h
Expand Up @@ -230,27 +230,14 @@ class TUScheduler {
InvalidateOnUpdate,
};

/// Error to return when an ASTActionInvalidation policy fires.
class InvalidatedError : public llvm::ErrorInfo<InvalidatedError> {
public:
static char ID;
ASTActionInvalidation Policy;

void log(llvm::raw_ostream &OS) const override;
std::error_code convertToErrorCode() const override {
return std::make_error_code(std::errc::interrupted);
}
};

/// Schedule an async read of the AST. \p Action will be called when AST is
/// ready. The AST passed to \p Action refers to the version of \p File
/// tracked at the time of the call, even if new updates are received before
/// \p Action is executed.
/// If an error occurs during processing, it is forwarded to the \p Action
/// callback.
/// If the context is cancelled before the AST is ready, the callback will
/// receive a CancelledError. If the invalidation policy is triggered, the
/// callback will receive an InvalidatedError.
/// If the context is cancelled before the AST is ready, or the invalidation
/// policy is triggered, the callback will receive a CancelledError.
void runWithAST(llvm::StringRef Name, PathRef File,
Callback<InputsAndAST> Action,
ASTActionInvalidation = NoInvalidation);
Expand Down

0 comments on commit e6d9b2c

Please sign in to comment.