File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -166,6 +166,7 @@ class LifetimeDependenceInfo {
166166
167167 std::string getString () const ;
168168 void Profile (llvm::FoldingSetNodeID &ID) const ;
169+ void getConcatenatedData (SmallVectorImpl<bool > &concatenatedData) const ;
169170
170171 static llvm::Optional<LifetimeDependenceInfo>
171172 get (AbstractFunctionDecl *decl, Type resultType, bool allowIndex = false );
Original file line number Diff line number Diff line change @@ -85,6 +85,33 @@ LifetimeDependenceInfo LifetimeDependenceInfo::getForParamIndex(
8585 /* mutateLifetimeParamIndices*/ indexSubset};
8686}
8787
88+ void LifetimeDependenceInfo::getConcatenatedData (
89+ SmallVectorImpl<bool > &concatenatedData) const {
90+ auto pushData = [&](IndexSubset *paramIndices) {
91+ if (paramIndices == nullptr ) {
92+ return ;
93+ }
94+ assert (!paramIndices->isEmpty ());
95+
96+ for (auto i = 0 ; i < paramIndices->getCapacity (); i++) {
97+ if (paramIndices->contains (i)) {
98+ concatenatedData.push_back (true );
99+ continue ;
100+ }
101+ concatenatedData.push_back (false );
102+ }
103+ };
104+ if (hasInheritLifetimeParamIndices ()) {
105+ pushData (inheritLifetimeParamIndices);
106+ }
107+ if (hasBorrowLifetimeParamIndices ()) {
108+ pushData (borrowLifetimeParamIndices);
109+ }
110+ if (hasMutateLifetimeParamIndices ()) {
111+ pushData (mutateLifetimeParamIndices);
112+ }
113+ }
114+
88115llvm::Optional<LifetimeDependenceInfo>
89116LifetimeDependenceInfo::fromTypeRepr (AbstractFunctionDecl *afd, Type resultType,
90117 bool allowIndex) {
You can’t perform that action at this time.
0 commit comments