Skip to content

Commit

Permalink
- Change info logging to debug logging for generated code
Browse files Browse the repository at this point in the history
  • Loading branch information
whtoo committed Dec 5, 2023
1 parent 2a459e1 commit 71b275e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ep20/src/main/java/org/teachfx/antlr4/ep20/Compiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected static void printIRTree(List<IRNode> irNodeList) {
}
return " "+irNode.toString();
}).reduce((a, b) -> a + "\n" + b);
logger.info("IR Tree:" + "\n"+prettyFormatText.get());
prettyFormatText.ifPresent(logger::debug);
}

public static void main(String[] args) throws IOException {
Expand Down Expand Up @@ -70,7 +70,7 @@ public static void main(String[] args) throws IOException {
var assembler = new CymbolAssembler();
assembler.visit(codeBuffer);
saveToEp18Res(assembler.getAsmInfo());
logger.info("\n%s".formatted(assembler.getAsmInfo()));
logger.debug("\n%s".formatted(assembler.getAsmInfo()));
}

protected static void saveToEp18Res(String buffer) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import org.teachfx.antlr4.ep20.ir.IRVisitor;
import org.teachfx.antlr4.ep20.ir.expr.Expr;
import org.teachfx.antlr4.ep20.ir.expr.Operand;
import org.teachfx.antlr4.ep20.ir.expr.VarSlot;
import org.teachfx.antlr4.ep20.symtab.type.OperatorType;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ public class BasicBlock<I extends IRNode> implements Comparable<BasicBlock<I>>,
// Generate codes
public List<Loc<I>> codes;
public Kind kind;

// For data flow analysis
public Set<Operand> def;
public Set<Operand> liveUse;
public Set<Operand> liveIn;
public Set<Operand> liveOut;

protected Label label;

public BasicBlock(Kind kind, List<Loc<I>> codes,Label label,int ord) {
Expand Down

0 comments on commit 71b275e

Please sign in to comment.