C++: Handle ProxyClass in getIdentityString()

This commit is contained in:
Dave Bartolomeo
2019-01-31 09:49:42 -08:00
parent 3414c105c6
commit 283991d520
2 changed files with 29 additions and 2 deletions

View File

@@ -346,8 +346,13 @@ private class UserDumpType extends DumpType, DumpDeclaration, UserType {
override string getIdentityString() {
exists(string simpleName |
(
if this instanceof Closure then
simpleName = "(" + getSimpleName() + ")"
if this instanceof Closure then (
// Parenthesize the name of the lambda because it's freeform text similar to
// "lambda [] type at line 12, col. 40"
// Use `min(getSimpleName())` to work around an extractor bug where a lambda can have different names
// from different compilation units.
simpleName = "(" + min(getSimpleName()) + ")"
)
else
simpleName = getSimpleName()
) and
@@ -360,6 +365,12 @@ private class UserDumpType extends DumpType, DumpDeclaration, UserType {
}
}
private class DumpProxyClass extends UserDumpType, ProxyClass {
override string getIdentityString() {
result = getName()
}
}
private class DumpVariable extends DumpDeclaration, Variable {
override string getIdentityString() {
exists(DumpType type |