================
@@ -681,12 +718,26 @@ renameOutsideFile(const NamedDecl &RenameDecl,
llvm::StringRef MainFilePath,
ExpBuffer.getError().message());
continue;
}
+ std::string RenameIdentifier = RenameDecl.getNameAsString();
+ std::optional<Selector> Selector = std::nullopt;
+ llvm::SmallVector<llvm::StringRef, 8> NewNames;
+ if (const auto *MD = dyn_cast<ObjCMethodDecl>(&RenameDecl)) {
+ if (MD->getSelector().getNumArgs() > 1) {
+ RenameIdentifier = MD->getSelector().getNameForSlot(0).str();
+ Selector = MD->getSelector();
+ NewName.split(NewNames, ":");
----------------
kadircet wrote:
you can perform the split unconditionally ,rather than pushing to `NewNames`
below.
also is it possible to have "empty" selector segments? (e.g. is a NewName like
`foo::bar` valid for a selector with 3 segments? if not we should probably
raise an error when validating)
https://github.com/llvm/llvm-project/pull/76466
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits