diff options
author | Bjorn Pettersson <bjorn.a.pettersson@ericsson.com> | 2018-07-03 12:39:52 +0000 |
---|---|---|
committer | Bjorn Pettersson <bjorn.a.pettersson@ericsson.com> | 2018-07-03 12:39:52 +0000 |
commit | a1ff84e2e4e5827fbb0031e623fa9d366869b933 (patch) | |
tree | 380419ee8cffa06690336c4baee0bacd4cc5dc43 | |
parent | 5af2ac74a54ff2e4e704155d1baacbdb0e3c4057 (diff) |
[IR] Strip trailing whitespace. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336194 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/IR/ConstantRange.cpp | 8 | ||||
-rw-r--r-- | lib/IR/Constants.cpp | 26 | ||||
-rw-r--r-- | lib/IR/DebugInfo.cpp | 4 | ||||
-rw-r--r-- | lib/IR/DebugInfoMetadata.cpp | 2 | ||||
-rw-r--r-- | lib/IR/IRBuilder.cpp | 26 | ||||
-rw-r--r-- | lib/IR/LegacyPassManager.cpp | 2 | ||||
-rw-r--r-- | lib/IR/Type.cpp | 24 |
7 files changed, 46 insertions, 46 deletions
diff --git a/lib/IR/ConstantRange.cpp b/lib/IR/ConstantRange.cpp index 86cd24b2e31..39a0b13c4e0 100644 --- a/lib/IR/ConstantRange.cpp +++ b/lib/IR/ConstantRange.cpp @@ -416,7 +416,7 @@ bool ConstantRange::contains(const ConstantRange &Other) const { ConstantRange ConstantRange::subtract(const APInt &Val) const { assert(Val.getBitWidth() == getBitWidth() && "Wrong bit width"); // If the set is empty or full, don't modify the endpoints. - if (Lower == Upper) + if (Lower == Upper) return *this; return ConstantRange(Lower - Val, Upper - Val); } @@ -426,7 +426,7 @@ ConstantRange ConstantRange::difference(const ConstantRange &CR) const { } ConstantRange ConstantRange::intersectWith(const ConstantRange &CR) const { - assert(getBitWidth() == CR.getBitWidth() && + assert(getBitWidth() == CR.getBitWidth() && "ConstantRange types don't agree!"); // Handle common cases. @@ -500,7 +500,7 @@ ConstantRange ConstantRange::intersectWith(const ConstantRange &CR) const { } ConstantRange ConstantRange::unionWith(const ConstantRange &CR) const { - assert(getBitWidth() == CR.getBitWidth() && + assert(getBitWidth() == CR.getBitWidth() && "ConstantRange types don't agree!"); if ( isFullSet() || CR.isEmptySet()) return *this; @@ -854,7 +854,7 @@ ConstantRange::multiply(const ConstantRange &Other) const { this_max = getSignedMax().sext(getBitWidth() * 2); Other_min = Other.getSignedMin().sext(getBitWidth() * 2); Other_max = Other.getSignedMax().sext(getBitWidth() * 2); - + auto L = {this_min * Other_min, this_min * Other_max, this_max * Other_min, this_max * Other_max}; auto Compare = [](const APInt &A, const APInt &B) { return A.slt(B); }; diff --git a/lib/IR/Constants.cpp b/lib/IR/Constants.cpp index 5ec0834c77d..ad99c0a8587 100644 --- a/lib/IR/Constants.cpp +++ b/lib/IR/Constants.cpp @@ -709,7 +709,7 @@ Constant *ConstantFP::get(Type *Ty, StringRef Str) { if (VectorType *VTy = dyn_cast<VectorType>(Ty)) return ConstantVector::getSplat(VTy->getNumElements(), C); - return C; + return C; } Constant *ConstantFP::getNaN(Type *Ty, bool Negative, unsigned Type) { @@ -762,7 +762,7 @@ ConstantFP* ConstantFP::get(LLVMContext &Context, const APFloat& V) { else if (&V.getSemantics() == &APFloat::IEEEquad()) Ty = Type::getFP128Ty(Context); else { - assert(&V.getSemantics() == &APFloat::PPCDoubleDouble() && + assert(&V.getSemantics() == &APFloat::PPCDoubleDouble() && "Unknown FP format"); Ty = Type::getPPC_FP128Ty(Context); } @@ -1015,7 +1015,7 @@ Constant *ConstantStruct::get(StructType *ST, ArrayRef<Constant*> V) { // Create a ConstantAggregateZero value if all elements are zeros. bool isZero = true; bool isUndef = false; - + if (!V.empty()) { isUndef = isa<UndefValue>(V[0]); isZero = V[0]->isNullValue(); @@ -1276,17 +1276,17 @@ bool ConstantFP::isValueValidForType(Type *Ty, const APFloat& Val) { } case Type::X86_FP80TyID: return &Val2.getSemantics() == &APFloat::IEEEhalf() || - &Val2.getSemantics() == &APFloat::IEEEsingle() || + &Val2.getSemantics() == &APFloat::IEEEsingle() || &Val2.getSemantics() == &APFloat::IEEEdouble() || &Val2.getSemantics() == &APFloat::x87DoubleExtended(); case Type::FP128TyID: return &Val2.getSemantics() == &APFloat::IEEEhalf() || - &Val2.getSemantics() == &APFloat::IEEEsingle() || + &Val2.getSemantics() == &APFloat::IEEEsingle() || &Val2.getSemantics() == &APFloat::IEEEdouble() || &Val2.getSemantics() == &APFloat::IEEEquad(); case Type::PPC_FP128TyID: return &Val2.getSemantics() == &APFloat::IEEEhalf() || - &Val2.getSemantics() == &APFloat::IEEEsingle() || + &Val2.getSemantics() == &APFloat::IEEEsingle() || &Val2.getSemantics() == &APFloat::IEEEdouble() || &Val2.getSemantics() == &APFloat::PPCDoubleDouble(); } @@ -1795,8 +1795,8 @@ Constant *ConstantExpr::get(unsigned Opcode, Constant *C1, Constant *C2, "Tried to create a floating-point operation on a " "non-floating-point type!"); break; - case Instruction::UDiv: - case Instruction::SDiv: + case Instruction::UDiv: + case Instruction::SDiv: assert(C1->getType() == C2->getType() && "Op types should be identical!"); assert(C1->getType()->isIntOrIntVectorTy() && "Tried to create an arithmetic operation on a non-arithmetic type!"); @@ -1806,8 +1806,8 @@ Constant *ConstantExpr::get(unsigned Opcode, Constant *C1, Constant *C2, assert(C1->getType()->isFPOrFPVectorTy() && "Tried to create an arithmetic operation on a non-arithmetic type!"); break; - case Instruction::URem: - case Instruction::SRem: + case Instruction::URem: + case Instruction::SRem: assert(C1->getType() == C2->getType() && "Op types should be identical!"); assert(C1->getType()->isIntOrIntVectorTy() && "Tried to create an arithmetic operation on a non-arithmetic type!"); @@ -1855,7 +1855,7 @@ Constant *ConstantExpr::getSizeOf(Type* Ty) { Constant *GEPIdx = ConstantInt::get(Type::getInt32Ty(Ty->getContext()), 1); Constant *GEP = getGetElementPtr( Ty, Constant::getNullValue(PointerType::getUnqual(Ty)), GEPIdx); - return getPtrToInt(GEP, + return getPtrToInt(GEP, Type::getInt64Ty(Ty->getContext())); } @@ -2416,7 +2416,7 @@ Constant *ConstantDataSequential::getImpl(StringRef Elements, Type *Ty) { void ConstantDataSequential::destroyConstantImpl() { // Remove the constant from the StringMap. - StringMap<ConstantDataSequential*> &CDSConstants = + StringMap<ConstantDataSequential*> &CDSConstants = getType()->getContext().pImpl->CDSConstants; StringMap<ConstantDataSequential*>::iterator Slot = @@ -2433,7 +2433,7 @@ void ConstantDataSequential::destroyConstantImpl() { assert((*Entry) == this && "Hash mismatch in ConstantDataSequential"); getContext().pImpl->CDSConstants.erase(Slot); } else { - // Otherwise, there are multiple entries linked off the bucket, unlink the + // Otherwise, there are multiple entries linked off the bucket, unlink the // node we care about but keep the bucket around. for (ConstantDataSequential *Node = *Entry; ; Entry = &Node->Next, Node = *Entry) { diff --git a/lib/IR/DebugInfo.cpp b/lib/IR/DebugInfo.cpp index b741cc9236f..77585ee30cd 100644 --- a/lib/IR/DebugInfo.cpp +++ b/lib/IR/DebugInfo.cpp @@ -669,10 +669,10 @@ bool llvm::stripNonLineTableDebugInfo(Module &M) { SmallVector<MDNode *, 8> Ops; for (MDNode *Op : NMD.operands()) Ops.push_back(remap(Op)); - + if (!Changed) continue; - + NMD.clearOperands(); for (auto *Op : Ops) if (Op) diff --git a/lib/IR/DebugInfoMetadata.cpp b/lib/IR/DebugInfoMetadata.cpp index 217cec3e937..5d9e3405880 100644 --- a/lib/IR/DebugInfoMetadata.cpp +++ b/lib/IR/DebugInfoMetadata.cpp @@ -792,7 +792,7 @@ DIExpression *DIExpression::prepend(const DIExpression *Expr, bool DerefBefore, SmallVector<uint64_t, 8> Ops; if (DerefBefore) Ops.push_back(dwarf::DW_OP_deref); - + appendOffset(Ops, Offset); if (DerefAfter) Ops.push_back(dwarf::DW_OP_deref); diff --git a/lib/IR/IRBuilder.cpp b/lib/IR/IRBuilder.cpp index b6df7b530a9..405a56bfb31 100644 --- a/lib/IR/IRBuilder.cpp +++ b/lib/IR/IRBuilder.cpp @@ -62,7 +62,7 @@ Value *IRBuilderBase::getCastedInt8PtrValue(Value *Ptr) { auto *PT = cast<PointerType>(Ptr->getType()); if (PT->getElementType()->isIntegerTy(8)) return Ptr; - + // Otherwise, we need to insert a bitcast. PT = getInt8PtrTy(PT->getAddressSpace()); BitCastInst *BCI = new BitCastInst(Ptr, PT, ""); @@ -80,7 +80,7 @@ static CallInst *createCallHelper(Value *Callee, ArrayRef<Value *> Ops, CI->copyFastMathFlags(FMFSource); Builder->GetInsertBlock()->getInstList().insert(Builder->GetInsertPoint(),CI); Builder->SetInstDebugLocation(CI); - return CI; + return CI; } static InvokeInst *createInvokeHelper(Value *Invokee, BasicBlock *NormalDest, @@ -105,7 +105,7 @@ CreateMemSet(Value *Ptr, Value *Val, Value *Size, unsigned Align, Type *Tys[] = { Ptr->getType(), Size->getType() }; Module *M = BB->getParent()->getParent(); Value *TheFn = Intrinsic::getDeclaration(M, Intrinsic::memset, Tys); - + CallInst *CI = createCallHelper(TheFn, Ops, this); if (Align > 0) @@ -117,7 +117,7 @@ CreateMemSet(Value *Ptr, Value *Val, Value *Size, unsigned Align, if (ScopeTag) CI->setMetadata(LLVMContext::MD_alias_scope, ScopeTag); - + if (NoAliasTag) CI->setMetadata(LLVMContext::MD_noalias, NoAliasTag); @@ -167,7 +167,7 @@ CreateMemCpy(Value *Dst, unsigned DstAlign, Value *Src, unsigned SrcAlign, Type *Tys[] = { Dst->getType(), Src->getType(), Size->getType() }; Module *M = BB->getParent()->getParent(); Value *TheFn = Intrinsic::getDeclaration(M, Intrinsic::memcpy, Tys); - + CallInst *CI = createCallHelper(TheFn, Ops, this); auto* MCI = cast<MemCpyInst>(CI); @@ -183,14 +183,14 @@ CreateMemCpy(Value *Dst, unsigned DstAlign, Value *Src, unsigned SrcAlign, // Set the TBAA Struct info if present. if (TBAAStructTag) CI->setMetadata(LLVMContext::MD_tbaa_struct, TBAAStructTag); - + if (ScopeTag) CI->setMetadata(LLVMContext::MD_alias_scope, ScopeTag); - + if (NoAliasTag) CI->setMetadata(LLVMContext::MD_noalias, NoAliasTag); - return CI; + return CI; } CallInst *IRBuilderBase::CreateElementUnorderedAtomicMemCpy( @@ -247,7 +247,7 @@ CreateMemMove(Value *Dst, unsigned DstAlign, Value *Src, unsigned SrcAlign, Type *Tys[] = { Dst->getType(), Src->getType(), Size->getType() }; Module *M = BB->getParent()->getParent(); Value *TheFn = Intrinsic::getDeclaration(M, Intrinsic::memmove, Tys); - + CallInst *CI = createCallHelper(TheFn, Ops, this); auto *MMI = cast<MemMoveInst>(CI); @@ -259,14 +259,14 @@ CreateMemMove(Value *Dst, unsigned DstAlign, Value *Src, unsigned SrcAlign, // Set the TBAA info if present. if (TBAATag) CI->setMetadata(LLVMContext::MD_tbaa, TBAATag); - + if (ScopeTag) CI->setMetadata(LLVMContext::MD_alias_scope, ScopeTag); - + if (NoAliasTag) CI->setMetadata(LLVMContext::MD_noalias, NoAliasTag); - - return CI; + + return CI; } CallInst *IRBuilderBase::CreateElementUnorderedAtomicMemMove( diff --git a/lib/IR/LegacyPassManager.cpp b/lib/IR/LegacyPassManager.cpp index 46bfba7f5a0..cd130ba2865 100644 --- a/lib/IR/LegacyPassManager.cpp +++ b/lib/IR/LegacyPassManager.cpp @@ -648,7 +648,7 @@ AnalysisUsage *PMTopLevelManager::findAnalysisUsage(Pass *P) { // of dependencies. AnalysisUsage AU; P->getAnalysisUsage(AU); - + AUFoldingSetNode* Node = nullptr; FoldingSetNodeID ID; AUFoldingSetNode::Profile(ID, AU); diff --git a/lib/IR/Type.cpp b/lib/IR/Type.cpp index 20e9c2b5fff..83016496ff7 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)]; |