ΒΆllvm::Expected<std::string> applyAtomicChanges(
    llvm::StringRef FilePath,
    llvm::StringRef Code,
    llvm::ArrayRef<AtomicChange> Changes,
    const clang::tooling::ApplyChangesSpec& Spec)

Description

Applies all AtomicChanges in \p Changes to the \p Code. This completely ignores the file path in each change and replaces them with\p FilePath, i.e. callers are responsible for ensuring all changes are for the same file.

Declared at: clang/include/clang/Tooling/Refactoring/AtomicChange.h:185

Parameters

llvm::StringRef FilePath
llvm::StringRef Code
llvm::ArrayRef<AtomicChange> Changes
const clang::tooling::ApplyChangesSpec& Spec

Returns

The changed code if all changes are applied successfully; otherwise, an llvm::Error carrying llvm::StringError is returned (the Error message can be converted to string with `llvm::toString()` and the error_code should be ignored).