Commit aa764e36 authored by Alexandru Dura's avatar Alexandru Dura Committed by Christoph Reichenbach
Browse files

Precise source locations for new-expression arguments

parent 0ce7f25d
......@@ -33,6 +33,8 @@ aspect IRGenExpr {
.setIRType((IRType) getType().genIR());
ctx.addInsn(newInsn);
ctx.setSourceLocations(this.sourceLocation());
// generate initialization code
if (type.getNumFunFormal() != getNumActual()) {
throw new RuntimeException("Mismatch between the number of formal and actual parameters in " + this + ".");
......@@ -44,10 +46,9 @@ aspect IRGenExpr {
VarDecl formal = type.getFunFormal(i);
ctx.addInsn(new IRStoreInsn().setBase(dst)
.setField(new IRVarRef(formal.genIR())).setSrc(tmp));
ctx.setSourceLocations(actual.sourceLocation());
}
ctx.setSourceLocations(this.sourceLocation());
// return a reference to the allocated storage
return dst;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment