aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorGuy David <guyda96@gmail.com>2025-09-16 13:08:12 -0700
committerGuy David <guyda96@gmail.com>2025-09-16 13:08:12 -0700
commit1589c07c93ec5c14123e6d5145d25df3a69a37bc (patch)
treeee8c950f78d06db91d6863aeac704d4ec6e39e25 /clang/lib/CodeGen/CodeGenFunction.cpp
parentb369237c98906891f9e56fd4be4109a25b79e3e9 (diff)
downloadllvm-users/guy-david/separate-indirectbr.zip
llvm-users/guy-david/separate-indirectbr.tar.gz
llvm-users/guy-david/separate-indirectbr.tar.bz2
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index b2fe917..73a604f 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -2287,14 +2287,13 @@ CodeGenFunction::EmitNullInitialization(Address DestPtr, QualType Ty) {
}
llvm::BlockAddress *CodeGenFunction::GetAddrOfLabel(const LabelDecl *L) {
- // Make sure that there is a block for the indirect goto.
- if (!IndirectBranch)
- GetIndirectGotoBlock();
-
llvm::BasicBlock *BB = getJumpDestForLabel(L).getBlock();
- // Make sure the indirect branch includes all of the address-taken blocks.
- IndirectBranch->addDestination(BB);
+ // Keep track of this address-taken label for indirect goto statements
+ if (llvm::find(AddressTakenLabels, BB) == AddressTakenLabels.end()) {
+ AddressTakenLabels.push_back(BB);
+ }
+
return llvm::BlockAddress::get(CurFn->getType(), BB);
}