Home
last modified time | relevance | path

Searched refs:CharUnits (Results 1 – 25 of 87) sorted by relevance

1234

/external/clang/include/clang/AST/
DCharUnits.h38 class CharUnits {
45 explicit CharUnits(QuantityType C) : Quantity(C) {} in CharUnits() function
50 CharUnits() : Quantity(0) {} in CharUnits() function
53 static CharUnits Zero() { in Zero()
54 return CharUnits(0); in Zero()
58 static CharUnits One() { in One()
59 return CharUnits(1); in One()
63 static CharUnits fromQuantity(QuantityType Quantity) { in fromQuantity()
64 return CharUnits(Quantity); in fromQuantity()
68 CharUnits& operator+= (const CharUnits &Other) {
[all …]
DRecordLayout.h39 CharUnits VBaseOffset;
52 VBaseInfo(CharUnits VBaseOffset, bool hasVtorDisp) : in VBaseInfo()
61 CharUnits Size;
64 CharUnits DataSize;
67 CharUnits Alignment;
71 CharUnits RequiredAlignment;
80 CharUnits NonVirtualSize;
84 CharUnits NonVirtualAlignment;
89 CharUnits SizeOfLargestEmptySubobject;
92 CharUnits VBPtrOffset;
[all …]
DVTableBuilder.h56 static VTableComponent MakeVCallOffset(CharUnits Offset) { in MakeVCallOffset()
60 static VTableComponent MakeVBaseOffset(CharUnits Offset) { in MakeVBaseOffset()
64 static VTableComponent MakeOffsetToTop(CharUnits Offset) { in MakeOffsetToTop()
106 CharUnits getVCallOffset() const { in getVCallOffset()
112 CharUnits getVBaseOffset() const { in getVBaseOffset()
118 CharUnits getOffsetToTop() const { in getOffsetToTop()
175 VTableComponent(Kind ComponentKind, CharUnits Offset) { in VTableComponent()
194 CharUnits getOffset() const { in getOffset()
198 return CharUnits::fromQuantity(Value >> 3); in getOffset()
353 typedef llvm::DenseMap<ClassPairTy, CharUnits>
[all …]
DBaseSubobject.h32 CharUnits BaseOffset;
36 BaseSubobject(const CXXRecordDecl *Base, CharUnits BaseOffset) in BaseSubobject()
43 CharUnits getBaseOffset() const { return BaseOffset; } in getBaseOffset()
58 clang::CharUnits::fromQuantity(DenseMapInfo<int64_t>::getEmptyKey()));
64 clang::CharUnits::fromQuantity(DenseMapInfo<int64_t>::getTombstoneKey()));
68 typedef std::pair<const clang::CXXRecordDecl *, clang::CharUnits> PairTy;
/external/clang/include/clang/CodeGen/
DSwiftCallingConv.h47 CharUnits Begin;
48 CharUnits End;
51 CharUnits getWidth() const { in getWidth()
61 void addOpaqueData(CharUnits begin, CharUnits end) { in addOpaqueData()
65 void addTypedData(QualType type, CharUnits begin);
66 void addTypedData(const RecordDecl *record, CharUnits begin);
67 void addTypedData(const RecordDecl *record, CharUnits begin,
69 void addTypedData(llvm::Type *type, CharUnits begin);
70 void addTypedData(llvm::Type *type, CharUnits begin, CharUnits end);
94 llvm::function_ref<void(CharUnits offset, llvm::Type *type)>;
[all …]
/external/clang/lib/AST/
DRecordLayoutBuilder.cpp73 llvm::DenseMap<const CXXRecordDecl *, CharUnits> BaseOffsets;
76 llvm::DenseMap<const CXXRecordDecl *, CharUnits> VirtualBaseOffsets;
86 bool getExternalNVBaseOffset(const CXXRecordDecl *RD, CharUnits &BaseOffset) { in getExternalNVBaseOffset()
94 bool getExternalVBaseOffset(const CXXRecordDecl *RD, CharUnits &BaseOffset) { in getExternalVBaseOffset()
114 typedef llvm::DenseMap<CharUnits, ClassVectorTy> EmptyClassOffsetsMapTy;
119 CharUnits MaxEmptyClassOffset;
125 void AddSubobjectAtOffset(const CXXRecordDecl *RD, CharUnits Offset);
128 CharUnits Offset, bool PlacingEmptyBase);
132 CharUnits Offset);
133 void UpdateEmptyFieldSubobjects(const FieldDecl *FD, CharUnits Offset);
[all …]
DRecordLayout.cpp29 ASTRecordLayout::ASTRecordLayout(const ASTContext &Ctx, CharUnits size, in ASTRecordLayout()
30 CharUnits alignment, in ASTRecordLayout()
31 CharUnits requiredAlignment, in ASTRecordLayout()
32 CharUnits datasize, in ASTRecordLayout()
41 CharUnits size, CharUnits alignment, in ASTRecordLayout()
42 CharUnits requiredAlignment, in ASTRecordLayout()
44 CharUnits vbptroffset, in ASTRecordLayout()
45 CharUnits datasize, in ASTRecordLayout()
47 CharUnits nonvirtualsize, in ASTRecordLayout()
48 CharUnits nonvirtualalignment, in ASTRecordLayout()
[all …]
DVTableBuilder.cpp48 CharUnits NonVirtualOffset;
51 NonVirtualOffset(CharUnits::Zero()) { } in BaseOffset()
53 const CXXRecordDecl *VirtualBase, CharUnits NonVirtualOffset) in BaseOffset()
74 CharUnits Offset;
77 Offset(CharUnits::Zero()) { } in OverriderInfo()
88 const CharUnits MostDerivedClassOffset;
102 typedef std::pair<const CXXMethodDecl *, CharUnits> MethodBaseOffsetPairTy;
115 CharUnits> SubobjectOffsetMapTy;
122 CharUnits OffsetInLayoutClass,
136 CharUnits MostDerivedClassOffset,
[all …]
DVTTBuilder.cpp35 LayoutVTT(BaseSubobject(MostDerivedClass, CharUnits::Zero()), in VTTBuilder()
68 CharUnits BaseOffset = Base.getBaseOffset() + in LayoutSecondaryVTTs()
105 CharUnits BaseOffset; in LayoutSecondaryVirtualPointers()
163 CharUnits BaseOffset = in LayoutVirtualVTTs()
/external/clang/lib/CodeGen/
DCodeGenTypeCache.h69 CharUnits getIntSize() const { in getIntSize()
70 return CharUnits::fromQuantity(IntSizeInBytes); in getIntSize()
72 CharUnits getIntAlign() const { in getIntAlign()
73 return CharUnits::fromQuantity(IntAlignInBytes); in getIntAlign()
86 CharUnits getSizeSize() const { in getSizeSize()
87 return CharUnits::fromQuantity(SizeSizeInBytes); in getSizeSize()
89 CharUnits getSizeAlign() const { in getSizeAlign()
90 return CharUnits::fromQuantity(SizeAlignInBytes); in getSizeAlign()
92 CharUnits getPointerSize() const { in getPointerSize()
93 return CharUnits::fromQuantity(PointerSizeInBytes); in getPointerSize()
[all …]
DSwiftCallingConv.cpp56 static CharUnits getTypeStoreSize(CodeGenModule &CGM, llvm::Type *type) { in getTypeStoreSize()
57 return CharUnits::fromQuantity(CGM.getDataLayout().getTypeStoreSize(type)); in getTypeStoreSize()
60 void SwiftAggLowering::addTypedData(QualType type, CharUnits begin) { in addTypedData()
102 void SwiftAggLowering::addTypedData(const RecordDecl *record, CharUnits begin) { in addTypedData()
106 void SwiftAggLowering::addTypedData(const RecordDecl *record, CharUnits begin, in addTypedData()
168 CharUnits recordBegin, in addBitFieldData()
178 CharUnits bitfieldByteBegin = ctx.toCharUnitsFromBits(bitfieldBitBegin); in addBitFieldData()
184 CharUnits bitfieldByteEnd = in addBitFieldData()
185 ctx.toCharUnitsFromBits(bitfieldBitLast) + CharUnits::One(); in addBitFieldData()
190 void SwiftAggLowering::addTypedData(llvm::Type *type, CharUnits begin) { in addTypedData()
[all …]
DCGRecordLayoutBuilder.cpp79 CharUnits Offset;
86 MemberInfo(CharUnits Offset, InfoKind Kind, llvm::Type *Data, in MemberInfo()
89 MemberInfo(CharUnits Offset, InfoKind Kind, llvm::Type *Data, in MemberInfo()
99 MemberInfo StorageInfo(CharUnits Offset, llvm::Type *Data) { in StorageInfo()
127 llvm::Type *getByteArrayType(CharUnits NumBytes) { in getByteArrayType()
130 return NumBytes == CharUnits::One() ? Type : in getByteArrayType()
146 CharUnits bitsToCharUnits(uint64_t BitOffset) { in bitsToCharUnits()
149 CharUnits getSize(llvm::Type *Type) { in getSize()
150 return CharUnits::fromQuantity(DataLayout.getTypeAllocSize(Type)); in getSize()
152 CharUnits getAlignment(llvm::Type *Type) { in getAlignment()
[all …]
DCGBuilder.h61 llvm::ConstantInt *getSize(CharUnits N) { in getSize()
91 llvm::LoadInst *CreateAlignedLoad(llvm::Value *Addr, CharUnits Align,
95 llvm::LoadInst *CreateAlignedLoad(llvm::Value *Addr, CharUnits Align, in CreateAlignedLoad()
100 CharUnits Align,
105 llvm::LoadInst *CreateAlignedLoad(llvm::Value *Addr, CharUnits Align,
121 CharUnits Align, bool IsVolatile = false) {
150 return CreateAlignedLoad(getInt1Ty(), Addr, CharUnits::One(), Name);
156 return CreateAlignedStore(getInt1(Value), Addr, CharUnits::One()); in CreateFlagStore()
183 Address CreateStructGEP(Address Addr, unsigned Index, CharUnits Offset,
192 auto Offset = CharUnits::fromQuantity(Layout->getElementOffset(Index));
[all …]
DCGBlocks.h148 CharUnits ByrefAlignment;
149 CharUnits FieldOffset;
164 CharUnits::QuantityType Offset;
174 CharUnits getOffset() const { in getOffset()
176 return CharUnits::fromQuantity(Offset); in getOffset()
192 static Capture makeIndex(unsigned index, CharUnits offset) { in makeIndex()
232 CharUnits BlockSize;
233 CharUnits BlockAlign;
234 CharUnits CXXThisOffset;
239 CharUnits BlockHeaderForcedGapOffset;
[all …]
DCGCXXABI.cpp143 CharUnits offset) { in EmitMemberDataPointer()
193 CharUnits CGCXXABI::GetArrayCookieSize(const CXXNewExpr *expr) { in GetArrayCookieSize()
195 return CharUnits::Zero(); in GetArrayCookieSize()
199 CharUnits CGCXXABI::getArrayCookieSizeImpl(QualType elementType) { in getArrayCookieSizeImpl()
201 return CharUnits::Zero(); in getArrayCookieSizeImpl()
236 llvm::Value *&allocPtr, CharUnits &cookieSize) { in ReadArrayCookie()
244 cookieSize = CharUnits::Zero(); in ReadArrayCookie()
257 CharUnits cookieSize) { in readArrayCookieImpl()
283 CharUnits CGCXXABI::getMemberPointerPathAdjustment(const APValue &MP) { in getMemberPointerPathAdjustment()
287 CharUnits ThisAdjustment = CharUnits::Zero(); in getMemberPointerPathAdjustment()
[all …]
DAddress.h27 CharUnits Alignment;
29 Address(llvm::Value *pointer, CharUnits alignment) in Address()
35 static Address invalid() { return Address(nullptr, CharUnits()); } in invalid()
67 CharUnits getAlignment() const { in getAlignment()
77 ConstantAddress(llvm::Constant *pointer, CharUnits alignment) in ConstantAddress()
81 return ConstantAddress(nullptr, CharUnits()); in invalid()
DCGExprConstant.cpp42 CharUnits NextFieldOffsetInChars;
43 CharUnits LLVMStructAlignment;
58 NextFieldOffsetInChars(CharUnits::Zero()), in ConstStructBuilder()
59 LLVMStructAlignment(CharUnits::One()) { } in ConstStructBuilder()
64 void AppendBytes(CharUnits FieldOffsetInChars, llvm::Constant *InitCst);
69 void AppendPadding(CharUnits PadSize);
71 void AppendTailPadding(CharUnits RecordSize);
79 const CXXRecordDecl *VTableClass, CharUnits BaseOffset);
82 CharUnits getAlignment(const llvm::Constant *C) const { in getAlignment()
83 if (Packed) return CharUnits::One(); in getAlignment()
[all …]
DTargetInfo.cpp68 Builder.CreateAlignedStore(Value, Cell, CharUnits::One()); in AssignToArrayRange()
129 bool SwiftABIInfo::isLegalVectorTypeForSwift(CharUnits vectorSize, in isLegalVectorTypeForSwift()
243 CharUnits Align) { in emitRoundPointerUpToAlignment()
274 CharUnits DirectSize, in emitVoidPtrDirectVAArg()
275 CharUnits DirectAlign, in emitVoidPtrDirectVAArg()
276 CharUnits SlotSize, in emitVoidPtrDirectVAArg()
295 CharUnits FullDirectSize = DirectSize.alignTo(SlotSize); in emitVoidPtrDirectVAArg()
327 std::pair<CharUnits, CharUnits> ValueInfo, in emitVoidPtrVAArg() argument
328 CharUnits SlotSizeAndAlign, in emitVoidPtrVAArg()
331 CharUnits DirectSize, DirectAlign; in emitVoidPtrVAArg()
[all …]
DCGExprCXX.cpp361 CharUnits NVSize = Layout.getNonVirtualSize(); in EmitNullBaseClassInitialization()
366 SmallVector<std::pair<CharUnits, CharUnits>, 1> Stores; in EmitNullBaseClassInitialization()
367 Stores.emplace_back(CharUnits::Zero(), NVSize); in EmitNullBaseClassInitialization()
370 CharUnits VBPtrWidth = CGF.getPointerSize(); in EmitNullBaseClassInitialization()
371 std::vector<CharUnits> VBPtrOffsets = in EmitNullBaseClassInitialization()
373 for (CharUnits VBPtrOffset : VBPtrOffsets) { in EmitNullBaseClassInitialization()
377 std::pair<CharUnits, CharUnits> LastStore = Stores.pop_back_val(); in EmitNullBaseClassInitialization()
378 CharUnits LastStoreOffset = LastStore.first; in EmitNullBaseClassInitialization()
379 CharUnits LastStoreSize = LastStore.second; in EmitNullBaseClassInitialization()
381 CharUnits SplitBeforeOffset = LastStoreOffset; in EmitNullBaseClassInitialization()
[all …]
DCGCXXABI.h196 CharUnits offset);
227 CharUnits getMemberPointerPathAdjustment(const APValue &MP);
341 virtual CharUnits getVirtualFunctionPrologueThisAdjustment(GlobalDecl GD) { in getVirtualFunctionPrologueThisAdjustment()
342 return CharUnits::Zero(); in getVirtualFunctionPrologueThisAdjustment()
403 CharUnits VPtrOffset) = 0;
445 virtual std::vector<CharUnits> getVBPtrOffsets(const CXXRecordDecl *RD);
464 virtual CharUnits GetArrayCookieSize(const CXXNewExpr *expr);
497 llvm::Value *&AllocPtr, CharUnits &CookieSize);
506 virtual CharUnits getArrayCookieSizeImpl(QualType elementType);
518 CharUnits cookieSize);
DCGBlocks.cpp192 CharUnits Alignment;
193 CharUnits Size;
198 BlockLayoutChunk(CharUnits align, CharUnits size, in BlockLayoutChunk()
206 void setIndex(CGBlockInfo &info, unsigned index, CharUnits offset) { in setIndex()
294 static CharUnits getLowBit(CharUnits v) { in getLowBit()
295 return CharUnits::fromQuantity(v.getQuantity() & (~v.getQuantity() + 1)); in getLowBit()
344 CharUnits maxFieldAlign; in computeBlockInfo()
355 std::pair<CharUnits,CharUnits> tinfo in computeBlockInfo()
373 CharUnits align = CGM.getPointerAlign(); in computeBlockInfo()
434 CharUnits size = C.getTypeSizeInChars(VT); in computeBlockInfo()
[all …]
DCGClass.cpp36 CharUnits CodeGenModule::getClassPointerAlignment(const CXXRecordDecl *RD) { in getClassPointerAlignment()
38 return CharUnits::One(); // Hopefully won't be used anywhere. in getClassPointerAlignment()
55 CharUnits CodeGenModule::getVBaseAlignment(CharUnits actualDerivedAlign, in getVBaseAlignment()
63 CharUnits expectedVBaseAlign = baseLayout.getNonVirtualAlignment(); in getVBaseAlignment()
69 CharUnits
70 CodeGenModule::getDynamicOffsetAlignment(CharUnits actualBaseAlign, in getDynamicOffsetAlignment()
72 CharUnits expectedTargetAlign) { in getDynamicOffsetAlignment()
79 CharUnits expectedBaseAlign = baseLayout.getNonVirtualAlignment(); in getDynamicOffsetAlignment()
139 CharUnits memberAlign = getNaturalTypeAlignment(memberType, alignSource); in EmitCXXMemberDataPointerAddress()
147 CharUnits CodeGenModule::computeNonVirtualBaseClassOffset( in computeNonVirtualBaseClassOffset()
[all …]
DCGObjCMac.cpp801 CharUnits block_var_bytepos;
802 CharUnits block_var_size;
804 CharUnits BytePos = CharUnits::Zero(), in RUN_SKIP()
805 CharUnits Size = CharUnits::Zero()) in RUN_SKIP()
924 CharUnits beginOffset,
925 CharUnits endOffset,
930 CharUnits beginOffset, in BuildStrongIvarLayout()
931 CharUnits endOffset) { in BuildStrongIvarLayout()
936 CharUnits beginOffset, in BuildWeakIvarLayout()
937 CharUnits endOffset, in BuildWeakIvarLayout()
[all …]
/external/clang/lib/StaticAnalyzer/Checkers/
DPaddingChecker.cpp82 CharUnits BaselinePad = calculateBaselinePad(RD, ASTContext, RL); in visitRecord()
85 CharUnits OptimalPad = calculateOptimalPad(RD, ASTContext, RL); in visitRecord()
87 CharUnits DiffPad = PadMultiplier * (BaselinePad - OptimalPad); in visitRecord()
166 static CharUnits calculateBaselinePad(const RecordDecl *RD, in calculateBaselinePad()
169 CharUnits PaddingSum; in calculateBaselinePad()
170 CharUnits Offset = ASTContext.toCharUnitsFromBits(RL.getFieldOffset(0)); in calculateBaselinePad()
176 CharUnits FieldSize = ASTContext.getTypeSizeInChars(FD->getType()); in calculateBaselinePad()
178 CharUnits FieldOffset = ASTContext.toCharUnitsFromBits(FieldOffsetBits); in calculateBaselinePad()
202 static CharUnits calculateOptimalPad(const RecordDecl *RD, in calculateOptimalPad()
206 CharUnits Align; in calculateOptimalPad()
[all …]
DCastSizeChecker.cpp49 static bool evenFlexibleArraySize(ASTContext &Ctx, CharUnits RegionSize, in evenFlexibleArraySize()
50 CharUnits TypeSize, QualType ToPointeeTy) { in evenFlexibleArraySize()
64 CharUnits FlexSize; in evenFlexibleArraySize()
81 CharUnits Left = RegionSize - TypeSize; in evenFlexibleArraySize()
118 CharUnits regionSize = CharUnits::fromQuantity(extentInt->getSExtValue()); in checkPreStmt()
119 CharUnits typeSize = C.getASTContext().getTypeSizeInChars(ToPointeeTy); in checkPreStmt()

1234