Require Type::Equal() for all type equality comparisons.

Previously, we uniqued AtomicTypes, so that they could be compared
by pointer equality, but with forthcoming SOA variability changes,
this would become too unwieldy (lacking a more general / ubiquitous
type uniquing implementation.)
This commit is contained in:
Matt Pharr
2012-03-05 06:40:34 -08:00
parent e482d29951
commit 3082ea4765
11 changed files with 299 additions and 462 deletions

View File

@@ -355,7 +355,7 @@ Function::emitCode(FunctionEmitContext *ctx, llvm::Function *function,
// issue a warning. Also need to warn if it's the entry block for
// the function (in which case it will not have predeccesors but is
// still reachable.)
if (type->GetReturnType() != AtomicType::Void &&
if (Type::Equal(type->GetReturnType(), AtomicType::Void) == false &&
(pred_begin(ec.bblock) != pred_end(ec.bblock) || (ec.bblock == entryBBlock)))
Warning(sym->pos, "Missing return statement in function returning \"%s\".",
type->rType->GetString().c_str());