[llvm-commits] [llvm-gcc-4.2] r77282 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Bob Wilson
bob.wilson at apple.com
Mon Jul 27 17:21:56 PDT 2009
Author: bwilson
Date: Mon Jul 27 19:21:55 2009
New Revision: 77282
URL: http://llvm.org/viewvc/llvm-project?rev=77282&view=rev
Log:
Handle builtin functions with aggregate operands.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=77282&r1=77281&r2=77282&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Mon Jul 27 19:21:55 2009
@@ -4696,8 +4696,16 @@
// Get the result type and operand line in an easy to consume format.
const Type *ResultType = ConvertType(TREE_TYPE(TREE_TYPE(fndecl)));
std::vector<Value*> Operands;
- for (tree Op = TREE_OPERAND(exp, 1); Op; Op = TREE_CHAIN(Op))
- Operands.push_back(Emit(TREE_VALUE(Op), 0));
+ for (tree Op = TREE_OPERAND(exp, 1); Op; Op = TREE_CHAIN(Op)) {
+ tree OpVal = TREE_VALUE(Op);
+ if (isAggregateTreeType(TREE_TYPE(OpVal))) {
+ MemRef OpLoc = CreateTempLoc(ConvertType(TREE_TYPE(OpVal)));
+ Emit(OpVal, &OpLoc);
+ Operands.push_back(Builder.CreateLoad(OpLoc.Ptr));
+ } else {
+ Operands.push_back(Emit(OpVal, NULL));
+ }
+ }
unsigned FnCode = DECL_FUNCTION_CODE(fndecl);
return LLVM_TARGET_INTRINSIC_LOWER(exp, FnCode, DestLoc, Result, ResultType,
More information about the llvm-commits
mailing list