Home
last modified time | relevance | path

Searched refs:Replacement (Results 1 – 25 of 168) sorted by relevance

1234567

/llvm-project-15.0.7/clang/include/clang/Tooling/Core/
H A DReplacement.h83 class Replacement {
86 Replacement();
164 ReplacementError(replacement_error Err, Replacement New, Replacement Existing) in ReplacementError()
194 llvm::Optional<Replacement> NewReplacement;
201 bool operator<(const Replacement &LHS, const Replacement &RHS);
204 bool operator==(const Replacement &LHS, const Replacement &RHS);
211 using ReplacementsImpl = std::set<Replacement>;
258 llvm::Error add(const Replacement &R);
296 Replacement getReplacementInChangedCode(const Replacement &R) const;
336 std::vector<Replacement> Replacements;
[all …]
/llvm-project-15.0.7/clang/unittests/Tooling/
H A DRefactoringTest.cpp99 Replacement Replace2; in TEST_F()
262 Replacement After = Replacement("x.cc", 10, 5, ""); in TEST_F()
709 Replacement Replace;
732 Replacement Replace;
762 Replacement Replace;
791 {Replacement("foo", 0, 4, ""), Replacement("foo", 10, 1, "zzzzzz"), in TEST()
805 {Replacement("foo", 0, 2, ""), Replacement("foo", 0, 0, "ba")}); in TEST()
859 {Replacement("foo", 1, 3, ""), Replacement("foo", 6, 1, "123"), in TEST()
860 Replacement("foo", 13, 3, "1"), Replacement("foo", 25, 15, "")}); in TEST()
877 {Replacement("foo", 0, 2, "12"), Replacement("foo", 5, 1, "123"), in TEST()
[all …]
H A DDiagnosticsYamlTest.cpp167 std::vector<Replacement> Fixes; in TEST()
169 for (auto &Replacement : Replacements.second) { in TEST() local
170 Fixes.push_back(Replacement); in TEST()
181 std::vector<Replacement> Fixes1 = getFixes(D1.Message.Fix); in TEST()
194 std::vector<Replacement> Fixes2 = getFixes(D2.Message.Fix); in TEST()
217 std::vector<Replacement> Fixes3 = getFixes(D3.Message.Fix); in TEST()
H A DReplacementTest.h27 toReplacements(const std::set<tooling::Replacement> &Replaces) { in toReplacements()
43 tooling::Replacement createReplacement(SourceLocation Start, unsigned Length, in createReplacement()
45 return tooling::Replacement(Context.Sources, Start, Length, in createReplacement()
/llvm-project-15.0.7/clang/lib/Tooling/Core/
H A DReplacement.cpp45 Replacement::Replacement() : FilePath(InvalidLocation) {} in Replacement() function in Replacement
47 Replacement::Replacement(StringRef FilePath, unsigned Offset, unsigned Length, in Replacement() function in Replacement
52 Replacement::Replacement(const SourceManager &Sources, SourceLocation Start, in Replacement() function in Replacement
57 Replacement::Replacement(const SourceManager &Sources, in Replacement() function in Replacement
98 bool operator<(const Replacement &LHS, const Replacement &RHS) { in operator <()
110 bool operator==(const Replacement &LHS, const Replacement &RHS) { in operator ==()
156 Replacement
206 Replacement NewR( in getCanonicalReplacements()
280 Replacement NewR( in add()
305 auto Overlap = [](const Replacement &R1, const Replacement &R2) -> bool { in add()
[all …]
/llvm-project-15.0.7/clang/include/clang/Tooling/
H A DReplacementsYaml.h22 LLVM_YAML_IS_SEQUENCE_VECTOR(clang::tooling::Replacement) in LLVM_YAML_IS_SEQUENCE_VECTOR() argument
29 template <> struct MappingTraits<clang::tooling::Replacement> { in LLVM_YAML_IS_SEQUENCE_VECTOR()
35 NormalizedReplacement(const IO &, const clang::tooling::Replacement &R) in LLVM_YAML_IS_SEQUENCE_VECTOR()
39 clang::tooling::Replacement denormalize(const IO &) { in LLVM_YAML_IS_SEQUENCE_VECTOR()
40 return clang::tooling::Replacement(FilePath, Offset, Length, in LLVM_YAML_IS_SEQUENCE_VECTOR()
50 static void mapping(IO &Io, clang::tooling::Replacement &R) { in LLVM_YAML_IS_SEQUENCE_VECTOR()
51 MappingNormalization<NormalizedReplacement, clang::tooling::Replacement> in LLVM_YAML_IS_SEQUENCE_VECTOR()
/llvm-project-15.0.7/clang-tools-extra/clangd/refactor/tweaks/
H A DExpandMacro.cpp111 std::string Replacement; in apply() local
113 Replacement += T.text(SM); in apply()
114 Replacement += " "; in apply()
116 if (!Replacement.empty()) { in apply()
117 assert(Replacement.back() == ' '); in apply()
118 Replacement.pop_back(); in apply()
126 llvm::cantFail(Reps.add(tooling::Replacement(SM, MacroRange, Replacement))); in apply()
/llvm-project-15.0.7/clang/lib/Tooling/
H A DRefactoringCallbacks.cpp51 for (const auto &Replacement : Callback->getReplacements()) { in HandleTranslationUnit() local
53 Refactoring.FileToReplaces[std::string(Replacement.getFilePath())] in HandleTranslationUnit()
54 .add(Replacement); in HandleTranslationUnit()
56 llvm::errs() << "Skipping replacement " << Replacement.toString() in HandleTranslationUnit()
72 static Replacement replaceStmtWithText(SourceManager &Sources, const Stmt &From, in replaceStmtWithText()
74 return tooling::Replacement( in replaceStmtWithText()
77 static Replacement replaceStmtWithStmt(SourceManager &Sources, const Stmt &From, in replaceStmtWithStmt()
91 auto Err = Replace.add(tooling::Replacement( in run()
228 auto Replacement = in run() local
229 tooling::Replacement(*Result.SourceManager, &NodeMap.at(FromId), ToText, in run()
[all …]
/llvm-project-15.0.7/clang/include/clang/Tooling/Transformer/
H A DRewriteRule.h48 std::string Replacement; member
109 TextGenerator Replacement; member
177 ASTEdit changeTo(RangeSelector Target, TextGenerator Replacement);
179 inline ASTEdit change(RangeSelector Target, TextGenerator Replacement) { in change() argument
180 return changeTo(std::move(Target), std::move(Replacement)); in change()
189 inline ASTEdit changeTo(TextGenerator Replacement) { in changeTo() argument
190 return changeTo(node(RootID), std::move(Replacement)); in changeTo()
193 inline ASTEdit change(TextGenerator Replacement) { in change() argument
194 return changeTo(std::move(Replacement)); in change()
200 return changeTo(before(std::move(S)), std::move(Replacement)); in insertBefore()
[all …]
/llvm-project-15.0.7/clang-tools-extra/clangd/
H A DFormat.cpp89 tooling::Replacement replacement(llvm::StringRef Code, llvm::StringRef From, in replacement()
93 return tooling::Replacement(Filename, From.data() - Code.data(), in replacement()
236 std::vector<tooling::Replacement>
239 std::vector<tooling::Replacement> Result; in split()
241 for (const tooling::Replacement &R : Replacements) { in split()
250 Result.push_back(tooling::Replacement( in split()
253 Result.push_back(tooling::Replacement( in split()
276 std::vector<tooling::Replacement>
319 for (const tooling::Replacement &R : format::reformat( in formatIncremental()
325 cantFail(FormattingChanges.add(tooling::Replacement(Filename, in formatIncremental()
[all …]
H A DFormat.h41 std::vector<tooling::Replacement>
49 const std::vector<tooling::Replacement> &Replacements);
/llvm-project-15.0.7/clang/lib/Tooling/Syntax/
H A DComputeReplacements.cpp100 std::string Replacement; in computeReplacements() local
102 if (ReplacedRange.empty() && Replacement.empty()) in computeReplacements()
104 llvm::cantFail(Replacements.add(tooling::Replacement( in computeReplacements()
106 Replacement))); in computeReplacements()
107 Replacement = ""; in computeReplacements()
113 Replacement += in computeReplacements()
/llvm-project-15.0.7/clang-tools-extra/clang-tidy/modernize/
H A DDeprecatedIosBaseAliasesCheck.cpp46 auto Replacement = getReplacementType(TypeName); in check() local
53 bool Fix = Replacement && !TL->getType()->isDependentType(); in check()
61 if (Replacement) { in check()
62 const char *FixName = *Replacement; in check()
H A DRawStringLiteralCheck.cpp130 std::string Replacement = asRawStringLiteral(Literal, DelimiterStem); in check() local
132 Replacement.length() <= in check()
135 replaceWithRawStringLiteral(Result, Literal, Replacement); in check()
141 StringRef Replacement) { in replaceWithRawStringLiteral() argument
147 << FixItHint::CreateReplacement(CharRange, Replacement); in replaceWithRawStringLiteral()
/llvm-project-15.0.7/clang-tools-extra/clang-apply-replacements/lib/Tooling/
H A DApplyReplacements.cpp140 static llvm::DenseMap<const FileEntry *, std::vector<tooling::Replacement>>
144 llvm::DenseMap<const FileEntry *, std::vector<tooling::Replacement>> in groupReplacements()
151 std::map<tooling::Replacement, in groupReplacements()
155 auto AddToGroup = [&](const tooling::Replacement &R, in groupReplacements()
182 for (const tooling::Replacement &R : TU.Replacements) in groupReplacements()
189 for (const tooling::Replacement &R : Fix.second) in groupReplacements()
241 tooling::Replacement RR = tooling::Replacement( in mergeAndDeduplicate()
/llvm-project-15.0.7/clang-tools-extra/clangd/support/
H A DContext.cpp29 Context Context::swapCurrent(Context Replacement) { in swapCurrent() argument
30 std::swap(Replacement, currentContext()); in swapCurrent()
31 return Replacement; in swapCurrent()
/llvm-project-15.0.7/llvm/lib/Target/AMDGPU/
H A DR600OpenCLImageTypeLoweringPass.cpp164 Value *Replacement = nullptr; in replaceImageUses() local
167 Replacement = ConstantInt::get(Int32Type, ResourceID); in replaceImageUses()
169 Replacement = &ImageSizeArg; in replaceImageUses()
171 Replacement = &ImageFormatArg; in replaceImageUses()
176 Inst->replaceAllUsesWith(Replacement); in replaceImageUses()
197 Value *Replacement = nullptr; in replaceSamplerUses() local
200 Replacement = ConstantInt::get(Int32Type, ResourceID); in replaceSamplerUses()
205 Inst->replaceAllUsesWith(Replacement); in replaceSamplerUses()
/llvm-project-15.0.7/bolt/lib/Passes/
H A DRetpolineInsertion.cpp230 InstructionListType &Replacement, in createBranchReplacement() argument
240 Replacement.push_back(LoadCalleeAddrs); in createBranchReplacement()
248 Replacement.push_back(RetpolineCall); in createBranchReplacement()
293 InstructionListType Replacement; in runOnFunctions() local
318 createBranchReplacement(BC, BrInfo, R11Available, Replacement, in runOnFunctions()
321 It = BB.replaceInstruction(It, Replacement.begin(), Replacement.end()); in runOnFunctions()
/llvm-project-15.0.7/clang/lib/Tooling/Refactoring/
H A DAtomicChange.cpp45 std::vector<clang::tooling::Replacement> Replaces;
118 for (const clang::tooling::Replacement &R : Replaces) { in getRangesForFormating()
160 tooling::Replacement(FilePath, UINT_MAX, 0, ReplacementText)); in createReplacementsForHeaders()
168 HeaderReplacements.add(Replacement(FilePath, UINT_MAX, 1, Header)); in createReplacementsForHeaders()
188 if (auto Err = Replaces.add(Replacement( in combineReplacementsInChanges()
261 return Replaces.add(Replacement(SM, Range, ReplacementText)); in replace()
266 return Replaces.add(Replacement(SM, Loc, Length, Text)); in replace()
273 Replacement R(SM, Loc, 0, Text); in insert()
284 Replacement NewR(R.getFilePath(), NewOffset, 0, Text); in insert()
/llvm-project-15.0.7/clang-tools-extra/clang-tidy/bugprone/
H A DUnusedRaiiCheck.cpp44 const char *Replacement = " give_me_a_name"; in reportDiagnostic() local
50 Replacement); in reportDiagnostic()
57 D << FixItHint::CreateInsertion(SR.getBegin(), Replacement); in reportDiagnostic()
/llvm-project-15.0.7/clang-tools-extra/clang-tidy/performance/
H A DFasterStringFindCheck.cpp84 auto Replacement = makeCharacterLiteral(Literal); in check() local
85 if (!Replacement) in check()
95 *Replacement); in check()
/llvm-project-15.0.7/clang/lib/Tooling/Transformer/
H A DRewriteRule.cpp53 auto Replacement = E.Replacement->eval(Result); in translateEdits() local
54 if (!Replacement) in translateEdits()
55 return Replacement.takeError(); in translateEdits()
62 T.Replacement = std::move(*Replacement); in translateEdits()
117 ASTEdit transformer::changeTo(RangeSelector Target, TextGenerator Replacement) { in changeTo() argument
120 E.Replacement = std::move(Replacement); in changeTo()
165 E.Replacement = makeText(formatHeaderPath(Header, Format)); in addInclude()
/llvm-project-15.0.7/clang-tools-extra/clang-tidy/abseil/
H A DFasterStrsplitDelimiterCheck.cpp108 llvm::Optional<std::string> Replacement = in check() local
110 if (!Replacement) in check()
124 *Replacement); in check()
/llvm-project-15.0.7/llvm/lib/Transforms/ObjCARC/
H A DObjCARCContract.cpp616 Instruction *Replacement = Inst; in run() local
622 if (Replacement->getType() != UseTy) { in run()
633 Replacement = in run()
634 new BitCastInst(Replacement, UseTy, "", &InsertBB->back()); in run()
647 PHI->setIncomingValue(i, Replacement); in run()
650 if (Replacement->getType() != UseTy) in run()
651 Replacement = new BitCastInst(Replacement, UseTy, "", in run()
653 U.set(Replacement); in run()
/llvm-project-15.0.7/llvm/lib/CodeGen/
H A DReplaceWithVeclib.cpp76 CallInst *Replacement = IRBuilder.CreateCall(TLIFunc, Args, OpBundles); in replaceWithTLIFunction() local
79 CI.replaceAllUsesWith(Replacement); in replaceWithTLIFunction()
80 if (isa<FPMathOperator>(Replacement)) { in replaceWithTLIFunction()
82 Replacement->copyFastMathFlags(&CI); in replaceWithTLIFunction()

1234567