[llvm-commits] CVS: llvm-gcc/gcc/llvm-expand.c
Chris Lattner
lattner at cs.uiuc.edu
Tue Sep 20 23:54:40 PDT 2005
Changes in directory llvm-gcc/gcc:
llvm-expand.c updated: 1.112 -> 1.113
---
Log message:
Fix PR629: http://llvm.cs.uiuc.edu/PR629 and Regression/CFrontend/2005-09-20-ComplexConstants.c
---
Diffs of the changes: (+14 -2)
llvm-expand.c | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
Index: llvm-gcc/gcc/llvm-expand.c
diff -u llvm-gcc/gcc/llvm-expand.c:1.112 llvm-gcc/gcc/llvm-expand.c:1.113
--- llvm-gcc/gcc/llvm-expand.c:1.112 Thu Jul 28 17:37:20 2005
+++ llvm-gcc/gcc/llvm-expand.c Wed Sep 21 01:54:29 2005
@@ -5390,6 +5390,20 @@
}
break;
+ case COMPLEX_CST: {
+ llvm_value **Vals = (llvm_value **)xmalloc(2*sizeof(llvm_value *));
+ assert(ReqTy == Ty);
+ assert(Ty->ID == StructTyID && Ty->NumElements == 2 &&
+ Ty->Elements[0] == Ty->Elements[1] &&
+ "Very strange complex number.");
+ Vals[0] = D2V(llvm_expand_constant_expr(TREE_REALPART(exp),
+ Ty->Elements[0]));
+ Vals[1] = D2V(llvm_expand_constant_expr(TREE_IMAGPART(exp),
+ Ty->Elements[1]));
+ Val = G2V(llvm_constant_aggregate_new(Ty, Vals));
+ break;
+ }
+
case NOP_EXPR: /* Cast constant_expr */
case NON_LVALUE_EXPR:
case CONVERT_EXPR:
@@ -6368,13 +6382,11 @@
op1 = llvm_expand_expr(Fn, TREE_IMAGPART(exp), 0);
InitializeComplex(Fn, DestLoc, op0, op1, expVolatile);
break;
-
case COMPLEX_EXPR:
op0 = llvm_expand_expr(Fn, TREE_OPERAND(exp, 0), 0);
op1 = llvm_expand_expr(Fn, TREE_OPERAND(exp, 1), 0);
InitializeComplex(Fn, DestLoc, op0, op1, expVolatile);
break;
-
case INTEGER_CST:
case REAL_CST:
Result = D2V(llvm_expand_constant_expr(exp, DestTy));
More information about the llvm-commits
mailing list