diff options
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.h | 70 |
1 files changed, 37 insertions, 33 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index c859ddab773..8c4029afa0b 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/lib/CodeGen/CodeGenFunction.h @@ -103,13 +103,13 @@ public: /// A jump destination is an abstract label, branching to which may /// require a jump out through normal cleanups. struct JumpDest { - JumpDest() : Block(0), ScopeDepth(), Index(0) {} + JumpDest() : Block(nullptr), ScopeDepth(), Index(0) {} JumpDest(llvm::BasicBlock *Block, EHScopeStack::stable_iterator Depth, unsigned Index) : Block(Block), ScopeDepth(Depth), Index(Index) {} - bool isValid() const { return Block != 0; } + bool isValid() const { return Block != nullptr; } llvm::BasicBlock *getBlock() const { return Block; } EHScopeStack::stable_iterator getScopeDepth() const { return ScopeDepth; } unsigned getDestIndex() const { return Index; } @@ -163,7 +163,7 @@ public: public: explicit CGCapturedStmtInfo(const CapturedStmt &S, CapturedRegionKind K = CR_Default) - : Kind(K), ThisValue(0), CXXThisFieldDecl(0) { + : Kind(K), ThisValue(nullptr), CXXThisFieldDecl(nullptr) { RecordDecl::field_iterator Field = S.getCapturedRecordDecl()->field_begin(); @@ -190,7 +190,7 @@ public: return CaptureFields.lookup(VD); } - bool isCXXThisExprCaptured() const { return CXXThisFieldDecl != 0; } + bool isCXXThisExprCaptured() const { return CXXThisFieldDecl != nullptr; } FieldDecl *getThisFieldDecl() const { return CXXThisFieldDecl; } /// \brief Emit the captured statement body. @@ -611,9 +611,9 @@ public: } void end(CodeGenFunction &CGF) { - assert(CGF.OutermostConditional != 0); + assert(CGF.OutermostConditional != nullptr); if (CGF.OutermostConditional == this) - CGF.OutermostConditional = 0; + CGF.OutermostConditional = nullptr; } /// Returns a block which will be executed prior to each @@ -625,7 +625,7 @@ public: /// isInConditionalBranch - Return true if we're currently emitting /// one branch or the other of a conditional expression. - bool isInConditionalBranch() const { return OutermostConditional != 0; } + bool isInConditionalBranch() const { return OutermostConditional != nullptr; } void setBeforeOutermostConditional(llvm::Value *value, llvm::Value *addr) { assert(isInConditionalBranch()); @@ -646,7 +646,7 @@ public: public: StmtExprEvaluation(CodeGenFunction &CGF) : CGF(CGF), SavedOutermostConditional(CGF.OutermostConditional) { - CGF.OutermostConditional = 0; + CGF.OutermostConditional = nullptr; } ~StmtExprEvaluation() { @@ -663,7 +663,7 @@ public: friend class CodeGenFunction; public: - PeepholeProtection() : Inst(0) {} + PeepholeProtection() : Inst(nullptr) {} }; /// A non-RAII class containing all the information about a bound @@ -681,7 +681,7 @@ public: bool boundLValue) : OpaqueValue(ov), BoundLValue(boundLValue) {} public: - OpaqueValueMappingData() : OpaqueValue(0) {} + OpaqueValueMappingData() : OpaqueValue(nullptr) {} static bool shouldBindAsLValue(const Expr *expr) { // gl-values should be bound as l-values for obvious reasons. @@ -726,8 +726,8 @@ public: return data; } - bool isValid() const { return OpaqueValue != 0; } - void clear() { OpaqueValue = 0; } + bool isValid() const { return OpaqueValue != nullptr; } + void clear() { OpaqueValue = nullptr; } void unbind(CodeGenFunction &CGF) { assert(OpaqueValue && "no data to unbind!"); @@ -970,7 +970,7 @@ public: ASTContext &getContext() const { return CGM.getContext(); } CGDebugInfo *getDebugInfo() { if (DisableDebugInfo) - return NULL; + return nullptr; return DebugInfo; } void disableDebugInfo() { DisableDebugInfo = true; } @@ -1003,7 +1003,7 @@ public: } llvm::BasicBlock *getInvokeDest() { - if (!EHStack.requiresLandingPad()) return 0; + if (!EHStack.requiresLandingPad()) return nullptr; return getInvokeDestImpl(); } @@ -1291,8 +1291,8 @@ public: /// createBasicBlock - Create an LLVM basic block. llvm::BasicBlock *createBasicBlock(const Twine &name = "", - llvm::Function *parent = 0, - llvm::BasicBlock *before = 0) { + llvm::Function *parent = nullptr, + llvm::BasicBlock *before = nullptr) { #ifdef NDEBUG return llvm::BasicBlock::Create(getLLVMContext(), "", parent, before); #else @@ -1336,7 +1336,7 @@ public: /// HaveInsertPoint - True if an insertion point is defined. If not, this /// indicates that the current code being emitted is unreachable. bool HaveInsertPoint() const { - return Builder.GetInsertBlock() != 0; + return Builder.GetInsertBlock() != nullptr; } /// EnsureInsertPoint - Ensure that an insertion point is defined so that @@ -1747,19 +1747,21 @@ public: llvm::Value *SizeForLifetimeMarkers; struct Invalid {}; - AutoVarEmission(Invalid) : Variable(0) {} + AutoVarEmission(Invalid) : Variable(nullptr) {} AutoVarEmission(const VarDecl &variable) - : Variable(&variable), Address(0), NRVOFlag(0), + : Variable(&variable), Address(nullptr), NRVOFlag(nullptr), IsByRef(false), IsConstantAggregate(false), - SizeForLifetimeMarkers(0) {} + SizeForLifetimeMarkers(nullptr) {} - bool wasEmittedAsGlobal() const { return Address == 0; } + bool wasEmittedAsGlobal() const { return Address == nullptr; } public: static AutoVarEmission invalid() { return AutoVarEmission(Invalid()); } - bool useLifetimeMarkers() const { return SizeForLifetimeMarkers != 0; } + bool useLifetimeMarkers() const { + return SizeForLifetimeMarkers != nullptr; + } llvm::Value *getSizeForLifetimeMarkers() const { assert(useLifetimeMarkers()); return SizeForLifetimeMarkers; @@ -1947,7 +1949,7 @@ public: llvm::Value *EmitLoadOfScalar(llvm::Value *Addr, bool Volatile, unsigned Alignment, QualType Ty, SourceLocation Loc, - llvm::MDNode *TBAAInfo = 0, + llvm::MDNode *TBAAInfo = nullptr, QualType TBAABaseTy = QualType(), uint64_t TBAAOffset = 0); @@ -1962,7 +1964,7 @@ public: /// the LLVM value representation. void EmitStoreOfScalar(llvm::Value *Value, llvm::Value *Addr, bool Volatile, unsigned Alignment, QualType Ty, - llvm::MDNode *TBAAInfo = 0, bool isInit = false, + llvm::MDNode *TBAAInfo = nullptr, bool isInit = false, QualType TBAABaseTy = QualType(), uint64_t TBAAOffset = 0); @@ -1995,7 +1997,7 @@ public: /// bit-field contents after the store, appropriate for use as the result of /// an assignment to the bit-field. void EmitStoreThroughBitfieldLValue(RValue Src, LValue Dst, - llvm::Value **Result=0); + llvm::Value **Result=nullptr); /// Emit an l-value for an assignment (simple or compound) of complex type. LValue EmitComplexAssignmentLValue(const BinaryOperator *E); @@ -2043,7 +2045,9 @@ public: return ConstantEmission(C, false); } - LLVM_EXPLICIT operator bool() const { return ValueAndIsReference.getOpaqueValue() != 0; } + LLVM_EXPLICIT operator bool() const { + return ValueAndIsReference.getOpaqueValue() != nullptr; + } bool isReference() const { return ValueAndIsReference.getInt(); } LValue getReferenceLValue(CodeGenFunction &CGF, Expr *refExpr) const { @@ -2106,15 +2110,15 @@ public: llvm::Value *Callee, ReturnValueSlot ReturnValue, const CallArgList &Args, - const Decl *TargetDecl = 0, - llvm::Instruction **callOrInvoke = 0); + const Decl *TargetDecl = nullptr, + llvm::Instruction **callOrInvoke = nullptr); RValue EmitCall(QualType FnType, llvm::Value *Callee, SourceLocation CallLoc, ReturnValueSlot ReturnValue, CallExpr::const_arg_iterator ArgBeg, CallExpr::const_arg_iterator ArgEnd, - const Decl *TargetDecl = 0); + const Decl *TargetDecl = nullptr); RValue EmitCallExpr(const CallExpr *E, ReturnValueSlot ReturnValue = ReturnValueSlot()); @@ -2199,7 +2203,7 @@ public: unsigned Modifier, const CallExpr *E, SmallVectorImpl<llvm::Value *> &Ops, - llvm::Value *Align = 0); + llvm::Value *Align = nullptr); llvm::Function *LookupNeonLLVMIntrinsic(unsigned IntrinsicID, unsigned Modifier, llvm::Type *ArgTy, const CallExpr *E); @@ -2397,7 +2401,7 @@ public: /// variables. void GenerateCXXGlobalInitFunc(llvm::Function *Fn, ArrayRef<llvm::Constant *> Decls, - llvm::GlobalVariable *Guard = 0); + llvm::GlobalVariable *Guard = nullptr); /// GenerateCXXGlobalDtorsFunc - Generates code for destroying global /// variables. @@ -2425,7 +2429,7 @@ public: void EmitLambdaExpr(const LambdaExpr *E, AggValueSlot Dest); - RValue EmitAtomicExpr(AtomicExpr *E, llvm::Value *Dest = 0); + RValue EmitAtomicExpr(AtomicExpr *E, llvm::Value *Dest = nullptr); //===--------------------------------------------------------------------===// // Annotations Emission @@ -2571,7 +2575,7 @@ public: ForceColumnInfo); } else { // T::param_type_iterator might not have a default ctor. - const QualType *NoIter = 0; + const QualType *NoIter = nullptr; EmitCallArgs(Args, /*AllowExtraArguments=*/true, NoIter, NoIter, ArgBeg, ArgEnd, ForceColumnInfo); } |