Lines Matching +full:max +full:- +full:rt

1 //===--- Program.cpp - Bytecode for the constexpr VM ------------*- C++ -*-===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
24 return It->second; in getOrCreateNativePointer()
37 const size_t CharWidth = S->getCharByteWidth(); in createGlobalString()
57 allocateDescriptor(S, CharType, Descriptor::GlobalMD, S->getLength() + 1, in createGlobalString()
65 unsigned Sz = Desc->getAllocSize(); in createGlobalString()
68 G->block()->invokeCtor(); in createGlobalString()
70 new (G->block()->rawData()) InlineDescriptor(Desc); in createGlobalString()
74 const Pointer Ptr(G->block()); in createGlobalString()
75 for (unsigned I = 0, N = S->getLength(); I <= N; ++I) { in createGlobalString()
77 const uint32_t CodePoint = I == N ? 0 : S->getCodeUnit(I); in createGlobalString()
106 return Pointer(Globals[Idx]->block()); in getPtrGlobal()
111 return It->second; in getGlobal()
115 for (const Decl *P = VD->getPreviousDecl(); P; P = P->getPreviousDecl()) { in getGlobal()
117 Index = It->second; in getGlobal()
131 return It->second; in getGlobal()
150 return It->second; in getOrCreateDummy()
152 QualType QT = VD->getType(); in getOrCreateDummy()
153 if (const auto *RT = QT->getAs<ReferenceType>()) in getOrCreateDummy() local
154 QT = RT->getPointeeType(); in getOrCreateDummy()
165 Desc->makeDummy(); in getOrCreateDummy()
167 assert(Desc->isDummy()); in getOrCreateDummy()
172 auto *G = new (Allocator, Desc->getAllocSize()) in getOrCreateDummy()
175 G->block()->invokeCtor(); in getOrCreateDummy()
187 IsExtern = Var->hasExternalStorage(); in createGlobal()
196 if (auto Idx = createGlobal(VD, VD->getType(), IsStatic, IsExtern, Init)) { in createGlobal()
197 for (const Decl *P = VD; P; P = P->getPreviousDecl()) in createGlobal()
207 if (auto Idx = createGlobal(E, E->getType(), /*isStatic=*/true, in createGlobal()
234 auto *G = new (Allocator, Desc->getAllocSize()) in createGlobal()
236 G->block()->invokeCtor(); in createGlobal()
239 auto *GD = new (G->block()->rawData()) GlobalInlineDescriptor(); in createGlobal()
241 GD->InitState = GlobalInitState::NoInitializer; in createGlobal()
248 F = F->getCanonicalDecl(); in getFunction()
251 return It == Funcs.end() ? nullptr : It->second.get(); in getFunction()
256 RD = RD->getDefinition(); in getOrCreateRecord()
260 if (!RD->isCompleteDefinition()) in getOrCreateRecord()
265 return It->second; in getOrCreateRecord()
279 const Record *BR) -> const Descriptor * { in getOrCreateRecord()
291 for (const CXXBaseSpecifier &Spec : CD->bases()) { in getOrCreateRecord()
296 const auto *RT = Spec.getType()->getAs<RecordType>(); in getOrCreateRecord() local
297 if (!RT) in getOrCreateRecord()
299 const RecordDecl *BD = RT->getDecl(); in getOrCreateRecord()
308 BaseSize += align(BR->getSize()); in getOrCreateRecord()
311 for (const CXXBaseSpecifier &Spec : CD->vbases()) { in getOrCreateRecord()
312 const auto *RT = Spec.getType()->getAs<RecordType>(); in getOrCreateRecord() local
313 if (!RT) in getOrCreateRecord()
316 const RecordDecl *BD = RT->getDecl(); in getOrCreateRecord()
325 VirtSize += align(BR->getSize()); in getOrCreateRecord()
331 for (const FieldDecl *FD : RD->fields()) { in getOrCreateRecord()
340 QualType FT = FD->getType(); in getOrCreateRecord()
342 const bool IsMutable = FD->isMutable(); in getOrCreateRecord()
354 BaseSize += align(Desc->getAllocSize()); in getOrCreateRecord()
369 if (const auto *RT = Ty->getAs<RecordType>()) { in createDescriptor() local
370 if (const auto *Record = getOrCreateRecord(RT->getDecl())) in createDescriptor()
376 if (const auto ArrayType = Ty->getAsArrayTypeUnsafe()) { in createDescriptor()
377 QualType ElemTy = ArrayType->getElementType(); in createDescriptor()
378 // Array of well-known bounds. in createDescriptor()
380 size_t NumElems = CAT->getZExtSize(); in createDescriptor()
384 if (std::numeric_limits<unsigned>::max() / ElemSize <= NumElems) { in createDescriptor()
397 ElemDesc->getAllocSize() + sizeof(InlineDescriptor); in createDescriptor()
398 if (std::numeric_limits<unsigned>::max() / ElemSize <= NumElems) in createDescriptor()
405 // Array of unknown bounds - cannot be accessed and pointer arithmetic in createDescriptor()
424 if (const auto *AT = Ty->getAs<AtomicType>()) { in createDescriptor()
425 const Type *InnerTy = AT->getValueType().getTypePtr(); in createDescriptor()
430 // Complex types - represented as arrays of elements. in createDescriptor()
431 if (const auto *CT = Ty->getAs<ComplexType>()) { in createDescriptor()
432 PrimType ElemTy = *Ctx.classify(CT->getElementType()); in createDescriptor()
438 if (const auto *VT = Ty->getAs<VectorType>()) { in createDescriptor()
439 PrimType ElemTy = *Ctx.classify(VT->getElementType()); in createDescriptor()
440 return allocateDescriptor(D, ElemTy, MDSize, VT->getNumElements(), IsConst, in createDescriptor()