aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGBlocks.cpp
diff options
context:
space:
mode:
authorOrlando Cazalet-Hyams <orlando.hyams@sony.com>2024-03-18 09:59:58 +0000
committerGitHub <noreply@github.com>2024-03-18 09:59:58 +0000
commit6f60ad7e9a3508f19d54c827cf11f7930a0685ee (patch)
treeaebb1e1e5e7b31cc0c7b90fd6928311f034c7f4a /clang/lib/CodeGen/CGBlocks.cpp
parent40d29537fcea7db91f39c0d7bc7feeb499b8e627 (diff)
downloadllvm-6f60ad7e9a3508f19d54c827cf11f7930a0685ee.zip
llvm-6f60ad7e9a3508f19d54c827cf11f7930a0685ee.tar.gz
llvm-6f60ad7e9a3508f19d54c827cf11f7930a0685ee.tar.bz2
[RemoveDIs] Update Clang front end to handle DbgRecords (#84756)
This patch fixes problems that pop up when clang emits DbgRecords instead of debug intrinsics. Note: this doesn't mean clang is emitting DbgRecords yet, because the modules it creates are still always in the old debug mode. That will come in a future patch. Depends on #84739
Diffstat (limited to 'clang/lib/CodeGen/CGBlocks.cpp')
-rw-r--r--clang/lib/CodeGen/CGBlocks.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGBlocks.cpp b/clang/lib/CodeGen/CGBlocks.cpp
index 0cbace7..768b786 100644
--- a/clang/lib/CodeGen/CGBlocks.cpp
+++ b/clang/lib/CodeGen/CGBlocks.cpp
@@ -1540,7 +1540,10 @@ llvm::Function *CodeGenFunction::GenerateBlockFunction(
llvm::BasicBlock *resume = Builder.GetInsertBlock();
// Go back to the entry.
- ++entry_ptr;
+ if (entry_ptr->getNextNonDebugInstruction())
+ entry_ptr = entry_ptr->getNextNonDebugInstruction()->getIterator();
+ else
+ entry_ptr = entry->end();
Builder.SetInsertPoint(entry, entry_ptr);
// Emit debug information for all the DeclRefExprs.