aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.h
diff options
context:
space:
mode:
authorYaxun Liu <Yaxun.Liu@amd.com>2018-05-22 16:13:07 +0000
committerYaxun Liu <Yaxun.Liu@amd.com>2018-05-22 16:13:07 +0000
commit00ddbed2981b46a59bf1b64c9d63cfecb9299f09 (patch)
tree68bb85f75417c69306e7e1ed10a6826d3098ccca /clang/lib/CodeGen/CodeGenFunction.h
parent41f4b64ee17cc5559a687ce9ac9338a158a00d41 (diff)
downloadllvm-00ddbed2981b46a59bf1b64c9d63cfecb9299f09.zip
llvm-00ddbed2981b46a59bf1b64c9d63cfecb9299f09.tar.gz
llvm-00ddbed2981b46a59bf1b64c9d63cfecb9299f09.tar.bz2
Revert r332982 Call CreateTempMemWithoutCast for ActiveFlag
Due to regression on arm. llvm-svn: 332991
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.h31
1 files changed, 13 insertions, 18 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index 71e3c6b..1cd952c 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -2020,20 +2020,18 @@ public:
/// to the stack.
///
/// Because the address of a temporary is often exposed to the program in
- /// various ways, this function will perform the cast. The original alloca
- /// instruction is returned through \p Alloca if it is not nullptr.
- ///
- /// The cast is not performaed in CreateTempAllocaWithoutCast. This is
+ /// various ways, this function will perform the cast by default. The cast
+ /// may be avoided by passing false as \p CastToDefaultAddrSpace; this is
/// more efficient if the caller knows that the address will not be exposed.
+ /// The original alloca instruction is returned through \p Alloca if it is
+ /// not nullptr.
llvm::AllocaInst *CreateTempAlloca(llvm::Type *Ty, const Twine &Name = "tmp",
llvm::Value *ArraySize = nullptr);
Address CreateTempAlloca(llvm::Type *Ty, CharUnits align,
const Twine &Name = "tmp",
llvm::Value *ArraySize = nullptr,
- Address *Alloca = nullptr);
- Address CreateTempAllocaWithoutCast(llvm::Type *Ty, CharUnits align,
- const Twine &Name = "tmp",
- llvm::Value *ArraySize = nullptr);
+ Address *Alloca = nullptr,
+ bool CastToDefaultAddrSpace = true);
/// CreateDefaultAlignedTempAlloca - This creates an alloca with the
/// default ABI alignment of the given LLVM type.
@@ -2068,18 +2066,15 @@ public:
Address CreateIRTemp(QualType T, const Twine &Name = "tmp");
/// CreateMemTemp - Create a temporary memory object of the given type, with
- /// appropriate alignmen and cast it to the default address space. Returns
- /// the original alloca instruction by \p Alloca if it is not nullptr.
+ /// appropriate alignment. Cast it to the default address space if
+ /// \p CastToDefaultAddrSpace is true. Returns the original alloca
+ /// instruction by \p Alloca if it is not nullptr.
Address CreateMemTemp(QualType T, const Twine &Name = "tmp",
- Address *Alloca = nullptr);
+ Address *Alloca = nullptr,
+ bool CastToDefaultAddrSpace = true);
Address CreateMemTemp(QualType T, CharUnits Align, const Twine &Name = "tmp",
- Address *Alloca = nullptr);
-
- /// CreateMemTemp - Create a temporary memory object of the given type, with
- /// appropriate alignmen without casting it to the default address space.
- Address CreateMemTempWithoutCast(QualType T, const Twine &Name = "tmp");
- Address CreateMemTempWithoutCast(QualType T, CharUnits Align,
- const Twine &Name = "tmp");
+ Address *Alloca = nullptr,
+ bool CastToDefaultAddrSpace = true);
/// CreateAggTemp - Create a temporary memory object for the given
/// aggregate type.