EditsReceiver.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- EditedSource.h - Collection of source edits --------------*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #ifndef LLVM_CLANG_EDIT_EDITSRECEIVER_H
  14. #define LLVM_CLANG_EDIT_EDITSRECEIVER_H
  15. #include "clang/Basic/LLVM.h"
  16. #include "clang/Basic/SourceLocation.h"
  17. #include "llvm/ADT/StringRef.h"
  18. namespace clang {
  19. namespace edit {
  20. class EditsReceiver {
  21. public:
  22. virtual ~EditsReceiver() = default;
  23. virtual void insert(SourceLocation loc, StringRef text) = 0;
  24. virtual void replace(CharSourceRange range, StringRef text) = 0;
  25. /// By default it calls replace with an empty string.
  26. virtual void remove(CharSourceRange range);
  27. };
  28. } // namespace edit
  29. } // namespace clang
  30. #endif // LLVM_CLANG_EDIT_EDITSRECEIVER_H
  31. #ifdef __GNUC__
  32. #pragma GCC diagnostic pop
  33. #endif