| 149 | //----------------------------------------------------------------------------- |
| 150 | |
| 151 | bool LifetimeTracker::EndScope(OutputFormatHelper& ofm, bool coveredByReturn) |
| 152 | { |
| 153 | RETURN_FALSE_IF(not GetInsightsOptions().ShowLifetime or objects.empty()) |
| 154 | |
| 155 | bool ret{}; |
| 156 | |
| 157 | if(not coveredByReturn) { |
| 158 | for(auto& e : llvm::reverse(objects)) { |
| 159 | if(e.scope != scopeCounter) { |
| 160 | break; |
| 161 | } |
| 162 | |
| 163 | if(nullptr == e.item) { |
| 164 | break; |
| 165 | } |
| 166 | |
| 167 | InsertDtorCall(e.item, ofm); |
| 168 | ret = true; |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | removeTop(); |
| 173 | |
| 174 | return ret; |
| 175 | } |
| 176 | //----------------------------------------------------------------------------- |
| 177 | |
| 178 | } // namespace clang::insights |
no test coverage detected