comparison gen/toir.cpp @ 1511:5b66008246bb

Implement equality comparison for associative arrays. The semantics aren't in the spec, but DMD does a simple pointer comparison. Complaints about this go to http://d.puremagic.com/issues/show_bug.cgi?id=1429 :P.
author Frits van Bommel <fvbommel wxs.nl>
date Sun, 21 Jun 2009 00:12:29 +0200
parents cc5fee7836dc
children 09734fb929c0
comparison
equal deleted inserted replaced
1510:b6b6afc2dfc7 1511:5b66008246bb
1446 1446
1447 LLValue* eval = 0; 1447 LLValue* eval = 0;
1448 1448
1449 // the Tclass catches interface comparisons, regular 1449 // the Tclass catches interface comparisons, regular
1450 // class equality should be rewritten as a.opEquals(b) by this time 1450 // class equality should be rewritten as a.opEquals(b) by this time
1451 if (t->isintegral() || t->ty == Tpointer || t->ty == Tclass) 1451 if (t->isintegral() || t->ty == Tpointer || t->ty == Tclass || t->ty == Taarray)
1452 { 1452 {
1453 Logger::println("integral or pointer or interface"); 1453 Logger::println("integral or pointer or interface");
1454 llvm::ICmpInst::Predicate cmpop; 1454 llvm::ICmpInst::Predicate cmpop;
1455 switch(op) 1455 switch(op)
1456 { 1456 {