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 {
166
166
167
167
std::string getString () const ;
168
168
void Profile (llvm::FoldingSetNodeID &ID) const ;
169
+ void getConcatenatedData (SmallVectorImpl<bool > &concatenatedData) const ;
169
170
170
171
static llvm::Optional<LifetimeDependenceInfo>
171
172
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(
85
85
/* mutateLifetimeParamIndices*/ indexSubset};
86
86
}
87
87
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
+
88
115
llvm::Optional<LifetimeDependenceInfo>
89
116
LifetimeDependenceInfo::fromTypeRepr (AbstractFunctionDecl *afd, Type resultType,
90
117
bool allowIndex) {
You can’t perform that action at this time.
0 commit comments