Home
last modified time | relevance | path

Searched refs:Rewrite (Results 1 – 25 of 142) sorted by relevance

123456

/llvm-project-15.0.7/mlir/test/mlir-pdll/Parser/
H A Drewrite-failure.pdll4 // Rewrite Structure
8 Rewrite {}
14 Rewrite Foo();
15 Rewrite Foo();
58 Rewrite Bar();
61 Rewrite Foo() {
62 Rewrite Bar() {};
72 Rewrite Foo {}
77 Rewrite Foo(10{}
82 Rewrite Foo(arg{}
[all …]
H A Drewrite.pdll5 Rewrite Foo();
11 Rewrite Foo() [{ /* Native Code */ }];
26 Rewrite Foo(arg: Op) -> Value => arg;
46 Rewrite Foo() -> (result1: Value, result2: Attr) => (_: Value, attr<"10">);
55 Rewrite Outer() {
56 Rewrite() {};
57 Rewrite() => attr<"10">;
H A Dpattern-failure.pdll15 // CHECK: `return` statements are only permitted within a `Constraint` or `Rewrite` body
42 Rewrite SomeRewrite();
44 // CHECK: unable to invoke `Rewrite` within a match section
/llvm-project-15.0.7/clang/unittests/Rewrite/
H A DRewriterTest.cpp19 Rewriter Rewrite; member
31 Rewrite = Rewriter(C.getSourceManager(), C.getLangOpts()); in RangeTypeTest()
52 EXPECT_EQ(T.Rewrite.getRewrittenText(T.CRange), "ret"); in TEST()
53 EXPECT_EQ(T.Rewrite.getRewrittenText(T.TRange), "return"); in TEST()
54 EXPECT_EQ(T.Rewrite.getRewrittenText(T.SRange), "return"); in TEST()
55 T.Rewrite.InsertText(T.makeLoc(13), "x"); in TEST()
56 EXPECT_EQ(T.Rewrite.getRewrittenText(T.CRange), "xret"); in TEST()
57 EXPECT_EQ(T.Rewrite.getRewrittenText(T.TRange), "xreturn"); in TEST()
72 T.Rewrite.ReplaceText(T.CRange, "foo"); in TEST()
74 T.Rewrite.ReplaceText(T.TRange, "bar"); in TEST()
[all …]
/llvm-project-15.0.7/clang/lib/Tooling/
H A DRefactoring.cpp48 Rewriter Rewrite(Sources, DefaultLangOptions); in runAndSave() local
50 if (!applyAllReplacements(Rewrite)) { in runAndSave()
54 return saveRewrittenFiles(Rewrite); in runAndSave()
57 bool RefactoringTool::applyAllReplacements(Rewriter &Rewrite) { in applyAllReplacements() argument
60 Rewrite.getSourceMgr().getFileManager(), FileToReplaces)) in applyAllReplacements()
65 int RefactoringTool::saveRewrittenFiles(Rewriter &Rewrite) { in saveRewrittenFiles() argument
66 return Rewrite.overwriteChangedFiles() ? 1 : 0; in saveRewrittenFiles()
71 Rewriter &Rewrite, StringRef Style) { in formatAndApplyAllReplacements() argument
72 SourceManager &SM = Rewrite.getSourceMgr(); in formatAndApplyAllReplacements()
77 Rewrite.getSourceMgr().getFileManager(), FileToReplaces)) { in formatAndApplyAllReplacements()
[all …]
/llvm-project-15.0.7/clang/lib/Frontend/Rewrite/
H A DFixItRewriter.cpp40 : Diags(Diags), Editor(SourceMgr, LangOpts), Rewrite(SourceMgr, LangOpts), in FixItRewriter()
52 const RewriteBuffer *RewriteBuf = Rewrite.getRewriteBufferFor(ID); in WriteFixedFile()
62 Rewriter &Rewrite; member in __anond4435ba20111::RewritesReceiver
65 RewritesReceiver(Rewriter &Rewrite) : Rewrite(Rewrite) {} in RewritesReceiver() argument
68 Rewrite.InsertText(loc, text); in insert()
72 Rewrite.ReplaceText(range.getBegin(), Rewrite.getRangeSize(range), text); in replace()
85 RewritesReceiver Rec(Rewrite); in WriteFixedFiles()
91 Rewrite.overwriteChangedFiles(); in WriteFixedFiles()
96 const FileEntry *Entry = Rewrite.getSourceMgr().getFileEntryForID(I->first); in WriteFixedFiles()
H A DRewriteMacros.cpp92 Rewriter Rewrite; in RewriteMacrosInInput() local
93 Rewrite.setSourceMgr(SM, PP.getLangOpts()); in RewriteMacrosInInput()
94 RewriteBuffer &RB = Rewrite.getEditBuffer(SM.getMainFileID()); in RewriteMacrosInInput()
209 Rewrite.getRewriteBufferFor(SM.getMainFileID())) { in RewriteMacrosInInput()
H A DInclusionRewriter.cpp517 InclusionRewriter *Rewrite = new InclusionRewriter( in RewriteIncludesInInput() local
519 Rewrite->detectMainFileEOL(); in RewriteIncludesInInput()
521 PP.addPPCallbacks(std::unique_ptr<PPCallbacks>(Rewrite)); in RewriteIncludesInInput()
537 Rewrite->handleModuleBegin(Tok); in RewriteIncludesInInput()
539 Rewrite->setPredefinesBuffer(SM.getBufferOrFake(PP.getPredefinesFileID())); in RewriteIncludesInInput()
540 Rewrite->Process(PP.getPredefinesFileID(), SrcMgr::C_User); in RewriteIncludesInInput()
541 Rewrite->Process(SM.getMainFileID(), SrcMgr::C_User); in RewriteIncludesInInput()
/llvm-project-15.0.7/clang/unittests/Tooling/
H A DRewriterTest.cpp20 Context.Rewrite.ReplaceText(Context.getLocation(ID, 2, 1), 5, "replaced"); in TEST()
21 EXPECT_FALSE(Context.Rewrite.overwriteChangedFiles()); in TEST()
29 Context.Rewrite.ReplaceText(Context.getLocation(FailingID, 1, 2), 1, "other"); in TEST()
32 Context.Rewrite.ReplaceText(Context.getLocation(WorkingID, 2, 1), 5, in TEST()
34 EXPECT_TRUE(Context.Rewrite.overwriteChangedFiles()); in TEST()
H A DRewriterTestContext.h59 Sources(Diagnostics, Files), Rewrite(Sources, Options) { in RewriterTestContext()
111 Rewrite.getEditBuffer(ID).write(OS); in getRewrittenText()
136 Rewriter Rewrite; variable
/llvm-project-15.0.7/clang/include/clang/Rewrite/Frontend/
H A DFixItRewriter.h70 Rewriter Rewrite; variable
97 return Rewrite.getRewriteBufferFor(ID) != nullptr; in IsModified()
103 iterator buffer_begin() { return Rewrite.buffer_begin(); } in buffer_begin()
104 iterator buffer_end() { return Rewrite.buffer_end(); } in buffer_end()
/llvm-project-15.0.7/clang/include/clang/Tooling/
H A DRefactoring.h64 bool applyAllReplacements(Rewriter &Rewrite);
68 int saveRewrittenFiles(Rewriter &Rewrite);
94 Rewriter &Rewrite, StringRef Style = "file");
/llvm-project-15.0.7/mlir/examples/toy/Ch3/mlir/
H A DToyCombine.td10 // Declarative Rewrite Rules (DRR) specified using TableGen records.
29 // Basic Pattern-Match and Rewrite
37 // Pattern-Match and Rewrite using Native Code Call
51 // Pattern-Match and Rewrite with Constraints
/llvm-project-15.0.7/mlir/examples/toy/Ch7/mlir/
H A DToyCombine.td10 // Declarative Rewrite Rules (DRR) specified using TableGen records.
29 // Basic Pattern-Match and Rewrite
37 // Pattern-Match and Rewrite using Native Code Call
51 // Pattern-Match and Rewrite with Constraints
/llvm-project-15.0.7/mlir/examples/toy/Ch6/mlir/
H A DToyCombine.td10 // Declarative Rewrite Rules (DRR) specified using TableGen records.
29 // Basic Pattern-Match and Rewrite
37 // Pattern-Match and Rewrite using Native Code Call
51 // Pattern-Match and Rewrite with Constraints
/llvm-project-15.0.7/mlir/examples/toy/Ch4/mlir/
H A DToyCombine.td10 // Declarative Rewrite Rules (DRR) specified using TableGen records.
29 // Basic Pattern-Match and Rewrite
37 // Pattern-Match and Rewrite using Native Code Call
51 // Pattern-Match and Rewrite with Constraints
/llvm-project-15.0.7/mlir/examples/toy/Ch5/mlir/
H A DToyCombine.td10 // Declarative Rewrite Rules (DRR) specified using TableGen records.
29 // Basic Pattern-Match and Rewrite
37 // Pattern-Match and Rewrite using Native Code Call
51 // Pattern-Match and Rewrite with Constraints
/llvm-project-15.0.7/clang-tools-extra/clang-change-namespace/tool/
H A DClangChangeNamespace.cpp136 Rewriter Rewrite(Sources, DefaultLangOptions); in main() local
138 if (!formatAndApplyAllReplacements(Tool.getReplacements(), Rewrite, Style)) { in main()
143 return Rewrite.overwriteChangedFiles(); in main()
159 Rewrite.getEditBuffer(ID).write(ContentStream); in main()
177 Rewrite.getEditBuffer(ID).write(llvm::outs()); in main()
/llvm-project-15.0.7/utils/bazel/llvm-project-overlay/bolt/
H A DBUILD.bazel17 ":Rewrite",
46 ":Rewrite",
62 name = "Rewrite",
64 "lib/Rewrite/*.cpp",
67 "include/bolt/Rewrite/*.h",
240 "include/bolt/Rewrite/*.h",
/llvm-project-15.0.7/clang-tools-extra/clang-reorder-fields/tool/
H A DClangReorderFields.cpp83 Rewriter Rewrite(Sources, DefaultLangOptions); in main() local
84 Tool.applyAllReplacements(Rewrite); in main()
89 Rewrite.getEditBuffer(ID).write(outs()); in main()
/llvm-project-15.0.7/llvm/utils/gn/secondary/clang/lib/Frontend/Rewrite/
H A DBUILD.gn1 static_library("Rewrite") {
10 "//clang/lib/Rewrite",
/llvm-project-15.0.7/mlir/test/mlir-pdll/CodeGen/CPP/
H A Dgeneral.pdll74 Rewrite TestRewrite(attr: Attr, op: Op, type: Type, value: Value, typeRange: TypeRange, valueRange:…
75 Rewrite TestRewriteSingle() -> Attr [{}];
76 Rewrite TestRewriteTuple() -> (Attr, Type) [{}];
77 Rewrite TestUnusedRewrite(op: Op) [{}];
/llvm-project-15.0.7/clang-tools-extra/clang-move/tool/
H A DClangMove.cpp186 Rewriter Rewrite(SM, LangOptions()); in main() local
188 if (!formatAndApplyAllReplacements(Tool.getReplacements(), Rewrite, Style)) { in main()
206 Rewrite.getEditBuffer(ID).write(ContentStream); in main()
219 return Rewrite.overwriteChangedFiles(); in main()
/llvm-project-15.0.7/clang/lib/StaticAnalyzer/Core/
H A DTextDiagnostics.cpp130 Rewriter Rewrite(SM, LO); in FlushDiagnosticsImpl() local
131 if (!applyAllReplacements(Repls, Rewrite)) { in FlushDiagnosticsImpl()
135 Rewrite.overwriteChangedFiles(); in FlushDiagnosticsImpl()
/llvm-project-15.0.7/clang/lib/Tooling/Core/
H A DReplacement.cpp68 bool Replacement::apply(Rewriter &Rewrite) const { in apply()
69 SourceManager &SM = Rewrite.getSourceMgr(); in apply()
81 bool RewriteSucceeded = !Rewrite.ReplaceText( in apply()
567 bool applyAllReplacements(const Replacements &Replaces, Rewriter &Rewrite) { in applyAllReplacements() argument
571 Result = I->apply(Rewrite) && Result; in applyAllReplacements()
591 Rewriter Rewrite(SourceMgr, LangOptions()); in applyAllReplacements() local
600 if (!Replace.apply(Rewrite)) in applyAllReplacements()
606 Rewrite.getEditBuffer(ID).write(OS); in applyAllReplacements()

123456