diff options
author | hsmahesha <mahesha.comp@gmail.com> | 2021-10-09 09:22:59 +0530 |
---|---|---|
committer | hsmahesha <mahesha.comp@gmail.com> | 2021-10-09 09:23:14 +0530 |
commit | 04816829968cf8aad0c71e8dc27a4a1e88c493a8 (patch) | |
tree | 9416b47514bf5aac720354048429088f828eb836 /clang/lib | |
parent | 203c7fab730e7a1252e828ae1aa29c799d0be023 (diff) | |
download | llvm-04816829968cf8aad0c71e8dc27a4a1e88c493a8.zip llvm-04816829968cf8aad0c71e8dc27a4a1e88c493a8.tar.gz llvm-04816829968cf8aad0c71e8dc27a4a1e88c493a8.tar.bz2 |
[CFE][Codegen][In-progress] Remove CodeGenFunction::InitTempAlloca()
CodeGenFunction::InitTempAlloca() inits the static alloca within the
entry block which may *not* necessarily be correct always.
For example, the current instruction insertion point (pointed by the
instruction builder) could be a program point which is hit multiple
times during the program execution, and it is expected that the static
alloca is initialized every time the program point is hit.
Hence remove CodeGenFunction::InitTempAlloca(), and initialize the
static alloca where the instruction insertion point is at the moment.
This patch, as a starting attempt, removes the calls to
CodeGenFunction::InitTempAlloca() which do not have any side effect on
the lit tests.
Reviewed By: rjmccall
Differential Revision: https://reviews.llvm.org/D111293
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 13bc366..0b336d4 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -981,7 +981,8 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy, // precise source location of the checked return statement. if (requiresReturnValueCheck()) { ReturnLocation = CreateDefaultAlignTempAlloca(Int8PtrTy, "return.sloc.ptr"); - InitTempAlloca(ReturnLocation, llvm::ConstantPointerNull::get(Int8PtrTy)); + Builder.CreateStore(llvm::ConstantPointerNull::get(Int8PtrTy), + ReturnLocation); } // Emit subprogram debug descriptor. |