summaryrefslogtreecommitdiffstats
path: root/lib/Tooling
diff options
context:
space:
mode:
authorPiotr Padlewski <piotr.padlewski@gmail.com>2016-12-23 11:40:44 +0000
committerPiotr Padlewski <piotr.padlewski@gmail.com>2016-12-23 11:40:44 +0000
commit69ae954baa3407614ec3a949135af7d2b5acd554 (patch)
tree32167ed4a89eebb1485d9484d29bd579394c344b /lib/Tooling
parent49f60224fccab81034b429773e04f25031ffedcf (diff)
Use after move bug fixes
Summary: Bunch of fixed bugs in Clang after running misc-use-after-move in clang-tidy. Reviewers: rsmith, mboehme Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D27752 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290424 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Tooling')
-rw-r--r--lib/Tooling/RefactoringCallbacks.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/lib/Tooling/RefactoringCallbacks.cpp b/lib/Tooling/RefactoringCallbacks.cpp
index ccc67c44ae..e900c23e4f 100644
--- a/lib/Tooling/RefactoringCallbacks.cpp
+++ b/lib/Tooling/RefactoringCallbacks.cpp
@@ -45,9 +45,10 @@ void ReplaceStmtWithText::run(
CharSourceRange::getTokenRange(FromMatch->getSourceRange()), ToText));
// FIXME: better error handling. For now, just print error message in the
// release version.
- if (Err)
+ if (Err) {
llvm::errs() << llvm::toString(std::move(Err)) << "\n";
- assert(!Err);
+ assert(false);
+ }
}
}
@@ -63,9 +64,10 @@ void ReplaceStmtWithStmt::run(
replaceStmtWithStmt(*Result.SourceManager, *FromMatch, *ToMatch));
// FIXME: better error handling. For now, just print error message in the
// release version.
- if (Err)
+ if (Err) {
llvm::errs() << llvm::toString(std::move(Err)) << "\n";
- assert(!Err);
+ assert(false);
+ }
}
}
@@ -82,9 +84,10 @@ void ReplaceIfStmtWithItsBody::run(
Replace.add(replaceStmtWithStmt(*Result.SourceManager, *Node, *Body));
// FIXME: better error handling. For now, just print error message in the
// release version.
- if (Err)
+ if (Err) {
llvm::errs() << llvm::toString(std::move(Err)) << "\n";
- assert(!Err);
+ assert(false);
+ }
} else if (!PickTrueBranch) {
// If we want to use the 'else'-branch, but it doesn't exist, delete
// the whole 'if'.
@@ -92,9 +95,10 @@ void ReplaceIfStmtWithItsBody::run(
Replace.add(replaceStmtWithText(*Result.SourceManager, *Node, ""));
// FIXME: better error handling. For now, just print error message in the
// release version.
- if (Err)
+ if (Err) {
llvm::errs() << llvm::toString(std::move(Err)) << "\n";
- assert(!Err);
+ assert(false);
+ }
}
}
}