mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-03-03 01:48:15 +00:00
[IR] Strip trailing whitespace. NFC
llvm-svn: 336194
This commit is contained in:
parent
765bfbdcbd
commit
d6a0222d34
@ -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); };
|
||||
|
@ -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) {
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
|
@ -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(
|
||||
|
@ -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);
|
||||
|
@ -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)];
|
||||
|
Loading…
x
Reference in New Issue
Block a user