Skip to content

Commit

Permalink
removed unnecessary print statements
Browse files Browse the repository at this point in the history
  • Loading branch information
Westsi committed Jul 2, 2024
1 parent 0c2abb1 commit 8bc53f7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
5 changes: 0 additions & 5 deletions codegen/aarch64_clang/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ func (g *AARCH64Generator) GenerateExpression(node ast.Expression) StorageLoc {
func (g *AARCH64Generator) GenerateBlock(b *ast.BlockStatement) {
defer tracer.Untrace(tracer.Trace("GenerateBlock"))
for _, stmt := range b.Statements {
fmt.Println(stmt.NType())
switch stmt := stmt.(type) {
case *ast.FunctionDefinition:
g.GenerateFunction(stmt)
Expand Down Expand Up @@ -274,7 +273,6 @@ func (g *AARCH64Generator) GetNextEmptyStackLoc() int {
func (g *AARCH64Generator) GenerateVarDef(v *ast.VarStatement) {
tracer.Trace("GenerateVarDef")
defer tracer.Untrace("GenerateVarDef")
fmt.Printf("%T\n", v.Value.(*ast.ExpressionStatement).Expression)
sloc := g.GenerateExpression(v.Value.(*ast.ExpressionStatement).Expression)
if sloc == NULLSTORAGE {
fmt.Println("\033[31mPROBLEM PANICCCCCCC\033[0m")
Expand All @@ -294,8 +292,6 @@ func (g *AARCH64Generator) GenerateInfix(node *ast.InfixExpression) StorageLoc {
defer tracer.Untrace("GenerateInfix")
leftS, rightS, destLoc := g.GetInfixOperands(node)

fmt.Println(node.Operator)

switch node.Operator {
case "+":
g.out.WriteString("add ")
Expand Down Expand Up @@ -324,7 +320,6 @@ func (g *AARCH64Generator) GetInfixOperands(node *ast.InfixExpression) (string,
switch left := node.Left.(type) {
case *ast.Identifier:
leftS = StorageLocs[g.GenerateIdentifier(left)]
fmt.Println(leftS)
case *ast.InfixExpression:
leftS = StorageLocs[g.GenerateInfix(left)]
case *ast.CallExpression:
Expand Down
3 changes: 0 additions & 3 deletions codegen/x86_64_as/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ func (g *X64Generator) GenerateBlock(b *ast.BlockStatement) {
tracer.Trace("GenerateBlock")
defer tracer.Untrace("GenerateBlock")
for _, stmt := range b.Statements {
fmt.Println(stmt.NType())
switch stmt := stmt.(type) {
case *ast.FunctionDefinition:
g.GenerateFunction(stmt)
Expand Down Expand Up @@ -223,7 +222,6 @@ func (g *X64Generator) GenerateFunction(f *ast.FunctionDefinition) {
func (g *X64Generator) GenerateVarDef(v *ast.VarStatement) {
tracer.Trace("GenerateVarDef")
defer tracer.Untrace("GenerateVarDef")
fmt.Printf("%T\n", v.Value.(*ast.ExpressionStatement).Expression)
sloc := g.GenerateExpression(v.Value.(*ast.ExpressionStatement).Expression)
if sloc == NULLSTORAGE {
fmt.Println("\033[31mPROBLEM PANICCCCCCC\033[0m")
Expand Down Expand Up @@ -363,7 +361,6 @@ func (g *X64Generator) GetInfixOperands(node *ast.InfixExpression) (string, stri
case *ast.Identifier:
leftLoc = g.GenerateIdentifier(left)
leftS = StorageLocs[leftLoc]
fmt.Println(leftS)
case *ast.InfixExpression:
leftS = StorageLocs[g.GenerateInfix(left)]
case *ast.IntegerLiteral:
Expand Down
8 changes: 5 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ func main() {
}
opts.BaseDir = strings.Join(strings.Split(opts.Fname, "/")[0:len(strings.Split(opts.Fname, "/"))-1], "/") + "/"
opts.Fname = strings.Split((strings.Split(opts.Fname, "/")[len(strings.Split(opts.Fname, "/"))-1]), ".")[0]
fmt.Println(opts)
if opts.Debug {
fmt.Println(opts)
}
run(opts)
}

Expand Down Expand Up @@ -86,7 +88,7 @@ func Compile(opts *Options, lexer *lex.Lexer) {
if len(p.Errors()) > 0 {
os.Exit(1)
}
fmt.Println(ast.String())
// fmt.Println(ast.String())
var cg codegen.CodeGenerator
switch opts.TargetArch {
case "x86_64":
Expand Down Expand Up @@ -122,7 +124,7 @@ func ResolveImports(prevImps []string, baseDir, imp string) ([]*lex.Lexer, []str
}
globalDefines[k] = v
}
fmt.Println("Imported:", imported)
// fmt.Println("Imported:", imported)
prevImps = append(prevImps, imp)
for _, imp := range imported {
l, pi := ResolveImports(prevImps, baseDir, imp)
Expand Down

0 comments on commit 8bc53f7

Please sign in to comment.