Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Christoph Reichenbach
EDAP15-exercise-3
Commits
aa764e36
Commit
aa764e36
authored
Dec 07, 2020
by
Alexandru Dura
Committed by
Christoph Reichenbach
Dec 10, 2020
Browse files
Precise source locations for new-expression arguments
parent
0ce7f25d
Changes
1
Hide whitespace changes
Inline
Side-by-side
compiler/teal2/backend/IRGenExpr.jrag
View file @
aa764e36
...
@@ -33,6 +33,8 @@ aspect IRGenExpr {
...
@@ -33,6 +33,8 @@ aspect IRGenExpr {
.setIRType((IRType) getType().genIR());
.setIRType((IRType) getType().genIR());
ctx.addInsn(newInsn);
ctx.addInsn(newInsn);
ctx.setSourceLocations(this.sourceLocation());
// generate initialization code
// generate initialization code
if (type.getNumFunFormal() != getNumActual()) {
if (type.getNumFunFormal() != getNumActual()) {
throw new RuntimeException("Mismatch between the number of formal and actual parameters in " + this + ".");
throw new RuntimeException("Mismatch between the number of formal and actual parameters in " + this + ".");
...
@@ -44,10 +46,9 @@ aspect IRGenExpr {
...
@@ -44,10 +46,9 @@ aspect IRGenExpr {
VarDecl formal = type.getFunFormal(i);
VarDecl formal = type.getFunFormal(i);
ctx.addInsn(new IRStoreInsn().setBase(dst)
ctx.addInsn(new IRStoreInsn().setBase(dst)
.setField(new IRVarRef(formal.genIR())).setSrc(tmp));
.setField(new IRVarRef(formal.genIR())).setSrc(tmp));
ctx.setSourceLocations(actual.sourceLocation());
}
}
ctx.setSourceLocations(this.sourceLocation());
// return a reference to the allocated storage
// return a reference to the allocated storage
return dst;
return dst;
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment