diff options
Diffstat (limited to 'lib/IR/Type.cpp')
-rw-r--r-- | lib/IR/Type.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/IR/Type.cpp b/lib/IR/Type.cpp index 20e9c2b5fff2..83016496ff7e 100644 --- a/lib/IR/Type.cpp +++ b/lib/IR/Type.cpp @@ -60,9 +60,9 @@ bool Type::isIntegerTy(unsigned Bitwidth) const { bool Type::canLosslesslyBitCastTo(Type *Ty) const { // Identity cast means no change so return true - if (this == Ty) + if (this == Ty) return true; - + // They are not convertible unless they are at least first class types if (!this->isFirstClassType() || !Ty->isFirstClassType()) return false; @@ -240,7 +240,7 @@ PointerType *Type::getInt64PtrTy(LLVMContext &C, unsigned AS) { IntegerType *IntegerType::get(LLVMContext &C, unsigned NumBits) { assert(NumBits >= MIN_INT_BITS && "bitwidth too small"); assert(NumBits <= MAX_INT_BITS && "bitwidth too large"); - + // Check for the built-in integer types switch (NumBits) { case 1: return cast<IntegerType>(Type::getInt1Ty(C)); @@ -252,12 +252,12 @@ IntegerType *IntegerType::get(LLVMContext &C, unsigned NumBits) { default: break; } - + IntegerType *&Entry = C.pImpl->IntegerTypes[NumBits]; if (!Entry) Entry = new (C.pImpl->TypeAllocator) IntegerType(C, NumBits); - + return Entry; } @@ -333,7 +333,7 @@ bool FunctionType::isValidArgumentType(Type *ArgTy) { // Primitive Constructors. -StructType *StructType::get(LLVMContext &Context, ArrayRef<Type*> ETypes, +StructType *StructType::get(LLVMContext &Context, ArrayRef<Type*> ETypes, bool isPacked) { LLVMContextImpl *pImpl = Context.pImpl; AnonStructTypeKeyInfo::KeyTy Key(ETypes, isPacked); @@ -355,7 +355,7 @@ StructType *StructType::get(LLVMContext &Context, ArrayRef<Type*> ETypes, void StructType::setBody(ArrayRef<Type*> Elements, bool isPacked) { assert(isOpaque() && "Struct body already set!"); - + setSubclassData(getSubclassData() | SCDB_HasBody); if (isPacked) setSubclassData(getSubclassData() | SCDB_Packed); @@ -391,7 +391,7 @@ void StructType::setName(StringRef Name) { } return; } - + // Look up the entry for the name. auto IterBool = getContext().pImpl->NamedStructTypes.insert(std::make_pair(Name, this)); @@ -402,7 +402,7 @@ void StructType::setName(StringRef Name) { TempStr.push_back('.'); raw_svector_ostream TmpStream(TempStr); unsigned NameSize = Name.size(); - + do { TempStr.resize(NameSize + 1); TmpStream << getContext().pImpl->NamedStructTypesUniqueID++; @@ -569,7 +569,7 @@ ArrayType *ArrayType::get(Type *ElementType, uint64_t NumElements) { assert(isValidElementType(ElementType) && "Invalid type for array element!"); LLVMContextImpl *pImpl = ElementType->getContext().pImpl; - ArrayType *&Entry = + ArrayType *&Entry = pImpl->ArrayTypes[std::make_pair(ElementType, NumElements)]; if (!Entry) @@ -617,9 +617,9 @@ bool VectorType::isValidElementType(Type *ElemTy) { PointerType *PointerType::get(Type *EltTy, unsigned AddressSpace) { assert(EltTy && "Can't get a pointer to <null> type!"); assert(isValidElementType(EltTy) && "Invalid type for pointer element!"); - + LLVMContextImpl *CImpl = EltTy->getContext().pImpl; - + // Since AddressSpace #0 is the common case, we special case it. PointerType *&Entry = AddressSpace == 0 ? CImpl->PointerTypes[EltTy] : CImpl->ASPointerTypes[std::make_pair(EltTy, AddressSpace)]; |