Skip to content

Commit ee4293f

Browse files
authored
IDE Utils: For DeclNameViewer, we should use empty StringRef to represent empty argument label instead of using "_". (#9988)
1 parent 64bf04a commit ee4293f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/IDE/Utils.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -798,6 +798,10 @@ DeclNameViewer::DeclNameViewer(StringRef Text): HasParen(false) {
798798
return;
799799
assert(Labels.back().empty());
800800
Labels.pop_back();
801+
std::transform(Labels.begin(), Labels.end(), Labels.begin(),
802+
[](StringRef Label) {
803+
return Label == "_" ? StringRef() : Label;
804+
});
801805
}
802806

803807
unsigned DeclNameViewer::commonPartsCount(DeclNameViewer &Other) const {

lib/Migrator/APIDiffMigratorPass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ struct APIDiffMigratorPass : public ASTMigratorPass, public SourceEntityWalker {
334334
if (Idx < NewName.argSize()) {
335335
auto Label = NewName.args()[Idx++];
336336

337-
if (Label != "_") {
337+
if (!Label.empty()) {
338338
if (LR.getByteLength())
339339
Editor.replace(LR, Label);
340340
else

0 commit comments

Comments
 (0)