mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-18 22:03:14 +01:00
Fix error diagnosis for test fail91.
This commit is contained in:
@@ -30,6 +30,11 @@
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void DtoResolveStruct(StructDeclaration* sd)
|
||||
{
|
||||
DtoResolveStruct(sd, sd->loc);
|
||||
}
|
||||
|
||||
void DtoResolveStruct(StructDeclaration* sd, Loc& callerLoc)
|
||||
{
|
||||
// Make sure to resolve each struct type exactly once.
|
||||
if (sd->ir.resolved) return;
|
||||
@@ -44,7 +49,7 @@ void DtoResolveStruct(StructDeclaration* sd)
|
||||
// if it's a forward declaration, all bets are off. The type should be enough
|
||||
if (sd->sizeok != SIZEOKdone)
|
||||
{
|
||||
error("struct %s.%s unknown size", sd->getModule()->toChars(), sd->toChars());
|
||||
error(callerLoc, "struct %s.%s unknown size", sd->getModule()->toChars(), sd->toChars());
|
||||
fatal();
|
||||
}
|
||||
|
||||
|
||||
@@ -33,8 +33,13 @@ namespace llvm
|
||||
* Sets up codegen metadata and emits global data (.init, etc.), if needed.
|
||||
*
|
||||
* Has no effect on already resolved struct declarations.
|
||||
*
|
||||
* callerLoc is the location of the expression which requires the struct type
|
||||
* (only for better diagnosis)
|
||||
*/
|
||||
void DtoResolveStruct(StructDeclaration* sd);
|
||||
void DtoResolveStruct(StructDeclaration* sd, Loc& callerLoc);
|
||||
|
||||
|
||||
/// Returns a boolean=true if the two structs are equal.
|
||||
llvm::Value* DtoStructEquals(TOK op, DValue* lhs, DValue* rhs);
|
||||
|
||||
@@ -2142,7 +2142,7 @@ DValue* NewExp::toElem(IRState* p)
|
||||
}
|
||||
else {
|
||||
assert(ts->sym);
|
||||
DtoResolveStruct(ts->sym);
|
||||
DtoResolveStruct(ts->sym, loc);
|
||||
DtoAggrCopy(mem, ts->sym->ir.irAggr->getInitSymbol());
|
||||
}
|
||||
if (ts->sym->isNested() && ts->sym->vthis)
|
||||
|
||||
Reference in New Issue
Block a user