[SourceKit] Add annotation tags for generic type requirements

Each requirement gets tagged. We could also tag the whole where clause
if we need to, but so far it hasn't been interesting.

rdar://problem/24292226
This commit is contained in:
Ben Langmuir
2016-03-03 15:47:38 -08:00
parent 5eca6e4df4
commit 65f0e7eb94
7 changed files with 33 additions and 4 deletions

View File

@@ -76,6 +76,8 @@ static StringRef getTagForParameter(PrintParameterKind context) {
return "decl.var.parameter";
case PrintParameterKind::GenericParameter:
return "decl.generic_type_param";
case PrintParameterKind::GenericRequirement:
return "decl.generic_type_requirement";
}
llvm_unreachable("unexpected parameter kind");
}
@@ -255,6 +257,8 @@ private:
return parameterTypeTag;
if (context.is(PrintParameterKind::GenericParameter))
return genericParamTypeTag;
if (context.is(PrintParameterKind::GenericRequirement))
return "";
assert(context.getDecl() && "unexpected context kind");
switch (context.getDecl()->getKind()) {