summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang-tools-extra/clang-move/tool/ClangMoveMain.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/clang-tools-extra/clang-move/tool/ClangMoveMain.cpp b/clang-tools-extra/clang-move/tool/ClangMoveMain.cpp
index 3787e940b7f..c1ab13bd9a6 100644
--- a/clang-tools-extra/clang-move/tool/ClangMoveMain.cpp
+++ b/clang-tools-extra/clang-move/tool/ClangMoveMain.cpp
@@ -108,10 +108,22 @@ int main(int argc, const char **argv) {
if (CodeStatus)
return CodeStatus;
- if (!NewCC.empty())
- CreateNewFile(NewCC);
- if (!NewHeader.empty())
- CreateNewFile(NewHeader);
+ if (!NewCC.empty()) {
+ std::error_code EC = CreateNewFile(NewCC);
+ if (EC) {
+ llvm::errs() << "Failed to create " << NewCC << ": " << EC.message()
+ << "\n";
+ return EC.value();
+ }
+ }
+ if (!NewHeader.empty()) {
+ std::error_code EC = CreateNewFile(NewHeader);
+ if (EC) {
+ llvm::errs() << "Failed to create " << NewHeader << ": " << EC.message()
+ << "\n";
+ return EC.value();
+ }
+ }
IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts(new DiagnosticOptions());
clang::TextDiagnosticPrinter DiagnosticPrinter(errs(), &*DiagOpts);
OpenPOWER on IntegriCloud