]> granicus.if.org Git - clang/commit
Call CreateTempMemWithoutCast for ActiveFlag
authorYaxun Liu <Yaxun.Liu@amd.com>
Tue, 22 May 2018 14:36:26 +0000 (14:36 +0000)
committerYaxun Liu <Yaxun.Liu@amd.com>
Tue, 22 May 2018 14:36:26 +0000 (14:36 +0000)
commitf5fd97a2fb2d3a979995b16c7dbc357f5d239147
treefb98a97747d6857e455cccc715979be79bb1905f
parent8fff739f777ae8b4ef32af113695f17bac410243
Call CreateTempMemWithoutCast for ActiveFlag

Introduced CreateMemTempWithoutCast and CreateTemporaryAllocaWithoutCast to emit alloca
without casting to default addr space.

ActiveFlag is a temporary variable emitted for clean up. It is defined as AllocaInst* type and there is
a cast to AlllocaInst in SetActiveFlag. An alloca casted to generic pointer causes assertion in
SetActiveFlag.

Since there is only load/store of ActiveFlag, it is safe to use the original alloca, therefore use
CreateMemTempWithoutCast is called.

Differential Revision: https://reviews.llvm.org/D47099

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332982 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGCall.cpp
lib/CodeGen/CGCleanup.cpp
lib/CodeGen/CGExpr.cpp
lib/CodeGen/CodeGenFunction.h
test/CodeGenCXX/conditional-temporaries.cpp