Add __FUNCTION__ as a magic literal identifier.

Add __FUNCTION__ to the repertoire of magic source-location-identifying tokens. Inside a function, it gives the function name; inside a property accessor, it gives the property name; inside special members like 'init', 'subscript', and 'deinit', it gives the keyword name, and at top level, it gives the module name. As a bit of future-proofing, stringify the full DeclName, even though we only ever give declarations simple names currently.

Swift SVN r14710
This commit is contained in:
Joe Groff
2014-03-06 01:06:06 +00:00
parent 4a827b7de4
commit 9e5bc637ae
16 changed files with 213 additions and 42 deletions

View File

@@ -449,6 +449,8 @@ static uint8_t getRawStableDefaultArgumentKind(swift::DefaultArgumentKind kind)
return serialization::DefaultArgumentKind::File;
case swift::DefaultArgumentKind::Line:
return serialization::DefaultArgumentKind::Line;
case swift::DefaultArgumentKind::Function:
return serialization::DefaultArgumentKind::Function;
}
}