X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FIR%2FInstructions.cpp;h=f4c6a289b804e0ef60c410b5544fba7255adc681;hb=33ada85735d5a578dd0928c994862df17f85f8d2;hp=9da0eb4a0d621e72c257530bc92d4b4ecda80aa5;hpb=9156c5e3baecd6b6c147a1fd29b2391a80b931ac;p=oota-llvm.git diff --git a/lib/IR/Instructions.cpp b/lib/IR/Instructions.cpp index 9da0eb4a0d6..f4c6a289b80 100644 --- a/lib/IR/Instructions.cpp +++ b/lib/IR/Instructions.cpp @@ -364,7 +364,7 @@ bool CallInst::paramHasAttr(unsigned i, Attribute::AttrKind A) const { /// IsConstantOne - Return true only if val is constant int 1 static bool IsConstantOne(Value *val) { - assert(val && "IsConstantOne does not work with NULL val"); + assert(val && "IsConstantOne does not work with nullptr val"); const ConstantInt *CVal = dyn_cast(val); return CVal && CVal->isOne(); } @@ -419,7 +419,7 @@ static Instruction *createMalloc(Instruction *InsertBefore, Value *MallocFunc = MallocF; if (!MallocFunc) // prototype malloc as "void *malloc(size_t)" - MallocFunc = M->getOrInsertFunction("malloc", BPTy, IntPtrTy, NULL); + MallocFunc = M->getOrInsertFunction("malloc", BPTy, IntPtrTy, nullptr); PointerType *AllocPtrType = PointerType::getUnqual(AllocTy); CallInst *MCall = nullptr; Instruction *Result = nullptr; @@ -492,7 +492,7 @@ static Instruction* createFree(Value* Source, Instruction *InsertBefore, Type *VoidTy = Type::getVoidTy(M->getContext()); Type *IntPtrTy = Type::getInt8PtrTy(M->getContext()); // prototype free as "void free(void*)" - Value *FreeFunc = M->getOrInsertFunction("free", VoidTy, IntPtrTy, NULL); + Value *FreeFunc = M->getOrInsertFunction("free", VoidTy, IntPtrTy, nullptr); CallInst* Result = nullptr; Value *PtrCast = Source; if (InsertBefore) { @@ -2073,7 +2073,7 @@ void BinaryOperator::andIRFlags(const Value *V) { /// default precision. float FPMathOperator::getFPAccuracy() const { const MDNode *MD = - cast(this)->getMetadata(LLVMContext::MD_fpmath); + cast(this)->getMetadata(LLVMContext::MD_fpmath); if (!MD) return 0.0; ConstantFP *Accuracy = cast(MD->getOperand(0)); @@ -2731,10 +2731,10 @@ bool CastInst::isBitOrNoopPointerCastable(Type *SrcTy, Type *DestTy, const DataLayout *DL) { if (auto *PtrTy = dyn_cast(SrcTy)) if (auto *IntTy = dyn_cast(DestTy)) - return DL && IntTy->getBitWidth() >= DL->getPointerTypeSizeInBits(PtrTy); + return DL && IntTy->getBitWidth() == DL->getPointerTypeSizeInBits(PtrTy); if (auto *PtrTy = dyn_cast(DestTy)) if (auto *IntTy = dyn_cast(SrcTy)) - return DL && IntTy->getBitWidth() >= DL->getPointerTypeSizeInBits(PtrTy); + return DL && IntTy->getBitWidth() == DL->getPointerTypeSizeInBits(PtrTy); return isBitCastable(SrcTy, DestTy); }