changeset 631:9fcb5f1a4c54

Automated merge with http://hg.dsource.org/projects/llvmdc
author Christian Kamm <kamm incasoftware de>
date Wed, 01 Oct 2008 21:14:20 +0200
parents 607b6b5819a7 (diff) bc83491463f0 (current diff)
children d208fc4291df
files
diffstat 2 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gen/llvm.h	Wed Oct 01 21:14:15 2008 +0200
+++ b/gen/llvm.h	Wed Oct 01 21:14:20 2008 +0200
@@ -17,6 +17,9 @@
 #include "llvm/Support/IRBuilder.h"
 using llvm::IRBuilder;
 
+// for WriteTypeSymbolic
+#include "llvm/Assembly/Writer.h"
+
 #define GET_INTRINSIC_DECL(_X) (llvm::Intrinsic::getDeclaration(gIR->module, llvm::Intrinsic:: _X ))
 
 // shortcuts for the common llvm types
--- a/gen/toir.cpp	Wed Oct 01 21:14:15 2008 +0200
+++ b/gen/toir.cpp	Wed Oct 01 21:14:20 2008 +0200
@@ -1954,7 +1954,7 @@
         ?   p->ir->CreateFCmpOEQ(l,r,"tmp")
         :   p->ir->CreateFCmpONE(l,r,"tmp");
     }
-    else if (t1->ty == Tpointer)
+    else if (t1->ty == Tpointer || t1->ty == Tclass)
     {
         if (l->getType() != r->getType()) {
             if (v->isNull())
@@ -1967,6 +1967,7 @@
         :   p->ir->CreateICmpNE(l,r,"tmp");
     }
     else {
+        assert(l->getType() == r->getType());
         eval = (op == TOKidentity)
         ?   p->ir->CreateICmpEQ(l,r,"tmp")
         :   p->ir->CreateICmpNE(l,r,"tmp");