[SourceKit] Be consistent about using the decl.var.parameter.name.local tag

FIXME.count -= 3

rdar://problem/24292226
This commit is contained in:
Ben Langmuir
2016-02-25 10:25:03 -08:00
parent f70b53b015
commit 36cc043481
2 changed files with 16 additions and 8 deletions

View File

@@ -76,6 +76,17 @@ static StringRef getTagForPrintNameContext(PrintNameContext context) {
}
}
static StringRef getDeclNameTagForDecl(const Decl *D) {
switch (D->getKind()) {
case DeclKind::Param:
// When we're examining the parameter itself, it is the local name that is
// the name of the variable.
return LocalParamNameTag;
default:
return "decl.name";
}
}
/// An ASTPrinter for annotating declarations with XML tags that describe the
/// key substructure of the declaration for CursorInfo/DocInfo.
///
@@ -117,10 +128,10 @@ private:
}
void printDeclLoc(const Decl *D) override {
openTag("decl.name");
openTag(getDeclNameTagForDecl(D));
}
void printDeclNameEndLoc(const Decl *D) override {
closeTag("decl.name");
closeTag(getDeclNameTagForDecl(D));
}
void printTypePre(const TypeLoc &TL) override {