return getTypeInfo(T).first;
}
- /// getByteWidth - Return the size of a byte, in bits
- uint64_t getByteSize() {
+ /// getCharWidth - Return the size of the character type, in bits
+ uint64_t getCharWidth() {
return getTypeSize(CharTy);
}
- /// getTypeSizeInBytes - Return the size of the specified type, in bytes.
+ /// getTypeSizeInChars - Return the size of the specified type, in characters.
/// This method does not work on incomplete types.
- uint64_t getTypeSizeInBytes(QualType T) {
- return getTypeSize(T) / getByteSize();
+ uint64_t getTypeSizeInChars(QualType T) {
+ return getTypeSize(T) / getCharWidth();
}
- uint64_t getTypeSizeInBytes(const Type *T) {
- return getTypeSize(T) / getByteSize();
+ uint64_t getTypeSizeInChars(const Type *T) {
+ return getTypeSize(T) / getCharWidth();
}
/// getTypeAlign - Return the ABI-specified alignment of a type, in bits.
const llvm::Type *IntPtr =
llvm::IntegerType::get(VMContext, LLVMPointerWidth);
llvm::Value *SizeVal =
- llvm::ConstantInt::get(IntPtr, getContext().getTypeSizeInBytes(Ty));
+ llvm::ConstantInt::get(IntPtr, getContext().getTypeSizeInChars(Ty));
const llvm::Type *BP = llvm::Type::getInt8PtrTy(VMContext);
if (Loc->getType() != BP)