clang  9.0.0svn
EditsReceiver.h
Go to the documentation of this file.
1 //===- EditedSource.h - Collection of source edits --------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_CLANG_EDIT_EDITSRECEIVER_H
10 #define LLVM_CLANG_EDIT_EDITSRECEIVER_H
11 
12 #include "clang/Basic/LLVM.h"
14 #include "llvm/ADT/StringRef.h"
15 
16 namespace clang {
17 namespace edit {
18 
20 public:
21  virtual ~EditsReceiver() = default;
22 
23  virtual void insert(SourceLocation loc, StringRef text) = 0;
24  virtual void replace(CharSourceRange range, StringRef text) = 0;
25 
26  /// By default it calls replace with an empty string.
27  virtual void remove(CharSourceRange range);
28 };
29 
30 } // namespace edit
31 } // namespace clang
32 
33 #endif // LLVM_CLANG_EDIT_EDITSRECEIVER_H
RangeSelector range(RangeSelector Begin, RangeSelector End)
Selects from the start of Begin and to the end of End.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
Represents a character-granular source range.
virtual void replace(CharSourceRange range, StringRef text)=0
virtual ~EditsReceiver()=default
Encodes a location in the source.
Dataflow Directional Tag Classes.
Defines the clang::SourceLocation class and associated facilities.
virtual void insert(SourceLocation loc, StringRef text)=0