clang 20.0.0git
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
16namespace clang {
17namespace edit {
18
20public:
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
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines the clang::SourceLocation class and associated facilities.
Represents a character-granular source range.
Encodes a location in the source.
virtual void insert(SourceLocation loc, StringRef text)=0
virtual void remove(CharSourceRange range)
By default it calls replace with an empty string.
virtual void replace(CharSourceRange range, StringRef text)=0
virtual ~EditsReceiver()=default
EditGenerator edit(ASTEdit E)
Generates a single (specified) edit.
Definition: RewriteRule.cpp:84
The JSON file list parser is used to communicate input to InstallAPI.