@@ -47,15 +47,15 @@ enum class LifetimeDependenceKind : uint8_t { Inherit = 0, Scope };
47
47
struct LifetimeDescriptor {
48
48
union Value {
49
49
struct {
50
- StringRef name;
50
+ Identifier name;
51
51
} Named;
52
52
struct {
53
53
unsigned index;
54
54
bool isAddress;
55
55
} Ordered;
56
56
struct {
57
57
} Self;
58
- Value (StringRef name) : Named ({name}) {}
58
+ Value (Identifier name) : Named ({name}) {}
59
59
Value (unsigned index, bool isAddress) : Ordered ({index, isAddress}) {}
60
60
Value () : Self () {}
61
61
} value;
@@ -67,7 +67,7 @@ struct LifetimeDescriptor {
67
67
SourceLoc loc;
68
68
69
69
private:
70
- LifetimeDescriptor (StringRef name,
70
+ LifetimeDescriptor (Identifier name,
71
71
ParsedLifetimeDependenceKind parsedLifetimeDependenceKind,
72
72
SourceLoc loc)
73
73
: value{name}, kind(DescriptorKind::Named),
@@ -84,7 +84,7 @@ struct LifetimeDescriptor {
84
84
85
85
public:
86
86
static LifetimeDescriptor
87
- forNamed (StringRef name,
87
+ forNamed (Identifier name,
88
88
ParsedLifetimeDependenceKind parsedLifetimeDependenceKind,
89
89
SourceLoc loc) {
90
90
return {name, parsedLifetimeDependenceKind, loc};
@@ -106,7 +106,7 @@ struct LifetimeDescriptor {
106
106
return parsedLifetimeDependenceKind;
107
107
}
108
108
109
- StringRef getName () const {
109
+ Identifier getName () const {
110
110
assert (kind == DescriptorKind::Named);
111
111
return value.Named .name ;
112
112
}
@@ -130,13 +130,13 @@ struct LifetimeDescriptor {
130
130
if (getDescriptorKind () != LifetimeDescriptor::DescriptorKind::Named) {
131
131
return false ;
132
132
}
133
- return getName () == " immortal" ;
133
+ return getName (). str () == " immortal" ;
134
134
}
135
135
136
136
std::string getString () const {
137
137
switch (kind) {
138
138
case DescriptorKind::Named:
139
- return getName ().str ();
139
+ return getName ().str (). str () ;
140
140
case DescriptorKind::Ordered:
141
141
return std::to_string (getIndex ());
142
142
case DescriptorKind::Self:
0 commit comments