aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.h
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index 561f8f6..c0bc382 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -2861,10 +2861,28 @@ public:
/// more efficient if the caller knows that the address will not be exposed.
llvm::AllocaInst *CreateTempAlloca(llvm::Type *Ty, const Twine &Name = "tmp",
llvm::Value *ArraySize = nullptr);
+
+ /// CreateTempAlloca - This creates a alloca and inserts it into the entry
+ /// block. The alloca is casted to the address space of \p UseAddrSpace if
+ /// necessary.
+ RawAddress CreateTempAlloca(llvm::Type *Ty, LangAS UseAddrSpace,
+ CharUnits align, const Twine &Name = "tmp",
+ llvm::Value *ArraySize = nullptr,
+ RawAddress *Alloca = nullptr);
+
+ /// CreateTempAlloca - This creates a alloca and inserts it into the entry
+ /// block. The alloca is casted to default address space if necessary.
+ ///
+ /// FIXME: This version should be removed, and context should provide the
+ /// context use address space used instead of default.
RawAddress CreateTempAlloca(llvm::Type *Ty, CharUnits align,
const Twine &Name = "tmp",
llvm::Value *ArraySize = nullptr,
- RawAddress *Alloca = nullptr);
+ RawAddress *Alloca = nullptr) {
+ return CreateTempAlloca(Ty, LangAS::Default, align, Name, ArraySize,
+ Alloca);
+ }
+
RawAddress CreateTempAllocaWithoutCast(llvm::Type *Ty, CharUnits align,
const Twine &Name = "tmp",
llvm::Value *ArraySize = nullptr);