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

@@ -37,7 +37,7 @@ const uint16_t VERSION_MAJOR = 0;
/// Serialized module format minor version number.
///
/// When the format changes IN ANY WAY, this number should be incremented.
const uint16_t VERSION_MINOR = 14;
const uint16_t VERSION_MINOR = 21;
using DeclID = Fixnum<31>;
using DeclIDField = BCFixed<31>;
@@ -172,7 +172,8 @@ enum DefaultArgumentKind : uint8_t {
Normal,
File,
Line,
Column
Column,
Function,
};
using DefaultArgumentField = BCFixed<3>;