diff options
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.h | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index 36914691eb9..e2fd80e7d3e 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/lib/CodeGen/CodeGenFunction.h @@ -93,6 +93,19 @@ enum TypeEvaluationKind { TEK_Aggregate }; +class SuppressDebugLocation { + llvm::DebugLoc CurLoc; + llvm::IRBuilderBase &Builder; +public: + SuppressDebugLocation(llvm::IRBuilderBase &Builder) + : CurLoc(Builder.getCurrentDebugLocation()), Builder(Builder) { + Builder.SetCurrentDebugLocation(llvm::DebugLoc()); + } + ~SuppressDebugLocation() { + Builder.SetCurrentDebugLocation(CurLoc); + } +}; + /// CodeGenFunction - This class organizes the per-function state that is used /// while generating LLVM code. class CodeGenFunction : public CodeGenTypeCache { @@ -1262,7 +1275,7 @@ public: /// EmitReturnBlock - Emit the unified return block, trying to avoid its /// emission when possible. - llvm::DebugLoc EmitReturnBlock(); + void EmitReturnBlock(); /// FinishFunction - Complete IR generation of the current function. It is /// legal to call this function even if there is no current insertion point. @@ -1287,7 +1300,8 @@ public: FunctionArgList &Args); void EmitInitializerForField(FieldDecl *Field, LValue LHS, Expr *Init, - ArrayRef<VarDecl *> ArrayIndexes); + ArrayRef<VarDecl *> ArrayIndexes, + SourceLocation DbgLoc = SourceLocation()); /// InitializeVTablePointer - Initialize the vtable pointer of the given /// subobject. @@ -1532,7 +1546,7 @@ public: /// EmitExprAsInit - Emits the code necessary to initialize a /// location in memory with the given initializer. void EmitExprAsInit(const Expr *init, const ValueDecl *D, LValue lvalue, - bool capturedByInit); + bool capturedByInit, SourceLocation DbgLoc); /// hasVolatileMember - returns true if aggregate type has a volatile /// member. @@ -1819,7 +1833,8 @@ public: void EmitVarDecl(const VarDecl &D); void EmitScalarInit(const Expr *init, const ValueDecl *D, LValue lvalue, - bool capturedByInit); + bool capturedByInit, + SourceLocation DbgLoc = SourceLocation()); void EmitScalarInit(llvm::Value *init, LValue lvalue); typedef void SpecialInitFn(CodeGenFunction &Init, const VarDecl &D, @@ -2149,7 +2164,8 @@ public: /// EmitStoreThroughLValue - Store the specified rvalue into the specified /// lvalue, where both are guaranteed to the have the same type, and that type /// is 'Ty'. - void EmitStoreThroughLValue(RValue Src, LValue Dst, bool isInit = false); + void EmitStoreThroughLValue(RValue Src, LValue Dst, bool isInit = false, + SourceLocation DbgLoc = SourceLocation()); void EmitStoreThroughExtVectorComponentLValue(RValue Src, LValue Dst); void EmitStoreThroughGlobalRegLValue(RValue Src, LValue Dst); @@ -2521,10 +2537,12 @@ public: /// EmitComplexExprIntoLValue - Emit the given expression of complex /// type and place its result into the specified l-value. - void EmitComplexExprIntoLValue(const Expr *E, LValue dest, bool isInit); + void EmitComplexExprIntoLValue(const Expr *E, LValue dest, bool isInit, + SourceLocation DbgLoc = SourceLocation()); /// EmitStoreOfComplex - Store a complex number into the specified l-value. - void EmitStoreOfComplex(ComplexPairTy V, LValue dest, bool isInit); + void EmitStoreOfComplex(ComplexPairTy V, LValue dest, bool isInit, + SourceLocation DbgLoc = SourceLocation()); /// EmitLoadOfComplex - Load a complex number from the specified l-value. ComplexPairTy EmitLoadOfComplex(LValue src, SourceLocation loc); |