diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-10-09 19:52:38 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-10-09 19:52:38 +0000 |
commit | 4def70d3040e73707c738f7c366737a986135edf (patch) | |
tree | 0699902c58619f54157b8802bd8d25909da63385 /lib/CodeGen/CodeGenFunction.h | |
parent | d372a70c6845efcfc88edc37341f795fc70750c7 (diff) |
-fcatch-undefined-behavior: emit calls to the runtime library whenever one of the checks fails.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165536 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.h')
-rw-r--r-- | lib/CodeGen/CodeGenFunction.h | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h index 4a0c35bd82..11ee36ba0c 100644 --- a/lib/CodeGen/CodeGenFunction.h +++ b/lib/CodeGen/CodeGenFunction.h @@ -1503,7 +1503,7 @@ public: static bool hasAggregateLLVMType(QualType T); /// createBasicBlock - Create an LLVM basic block. - llvm::BasicBlock *createBasicBlock(StringRef name = "", + llvm::BasicBlock *createBasicBlock(const Twine &name = "", llvm::Function *parent = 0, llvm::BasicBlock *before = 0) { #ifdef NDEBUG @@ -1867,7 +1867,7 @@ public: /// \brief Emit a check that \p V is the address of storage of the /// appropriate size and alignment for an object of type \p Type. - void EmitTypeCheck(TypeCheckKind TCK, llvm::Value *V, + void EmitTypeCheck(TypeCheckKind TCK, SourceLocation Loc, llvm::Value *V, QualType Type, CharUnits Alignment = CharUnits::Zero()); llvm::Value *EmitScalarPrePostIncDec(const UnaryOperator *E, LValue LV, @@ -2262,6 +2262,7 @@ public: const CXXRecordDecl *RD); RValue EmitCXXMemberCall(const CXXMethodDecl *MD, + SourceLocation CallLoc, llvm::Value *Callee, ReturnValueSlot ReturnValue, llvm::Value *This, @@ -2548,9 +2549,23 @@ public: void EmitBranchOnBoolExpr(const Expr *Cond, llvm::BasicBlock *TrueBlock, llvm::BasicBlock *FalseBlock); + /// \brief Emit a description of a type in a format suitable for passing to + /// a runtime sanitizer handler. + llvm::Constant *EmitCheckTypeDescriptor(QualType T); + + /// \brief Convert a value into a format suitable for passing to a runtime + /// sanitizer handler. + llvm::Value *EmitCheckValue(llvm::Value *V); + + /// \brief Emit a description of a source location in a format suitable for + /// passing to a runtime sanitizer handler. + llvm::Constant *EmitCheckSourceLocation(SourceLocation Loc); + /// \brief Create a basic block that will call the trap intrinsic, and emit a /// conditional branch to it. - void EmitCheck(llvm::Value *Checked); + void EmitCheck(llvm::Value *Checked, StringRef CheckName, + llvm::ArrayRef<llvm::Constant *> StaticArgs, + llvm::ArrayRef<llvm::Value *> DynamicArgs); /// EmitCallArg - Emit a single call argument. void EmitCallArg(CallArgList &args, const Expr *E, QualType ArgType); |