@@ -47,15 +47,15 @@ enum class LifetimeDependenceKind : uint8_t { Inherit = 0, Scope };
4747struct LifetimeDescriptor {
4848 union Value {
4949 struct {
50- StringRef name;
50+ Identifier name;
5151 } Named;
5252 struct {
5353 unsigned index;
5454 bool isAddress;
5555 } Ordered;
5656 struct {
5757 } Self;
58- Value (StringRef name) : Named ({name}) {}
58+ Value (Identifier name) : Named ({name}) {}
5959 Value (unsigned index, bool isAddress) : Ordered ({index, isAddress}) {}
6060 Value () : Self () {}
6161 } value;
@@ -67,7 +67,7 @@ struct LifetimeDescriptor {
6767 SourceLoc loc;
6868
6969private:
70- LifetimeDescriptor (StringRef name,
70+ LifetimeDescriptor (Identifier name,
7171 ParsedLifetimeDependenceKind parsedLifetimeDependenceKind,
7272 SourceLoc loc)
7373 : value{name}, kind(DescriptorKind::Named),
@@ -84,7 +84,7 @@ struct LifetimeDescriptor {
8484
8585public:
8686 static LifetimeDescriptor
87- forNamed (StringRef name,
87+ forNamed (Identifier name,
8888 ParsedLifetimeDependenceKind parsedLifetimeDependenceKind,
8989 SourceLoc loc) {
9090 return {name, parsedLifetimeDependenceKind, loc};
@@ -106,7 +106,7 @@ struct LifetimeDescriptor {
106106 return parsedLifetimeDependenceKind;
107107 }
108108
109- StringRef getName () const {
109+ Identifier getName () const {
110110 assert (kind == DescriptorKind::Named);
111111 return value.Named .name ;
112112 }
@@ -130,13 +130,13 @@ struct LifetimeDescriptor {
130130 if (getDescriptorKind () != LifetimeDescriptor::DescriptorKind::Named) {
131131 return false ;
132132 }
133- return getName () == " immortal" ;
133+ return getName (). str () == " immortal" ;
134134 }
135135
136136 std::string getString () const {
137137 switch (kind) {
138138 case DescriptorKind::Named:
139- return getName ().str ();
139+ return getName ().str (). str () ;
140140 case DescriptorKind::Ordered:
141141 return std::to_string (getIndex ());
142142 case DescriptorKind::Self:
0 commit comments