Lines Matching full:entries

279   // Fast path: we can just add entries to the end.
280 if (Entries.empty() || Entries.back().End <= begin) {
281 Entries.push_back({begin, end, type});
286 // TODO: do a binary search if Entries is big enough for it to matter.
287 size_t index = Entries.size() - 1;
289 if (Entries[index - 1].End <= begin) break;
295 if (Entries[index].Begin >= end) {
299 Entries.insert(Entries.begin() + index, {begin, end, type});
308 if (Entries[index].Begin == begin && Entries[index].End == end) {
310 if (Entries[index].Type == type) return;
313 if (Entries[index].Type == nullptr) {
316 Entries[index].Type = nullptr;
322 if (auto entryType = getCommonType(Entries[index].Type, type)) {
323 Entries[index].Type = entryType;
328 Entries[index].Type = nullptr;
351 if (Entries[index].Type && Entries[index].Type->isVectorTy()) {
358 Entries[index].Type = nullptr;
361 if (begin < Entries[index].Begin) {
362 Entries[index].Begin = begin;
363 assert(index == 0 || begin >= Entries[index - 1].End);
368 while (end > Entries[index].End) {
369 assert(Entries[index].Type == nullptr);
372 if (index == Entries.size() - 1 || end <= Entries[index + 1].Begin) {
373 Entries[index].End = end;
378 Entries[index].End = Entries[index + 1].Begin;
384 if (Entries[index].Type == nullptr)
387 // Split vector entries unless we completely subsume them.
388 if (Entries[index].Type->isVectorTy() &&
389 end < Entries[index].End) {
394 Entries[index].Type = nullptr;
401 auto vecTy = cast<llvm::VectorType>(Entries[index].Type);
402 auto split = splitLegalVectorType(CGM, Entries[index].getWidth(), vecTy);
407 Entries.insert(Entries.begin() + index + 1, numElts - 1, StorageEntry());
409 CharUnits begin = Entries[index].Begin;
412 Entries[idx].Type = eltTy;
413 Entries[idx].Begin = begin;
414 Entries[idx].End = begin + eltSize;
458 // Only merge entries that overlap the same chunk. We test this first
470 if (Entries.empty()) {
479 // First pass: if two entries should be merged, make them both opaque
481 // Also, remember if there are any opaque entries.
482 bool hasOpaqueEntries = (Entries[0].Type == nullptr);
483 for (size_t i = 1, e = Entries.size(); i != e; ++i) {
484 if (shouldMergeEntries(Entries[i - 1], Entries[i], chunkSize)) {
485 Entries[i - 1].Type = nullptr;
486 Entries[i].Type = nullptr;
487 Entries[i - 1].End = Entries[i].Begin;
490 } else if (Entries[i].Type == nullptr) {
495 // The rest of the algorithm leaves non-opaque entries alone, so if we
496 // have no opaque entries, we're done.
502 // Okay, move the entries to a temporary and rebuild Entries.
503 auto orig = std::move(Entries);
504 assert(Entries.empty());
507 // Just copy over non-opaque entries.
509 Entries.push_back(orig[i]);
549 Entries.push_back({unitBegin, unitEnd, entryTy});
563 for (auto &entry : Entries) {
574 if (Entries.empty()) {
583 for (auto &entry : Entries) {
611 for (auto &entry : Entries) {
619 } else if (Entries.size() == 1) {
620 unpaddedType = Entries[0].Type;
630 if (Entries.empty()) return false;
633 if (Entries.size() == 1) {
634 return getSwiftABIInfo(CGM).shouldPassIndirectly(Entries.back().Type,
639 componentTys.reserve(Entries.size());
640 for (auto &entry : Entries) {