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
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,
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;
}
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 {
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;
}
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,
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;
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);
+ }
}
}
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);
+ }
}
}
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'.
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);
+ }
}
}
}