[llvm-commits] [dragonegg] r158006 - in /dragonegg/trunk: include/dragonegg/Internals.h src/Convert.cpp
Duncan Sands
baldrick at free.fr
Tue Jun 5 10:36:08 PDT 2012
Author: baldrick
Date: Tue Jun 5 12:36:08 2012
New Revision: 158006
URL: http://llvm.org/viewvc/llvm-project?rev=158006&view=rev
Log:
Fix PR13025: add support for BUILT_IN_ALLOCA_WITH_ALIGN, which was added in
gcc-4.7. The testcase is waiting on testsuite support for different gcc
versions.
Modified:
dragonegg/trunk/include/dragonegg/Internals.h
dragonegg/trunk/src/Convert.cpp
Modified: dragonegg/trunk/include/dragonegg/Internals.h
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/include/dragonegg/Internals.h?rev=158006&r1=158005&r2=158006&view=diff
==============================================================================
--- dragonegg/trunk/include/dragonegg/Internals.h (original)
+++ dragonegg/trunk/include/dragonegg/Internals.h Tue Jun 5 12:36:08 2012
@@ -619,6 +619,7 @@
bool EmitBuiltinAdjustTrampoline(gimple_statement_d *stmt, Value *&Result);
bool EmitBuiltinAlloca(gimple_statement_d *stmt, Value *&Result);
+ bool EmitBuiltinAllocaWithAlign(gimple_statement_d *stmt, Value *&Result);
bool EmitBuiltinBZero(gimple_statement_d *stmt, Value *&Result);
bool EmitBuiltinConstantP(gimple_statement_d *stmt, Value *&Result);
bool EmitBuiltinExpect(gimple_statement_d *stmt, Value *&Result);
Modified: dragonegg/trunk/src/Convert.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Convert.cpp?rev=158006&r1=158005&r2=158006&view=diff
==============================================================================
--- dragonegg/trunk/src/Convert.cpp (original)
+++ dragonegg/trunk/src/Convert.cpp Tue Jun 5 12:36:08 2012
@@ -4200,6 +4200,8 @@
case BUILT_IN_ADJUST_TRAMPOLINE:
return EmitBuiltinAdjustTrampoline(stmt, Result);
case BUILT_IN_ALLOCA: return EmitBuiltinAlloca(stmt, Result);
+ case BUILT_IN_ALLOCA_WITH_ALIGN:
+ return EmitBuiltinAllocaWithAlign(stmt, Result);
case BUILT_IN_BZERO: return EmitBuiltinBZero(stmt, Result);
case BUILT_IN_CONSTANT_P: return EmitBuiltinConstantP(stmt, Result);
case BUILT_IN_EXPECT: return EmitBuiltinExpect(stmt, Result);
@@ -5727,6 +5729,17 @@
return true;
}
+bool TreeToLLVM::EmitBuiltinAllocaWithAlign(gimple stmt, Value *&Result) {
+ if (!validate_gimple_arglist(stmt, INTEGER_TYPE, INTEGER_TYPE, VOID_TYPE))
+ return false;
+ Value *Amt = EmitMemory(gimple_call_arg(stmt, 0));
+ uint64_t Align = getInt64(gimple_call_arg(stmt, 1), true);
+ AllocaInst *Alloca = Builder.CreateAlloca(Type::getInt8Ty(Context), Amt);
+ Alloca->setAlignment(Align / 8);
+ Result = Alloca;
+ return true;
+}
+
bool TreeToLLVM::EmitBuiltinExpect(gimple stmt, Value *&Result) {
tree type = gimple_call_return_type(stmt);
if (gimple_call_num_args(stmt) < 2) {
More information about the llvm-commits
mailing list