clang  16.0.0git
Rewrite.h
Go to the documentation of this file.
1 /*===-- clang-c/Rewrite.h - C CXRewriter --------------------------*- C -*-===*\
2 |* *|
3 |* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|
4 |* Exceptions. *|
5 |* See https://llvm.org/LICENSE.txt for license information. *|
6 |* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *|
7 |* *|
8 |*===----------------------------------------------------------------------===*/
9 
10 #ifndef LLVM_CLANG_C_REWRITE_H
11 #define LLVM_CLANG_C_REWRITE_H
12 
13 #include "clang-c/CXString.h"
14 #include "clang-c/ExternC.h"
15 #include "clang-c/Index.h"
16 #include "clang-c/Platform.h"
17 
19 
20 typedef void *CXRewriter;
21 
22 /**
23  * Create CXRewriter.
24  */
26 
27 /**
28  * Insert the specified string at the specified location in the original buffer.
29  */
31  const char *Insert);
32 
33 /**
34  * Replace the specified range of characters in the input with the specified
35  * replacement.
36  */
38  const char *Replacement);
39 
40 /**
41  * Remove the specified range.
42  */
44 
45 /**
46  * Save all changed files to disk.
47  * Returns 1 if any files were not saved successfully, returns 0 otherwise.
48  */
50 
51 /**
52  * Write out rewritten version of the main file to stdout.
53  */
55 
56 /**
57  * Free the given CXRewriter.
58  */
60 
62 
63 #endif
clang_CXRewriter_insertTextBefore
CINDEX_LINKAGE void clang_CXRewriter_insertTextBefore(CXRewriter Rew, CXSourceLocation Loc, const char *Insert)
Insert the specified string at the specified location in the original buffer.
CXString.h
LLVM_CLANG_C_EXTERN_C_END
#define LLVM_CLANG_C_EXTERN_C_END
Definition: ExternC.h:36
CXTranslationUnit
struct CXTranslationUnitImpl * CXTranslationUnit
A single translation unit, which resides in an index.
Definition: Index.h:86
clang::RISCV::TU
@ TU
Definition: RISCVVIntrinsicUtils.h:95
Index.h
clang_CXRewriter_dispose
CINDEX_LINKAGE void clang_CXRewriter_dispose(CXRewriter Rew)
Free the given CXRewriter.
LLVM_CLANG_C_EXTERN_C_BEGIN
#define LLVM_CLANG_C_EXTERN_C_BEGIN
Definition: ExternC.h:35
Platform.h
clang_CXRewriter_removeText
CINDEX_LINKAGE void clang_CXRewriter_removeText(CXRewriter Rew, CXSourceRange ToBeRemoved)
Remove the specified range.
CXRewriter
LLVM_CLANG_C_EXTERN_C_BEGIN typedef void * CXRewriter
Definition: Rewrite.h:20
clang_CXRewriter_writeMainFileToStdOut
CINDEX_LINKAGE void clang_CXRewriter_writeMainFileToStdOut(CXRewriter Rew)
Write out rewritten version of the main file to stdout.
clang_CXRewriter_create
CINDEX_LINKAGE CXRewriter clang_CXRewriter_create(CXTranslationUnit TU)
Create CXRewriter.
CXSourceLocation
Identifies a specific source location within a translation unit.
Definition: Index.h:456
CINDEX_LINKAGE
#define CINDEX_LINKAGE
Definition: Platform.h:38
CXSourceRange
Identifies a half-open character range in the source code.
Definition: Index.h:467
clang_CXRewriter_overwriteChangedFiles
CINDEX_LINKAGE int clang_CXRewriter_overwriteChangedFiles(CXRewriter Rew)
Save all changed files to disk.
clang_CXRewriter_replaceText
CINDEX_LINKAGE void clang_CXRewriter_replaceText(CXRewriter Rew, CXSourceRange ToBeReplaced, const char *Replacement)
Replace the specified range of characters in the input with the specified replacement.
clang::diff::Insert
@ Insert
Definition: ASTDiff.h:31
ExternC.h