aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenFunction.h
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-02-09 02:48:28 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-02-09 02:48:28 +0000
commit195337d2e5d4625ae9dc1328c7cdbc7115b0261b (patch)
tree26b92950c3fa7023d4e4d136f649b52da1088eb2 /lib/CodeGen/CodeGenFunction.h
parente180ed2f014d49587bc49f09313cabf38080d6fa (diff)
IRgen: Add CreateMemTemp, for creating an temporary memory object for a particular type, and flood fill. - CreateMemTemp sets the alignment on the alloca correctly, which fixes a great many places in IRgen where we were doing the wrong thing.
- This fixes many many more places than the test case, but my feeling is we need to audit alignment systematically so I'm not inclined to try hard to test the individual fixes in this patch. If this bothers you, patches welcome! PR6240. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95648 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.h')
-rw-r--r--lib/CodeGen/CodeGenFunction.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h
index 64274d16d8..0e601e5d28 100644
--- a/lib/CodeGen/CodeGenFunction.h
+++ b/lib/CodeGen/CodeGenFunction.h
@@ -655,10 +655,15 @@ public:
}
/// CreateTempAlloca - This creates a alloca and inserts it into the entry
- /// block.
+ /// block. The caller is responsible for setting an appropriate alignment on
+ /// the alloca.
llvm::AllocaInst *CreateTempAlloca(const llvm::Type *Ty,
const llvm::Twine &Name = "tmp");
+ /// CreateMemTemp - Create a temporary memory object of the given type, with
+ /// appropriate alignment.
+ llvm::Value *CreateMemTemp(QualType T, const llvm::Twine &Name = "tmp");
+
/// EvaluateExprAsBool - Perform the usual unary conversions on the specified
/// expression and compare the result against zero, returning an Int1Ty value.
llvm::Value *EvaluateExprAsBool(const Expr *E);