Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
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
1b1bca9a
Commit
1b1bca9a
authored
Dec 04, 2020
by
Alexandru Dura
Browse files
Print source location for ret IR instructions
parent
8ec98cef
Changes
2
Hide whitespace changes
Inline
Side-by-side
compiler/teal0/backend/IRGen.jrag
View file @
1b1bca9a
...
...
@@ -465,7 +465,9 @@ aspect IRGen {
// copy this to the return value
ctx.addInsn(new IRCopyInsn(new IRVarRef(ctx.getReturnVar()), retVal));
IRCodeBB currentBB = ctx.getCurrentBB();
currentBB.setIRCodeExit(new IRReturn(new IRVarRef(ctx.getReturnVar())));
IRReturn ret = new IRReturn(new IRVarRef(ctx.getReturnVar()));
ret.setSourceLocation(sourceLocation());
currentBB.setIRCodeExit(ret);
// ctx will auto-start a new basic block to hold the translation
// of any (unreachable) statements following the return if needed.
ctx.endBB();
...
...
ir/teal0/ast/IRPrint.jrag
View file @
1b1bca9a
...
...
@@ -131,6 +131,11 @@ aspect IRPrint {
public void IRReturn.print(PrintStream out) {
out.print("ret ");
getIRVarRef().print(out);
if (IRProgram.printSourceLocations) {
out.print("\t");
getSourceLocation().print(out);
}
}
public void IRJump.print(PrintStream out) {
...
...
Write
Preview
Markdown
is supported
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