summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/CGExpr.cpp')
-rw-r--r--clang/lib/CodeGen/CGExpr.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index ebd160b2e61..1f8a804bd73 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/lib/CodeGen/CGExpr.cpp
@@ -54,8 +54,8 @@ llvm::Value *CodeGenFunction::EmitCastToVoidPtr(llvm::Value *value) {
llvm::AllocaInst *CodeGenFunction::CreateTempAlloca(llvm::Type *Ty,
const Twine &Name) {
if (!Builder.isNamePreserving())
- return new llvm::AllocaInst(Ty, 0, "", AllocaInsertPt);
- return new llvm::AllocaInst(Ty, 0, Name, AllocaInsertPt);
+ return new llvm::AllocaInst(Ty, nullptr, "", AllocaInsertPt);
+ return new llvm::AllocaInst(Ty, nullptr, Name, AllocaInsertPt);
}
void CodeGenFunction::InitTempAlloca(llvm::AllocaInst *Var,
@@ -242,7 +242,7 @@ pushTemporaryCleanup(CodeGenFunction &CGF, const MaterializeTemporaryExpr *M,
}
}
- CXXDestructorDecl *ReferenceTemporaryDtor = 0;
+ CXXDestructorDecl *ReferenceTemporaryDtor = nullptr;
if (const RecordType *RT =
E->getType()->getBaseElementTypeUnsafe()->getAs<RecordType>()) {
// Get the destructor for the reference temporary.
@@ -453,8 +453,8 @@ void CodeGenFunction::EmitTypeCheck(TypeCheckKind TCK, SourceLocation Loc,
if (Address->getType()->getPointerAddressSpace())
return;
- llvm::Value *Cond = 0;
- llvm::BasicBlock *Done = 0;
+ llvm::Value *Cond = nullptr;
+ llvm::BasicBlock *Done = nullptr;
if (SanOpts->Null) {
// The glvalue must not be an empty glvalue.
@@ -468,7 +468,7 @@ void CodeGenFunction::EmitTypeCheck(TypeCheckKind TCK, SourceLocation Loc,
llvm::BasicBlock *Rest = createBasicBlock("not.null");
Builder.CreateCondBr(Cond, Rest, Done);
EmitBlock(Rest);
- Cond = 0;
+ Cond = nullptr;
}
}
@@ -637,7 +637,7 @@ static llvm::Value *getArrayIndexingBound(
}
}
- return 0;
+ return nullptr;
}
void CodeGenFunction::EmitBoundsCheck(const Expr *E, const Expr *Base,
@@ -706,7 +706,7 @@ EmitComplexPrePostIncDec(const UnaryOperator *E, LValue LV,
RValue CodeGenFunction::GetUndefRValue(QualType Ty) {
if (Ty->isVoidType())
- return RValue::get(0);
+ return RValue::get(nullptr);
switch (getEvaluationKind(Ty)) {
case TEK_Complex: {
@@ -1048,7 +1048,7 @@ llvm::MDNode *CodeGenFunction::getRangeForLoadFromType(QualType Ty) {
llvm::APInt Min, End;
if (!getRangeForType(*this, Ty, Min, End,
CGM.getCodeGenOpts().StrictEnums))
- return 0;
+ return nullptr;
llvm::MDBuilder MDHelper(getLLVMContext());
return MDHelper.createRange(Min, End);
@@ -2035,7 +2035,7 @@ LValue CodeGenFunction::EmitPredefinedLValue(const PredefinedExpr *E) {
// If this is outside of a function use the top level decl.
const Decl *CurDecl = CurCodeDecl;
- if (CurDecl == 0 || isa<VarDecl>(CurDecl))
+ if (!CurDecl || isa<VarDecl>(CurDecl))
CurDecl = getContext().getTranslationUnitDecl();
const Type *ElemType = E->getType()->getArrayElementTypeNoTypeQual();
@@ -2106,7 +2106,7 @@ llvm::Constant *CodeGenFunction::EmitCheckTypeDescriptor(QualType T) {
SmallString<32> Buffer;
CGM.getDiags().ConvertArgToString(DiagnosticsEngine::ak_qualtype,
(intptr_t)T.getAsOpaquePtr(),
- 0, 0, 0, 0, 0, 0, Buffer,
+ nullptr, 0, nullptr, 0, nullptr, 0, Buffer,
ArrayRef<intptr_t>());
llvm::Constant *Components[] = {
@@ -2281,13 +2281,13 @@ void CodeGenFunction::EmitTrapCheck(llvm::Value *Checked) {
static const Expr *isSimpleArrayDecayOperand(const Expr *E) {
// If this isn't just an array->pointer decay, bail out.
const auto *CE = dyn_cast<CastExpr>(E);
- if (CE == 0 || CE->getCastKind() != CK_ArrayToPointerDecay)
+ if (!CE || CE->getCastKind() != CK_ArrayToPointerDecay)
return 0;
// If this is a decay from variable width array, bail out.
const Expr *SubExpr = CE->getSubExpr();
if (SubExpr->getType()->isVariableArrayType())
- return 0;
+ return nullptr;
return SubExpr;
}
@@ -2319,7 +2319,7 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const ArraySubscriptExpr *E,
// We know that the pointer points to a type of the correct size, unless the
// size is a VLA or Objective-C interface.
- llvm::Value *Address = 0;
+ llvm::Value *Address = nullptr;
CharUnits ArrayAlignment;
if (const VariableArrayType *vla =
getContext().getAsVariableArrayType(E->getType())) {
@@ -2962,7 +2962,7 @@ RValue CodeGenFunction::EmitCallExpr(const CallExpr *E,
// If the pseudo-expression names a retainable object with weak or
// strong lifetime, the object shall be released.
Expr *BaseExpr = PseudoDtor->getBase();
- llvm::Value *BaseValue = NULL;
+ llvm::Value *BaseValue = nullptr;
Qualifiers BaseQuals;
// If this is s.x, emit s as an lvalue. If it is s->x, emit s as a scalar.
@@ -3002,7 +3002,7 @@ RValue CodeGenFunction::EmitCallExpr(const CallExpr *E,
EmitScalarExpr(E->getCallee());
}
- return RValue::get(0);
+ return RValue::get(nullptr);
}
llvm::Value *Callee = EmitScalarExpr(E->getCallee());
@@ -3148,7 +3148,7 @@ LValue CodeGenFunction::EmitLValueForIvar(QualType ObjectTy,
LValue CodeGenFunction::EmitObjCIvarRefLValue(const ObjCIvarRefExpr *E) {
// FIXME: A lot of the code below could be shared with EmitMemberExpr.
- llvm::Value *BaseValue = 0;
+ llvm::Value *BaseValue = nullptr;
const Expr *BaseExpr = E->getBase();
Qualifiers BaseQuals;
QualType ObjectTy;
OpenPOWER on IntegriCloud