diff gen/toir.cpp @ 164:a64becf2a702 trunk

[svn r180] Fixed complex negation, and tango.math.Math now compiles.
author lindquist
date Mon, 05 May 2008 20:28:59 +0200
parents a8cd9bc1021a
children adca7f32fb6d
line wrap: on
line diff
--- a/gen/toir.cpp	Mon May 05 07:36:29 2008 +0200
+++ b/gen/toir.cpp	Mon May 05 20:28:59 2008 +0200
@@ -2394,8 +2394,12 @@
     LOG_SCOPE;
 
     DValue* l = e1->toElem(p);
+
+    if (type->iscomplex()) {
+        return DtoComplexNeg(type, l);
+    }
+
     llvm::Value* val = l->getRVal();
-
     Type* t = DtoDType(type);
 
     llvm::Value* zero = 0;
@@ -2407,7 +2411,10 @@
         else if (t->ty == Tfloat64 || t->ty == Tfloat80 || t->ty == Timaginary64 || t->ty == Timaginary80)
             zero = llvm::ConstantFP::get(val->getType(), llvm::APFloat(0.0));
         else
-        assert(0);
+        {
+            Logger::println("unhandled fp negation of type %s", t->toChars());
+            assert(0);
+        }
     }
     else
         assert(0);