migrator: ignore migration scripts with underscored new names. rdar://39877447

Updating something to underscored names is hardly correct. This patch
disallows picking up such migration scripts.
This commit is contained in:
Xi Ge
2018-05-01 16:05:57 -07:00
parent 574e5564f5
commit 82a2c2c644
7 changed files with 34 additions and 8 deletions

View File

@@ -3989,12 +3989,7 @@ static int deserializeNameCorrection(APIDiffItemStore &Store,
if (CI->DiffKind == NodeAnnotation::Rename) {
auto NewName = CI->getNewName();
auto Module = CI->ModuleName;
DeclNameViewer Viewer(NewName);
auto HasUnderScore =
[](StringRef S) { return S.find('_') != StringRef::npos; };
auto Args = Viewer.args();
if (HasUnderScore(Viewer.base()) ||
std::any_of(Args.begin(), Args.end(), HasUnderScore)) {
if (CI->rightCommentUnderscored()) {
Result.insert(NameCorrectionInfo(NewName, NewName, Module));
}
}