MCPcopy Create free account
hub / github.com/Samsung/UTopia / applyReplacements

Method applyReplacements

lib/generation/UTModify.cpp:452–464  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

450}
451
452void UTModify::applyReplacements(
453 const std::string &OrgFilePath, const std::string &OutFilePath,
454 const clang::tooling::Replacements &Replacements,
455 const std::string &Signature) const {
456 auto ID = SManager->getOrCreateFileID(FManager->getFile(OrgFilePath).get(),
457 clang::SrcMgr::C_User);
458 clang::Rewriter Rewrite(*SManager, clang::LangOptions());
459 clang::tooling::applyAllReplacements(Replacements, Rewrite);
460 std::error_code EC;
461 llvm::raw_fd_ostream OutFile(OutFilePath, EC, llvm::sys::fs::F_None);
462 Rewrite.InsertTextBefore(SManager->getLocForStartOfFile(ID), Signature);
463 Rewrite.getEditBuffer(ID).write(OutFile);
464}
465
466}; // end of namespace ftg

Callers

nothing calls this directly

Calls 2

getMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected