summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/Format/Format.cpp15
-rw-r--r--lib/Format/SortJavaScriptImports.cpp5
-rw-r--r--lib/Format/WhitespaceManager.cpp5
-rw-r--r--lib/Lex/ModuleMap.cpp2
-rw-r--r--lib/Tooling/RefactoringCallbacks.cpp20
5 files changed, 28 insertions, 19 deletions
diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp
index 61c904cc7f..70b90d6fa1 100644
--- a/lib/Format/Format.cpp
+++ b/lib/Format/Format.cpp
@@ -844,9 +844,10 @@ private:
Env.getSourceManager(), Start, Length, ReplacementText));
// FIXME: handle error. For now, print error message and skip the
// replacement for release version.
- if (Err)
+ if (Err) {
llvm::errs() << llvm::toString(std::move(Err)) << "\n";
- assert(!Err);
+ assert(false);
+ }
};
Replace(Start, 1, IsSingle ? "'" : "\"");
Replace(FormatTok->Tok.getEndLoc().getLocWithOffset(-1), 1,
@@ -1193,9 +1194,10 @@ private:
Fixes.add(tooling::Replacement(Env.getSourceManager(), SR, ""));
// FIXME: better error handling. for now just print error message and skip
// for the release version.
- if (Err)
+ if (Err) {
llvm::errs() << llvm::toString(std::move(Err)) << "\n";
- assert(!Err && "Fixes must not conflict!");
+ assert(false && "Fixes must not conflict!");
+ }
Idx = End + 1;
}
@@ -1327,9 +1329,10 @@ static void sortCppIncludes(const FormatStyle &Style,
FileName, Includes.front().Offset, IncludesBlockSize, result));
// FIXME: better error handling. For now, just skip the replacement for the
// release version.
- if (Err)
+ if (Err) {
llvm::errs() << llvm::toString(std::move(Err)) << "\n";
- assert(!Err);
+ assert(false);
+ }
}
namespace {
diff --git a/lib/Format/SortJavaScriptImports.cpp b/lib/Format/SortJavaScriptImports.cpp
index d72455bb3d..e73695ca84 100644
--- a/lib/Format/SortJavaScriptImports.cpp
+++ b/lib/Format/SortJavaScriptImports.cpp
@@ -197,9 +197,10 @@ public:
ReferencesText));
// FIXME: better error handling. For now, just print error message and skip
// the replacement for the release version.
- if (Err)
+ if (Err) {
llvm::errs() << llvm::toString(std::move(Err)) << "\n";
- assert(!Err);
+ assert(false);
+ }
return Result;
}
diff --git a/lib/Format/WhitespaceManager.cpp b/lib/Format/WhitespaceManager.cpp
index 6fe477efd7..b64506f390 100644
--- a/lib/Format/WhitespaceManager.cpp
+++ b/lib/Format/WhitespaceManager.cpp
@@ -501,9 +501,10 @@ void WhitespaceManager::storeReplacement(SourceRange Range,
SourceMgr, CharSourceRange::getCharRange(Range), Text));
// FIXME: better error handling. For now, just print an error message in the
// release version.
- if (Err)
+ if (Err) {
llvm::errs() << llvm::toString(std::move(Err)) << "\n";
- assert(!Err);
+ assert(false);
+ }
}
void WhitespaceManager::appendNewlineText(std::string &Text,
diff --git a/lib/Lex/ModuleMap.cpp b/lib/Lex/ModuleMap.cpp
index b7bba7ea9b..9d0f2eb2fa 100644
--- a/lib/Lex/ModuleMap.cpp
+++ b/lib/Lex/ModuleMap.cpp
@@ -827,7 +827,7 @@ void ModuleMap::addHeader(Module *Mod, Module::Header Header,
return;
HeaderList.push_back(KH);
- Mod->Headers[headerRoleToKind(Role)].push_back(std::move(Header));
+ Mod->Headers[headerRoleToKind(Role)].push_back(Header);
bool isCompilingModuleHeader =
LangOpts.isCompilingModule() && Mod->getTopLevelModule() == SourceModule;
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);
+ }
}
}
}