ΒΆllvm::Expected<std::string> applyAllReplacements(
llvm::StringRef Code,
const clang::tooling::Replacements& Replaces)
llvm::Expected<std::string> applyAllReplacements(
llvm::StringRef Code,
const clang::tooling::Replacements& Replaces)
Description
Applies all replacements in \p Replaces to \p Code. This completely ignores the path stored in each replacement. If all replacements are applied successfully, this returns the code with replacements applied; otherwise, an llvm::Error carrying llvm::StringError is returned (the Error message can be converted to string using `llvm::toString()` and 'std::error_code` in the `Error` should be ignored).
Declared at: clang/include/clang/Tooling/Core/Replacement.h:328
Parameters
- llvm::StringRef Code
- const clang::tooling::Replacements& Replaces