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
2683d4fb
Commit
2683d4fb
authored
Dec 12, 2020
by
Christoph Reichenbach
Browse files
Improved source location reporting
parent
b6d2c339
Changes
2
Show whitespace changes
Inline
Side-by-side
compiler/teal0/backend/IRGen.jrag
View file @
2683d4fb
...
...
@@ -310,7 +310,9 @@ aspect IRGen {
// formal param types
lang.ir.List<IRTypeRef> irTypes = new lang.ir.List<>();
for (VarDecl d : getFormals()) {
irTypes.add(d.variableType().genIRTypeRef());
IRTypeRef tyref = d.variableType().genIRTypeRef();
tyref.setSourceLocation(d.sourceLocation());
irTypes.add(tyref);
}
func.setParamTypeList(irTypes);
// return type, if any
...
...
@@ -466,6 +468,7 @@ aspect IRGen {
// copy this to the return value
ctx.addInsn(new IRCopyInsn(new IRVarRef(ctx.getReturnVar()), retVal));
IRCodeBB currentBB = ctx.getCurrentBB();
IRReturn ret = new IRReturn(new IRVarRef(ctx.getReturnVar()));
ret.setSourceLocation(sourceLocation());
currentBB.setIRCodeExit(ret);
...
...
compiler/teal0/backend/IRGenExpr.jrag
View file @
2683d4fb
...
...
@@ -130,6 +130,7 @@ aspect IRGenExpr {
ctx.addInsn(new IRConstantInsn(size, new IRInteger((long) this.getNumExpr())));
IRNewArrayInsn newInsn = new IRNewArrayInsn().setDst(dst)
.setIRType((IRType) IRModule.makeAnyTypeRef()).setSize(size); // FIXME: more precise type if we get type inference
newInsn.setSourceLocation(this.sourceLocation());
ctx.addInsn(newInsn);
long indexCounter = 0;
...
...
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