From ed6bbe4ab8d06cd09fdfd294e2b2f8ab3808f84a Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Thu, 18 Jul 2013 00:28:02 +0000 Subject: Replace llvm::DIBuilder::DisableDebugLocations() with two RAII interfaces inspired by CodegenFunction::LexicalScope. - NoLocation temporarily turns off debug locations altogether. This is useful for emitting instructions that should be counted towards the function prologue. - BuiltinLocation temporarily switches to an artificial debug location that has a valid scope, but no line information. This is useful when emitting compiler-generated helper functions that have no source location associated with them. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186552 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGBlocks.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/CodeGen/CGBlocks.cpp') diff --git a/lib/CodeGen/CGBlocks.cpp b/lib/CodeGen/CGBlocks.cpp index eb1afa6955..3d825d3333 100644 --- a/lib/CodeGen/CGBlocks.cpp +++ b/lib/CodeGen/CGBlocks.cpp @@ -1164,9 +1164,8 @@ CodeGenFunction::GenerateBlockFunction(GlobalDecl GD, Alloca->setAlignment(Align); // Set the DebugLocation to empty, so the store is recognized as a // frame setup instruction by llvm::DwarfDebug::beginFunction(). - Builder.DisableDebugLocations(); + NoLocation NL(*this, Builder); Builder.CreateAlignedStore(BlockPointer, Alloca, Align); - Builder.EnableDebugLocations(); BlockPointerDbgLoc = Alloca; } -- cgit v1.2.3