diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-02-09 02:48:28 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-02-09 02:48:28 +0000 |
commit | a7566f163ae322e478bd0ef1cc49978475549a02 (patch) | |
tree | b63a5558c31c069d2582b74b49d82fb3af2a3e80 /clang/lib/CodeGen/CodeGenFunction.h | |
parent | c3adf44885d75326b607b1772c5d3618b7f91ae2 (diff) | |
download | bcm5719-llvm-a7566f163ae322e478bd0ef1cc49978475549a02.tar.gz bcm5719-llvm-a7566f163ae322e478bd0ef1cc49978475549a02.zip |
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.
llvm-svn: 95648
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index 64274d16d8e..0e601e5d280 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/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); |