summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-move/ClangMove.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clang-move/ClangMove.cpp')
-rw-r--r--clang-tools-extra/clang-move/ClangMove.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/clang-tools-extra/clang-move/ClangMove.cpp b/clang-tools-extra/clang-move/ClangMove.cpp
index cfd36d6b272..be3fca0dff5 100644
--- a/clang-tools-extra/clang-move/ClangMove.cpp
+++ b/clang-tools-extra/clang-move/ClangMove.cpp
@@ -742,10 +742,13 @@ void ClangMoveTool::removeDeclsInOldFiles() {
// Ignore replacements for new.h/cc.
if (SI == FilePathToFileID.end()) continue;
llvm::StringRef Code = SM.getBufferData(SI->second);
- format::FormatStyle Style =
- format::getStyle("file", FilePath, Context->FallbackStyle);
+ auto Style = format::getStyle("file", FilePath, Context->FallbackStyle);
+ if (!Style) {
+ llvm::errs() << llvm::toString(Style.takeError()) << "\n";
+ continue;
+ }
auto CleanReplacements = format::cleanupAroundReplacements(
- Code, Context->FileToReplacements[FilePath], Style);
+ Code, Context->FileToReplacements[FilePath], *Style);
if (!CleanReplacements) {
llvm::errs() << llvm::toString(CleanReplacements.takeError()) << "\n";
OpenPOWER on IntegriCloud