diff options
author | Jay Foad <jay.foad@amd.com> | 2024-10-30 16:53:08 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-30 16:53:08 +0000 |
commit | 463a4c16ea9c1a3c1210d0ac39e56a75b43b5a8d (patch) | |
tree | b264c0fa5a353c27c8d0488268877696b20418a8 /clang/lib/CodeGen/CGBlocks.cpp | |
parent | 311c0772f9e67a694f3038ab63ea4ec981ce6a9a (diff) | |
download | llvm-463a4c16ea9c1a3c1210d0ac39e56a75b43b5a8d.zip llvm-463a4c16ea9c1a3c1210d0ac39e56a75b43b5a8d.tar.gz llvm-463a4c16ea9c1a3c1210d0ac39e56a75b43b5a8d.tar.bz2 |
[clang] Remove some uses of llvm::StructType::setBody. NFC. (#113691)
It is simple to create the struct body up front, now that we have
transitioned to opaque pointers.
Diffstat (limited to 'clang/lib/CodeGen/CGBlocks.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGBlocks.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CGBlocks.cpp b/clang/lib/CodeGen/CGBlocks.cpp index 41bb8d1..bfa9b0a2 100644 --- a/clang/lib/CodeGen/CGBlocks.cpp +++ b/clang/lib/CodeGen/CGBlocks.cpp @@ -2590,10 +2590,6 @@ const BlockByrefInfo &CodeGenFunction::getBlockByrefInfo(const VarDecl *D) { if (it != BlockByrefInfos.end()) return it->second; - llvm::StructType *byrefType = - llvm::StructType::create(getLLVMContext(), - "struct.__block_byref_" + D->getNameAsString()); - QualType Ty = D->getType(); CharUnits size; @@ -2658,7 +2654,9 @@ const BlockByrefInfo &CodeGenFunction::getBlockByrefInfo(const VarDecl *D) { } types.push_back(varTy); - byrefType->setBody(types, packed); + llvm::StructType *byrefType = llvm::StructType::create( + getLLVMContext(), types, "struct.__block_byref_" + D->getNameAsString(), + packed); BlockByrefInfo info; info.Type = byrefType; |