diff options
| author | Vitaly Buka <vitalybuka@google.com> | 2024-04-10 15:09:22 -0700 |
|---|---|---|
| committer | Vitaly Buka <vitalybuka@google.com> | 2024-04-10 15:09:22 -0700 |
| commit | 3143c5bed137957d78daf72d3bbf26362d6291ac (patch) | |
| tree | 11b1437a369425ee275622868c4d63a79bfda0c4 /clang/lib/CodeGen/CGExpr.cpp | |
| parent | 93133e271d02ed558a040469115315e8a66af4a5 (diff) | |
| parent | 9f6d08f2566a26144ea1753f80aebb1f2ecfdc63 (diff) | |
[𝘀𝗽𝗿] changes introduced through rebaseusers/vitalybuka/spr/main.clangbuiltin-implement-__builtin_allow_runtime_check
Created using spr 1.3.4
[skip ci]
Diffstat (limited to 'clang/lib/CodeGen/CGExpr.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CGExpr.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp index cf696a1c9f56..c85a339f5e3f 100644 --- a/clang/lib/CodeGen/CGExpr.cpp +++ b/clang/lib/CodeGen/CGExpr.cpp @@ -115,10 +115,16 @@ RawAddress CodeGenFunction::CreateTempAlloca(llvm::Type *Ty, CharUnits Align, llvm::AllocaInst *CodeGenFunction::CreateTempAlloca(llvm::Type *Ty, const Twine &Name, llvm::Value *ArraySize) { + llvm::AllocaInst *Alloca; if (ArraySize) - return Builder.CreateAlloca(Ty, ArraySize, Name); - return new llvm::AllocaInst(Ty, CGM.getDataLayout().getAllocaAddrSpace(), - ArraySize, Name, AllocaInsertPt); + Alloca = Builder.CreateAlloca(Ty, ArraySize, Name); + else + Alloca = new llvm::AllocaInst(Ty, CGM.getDataLayout().getAllocaAddrSpace(), + ArraySize, Name, AllocaInsertPt); + if (Allocas) { + Allocas->Add(Alloca); + } + return Alloca; } /// CreateDefaultAlignTempAlloca - This creates an alloca with the |
