Commit Graph

273 Commits

Author SHA1 Message Date
Minero Aoki 21f7253fc9 r4827@macbookpro: aamine | 2009-05-11 01:47:38 +0900
* net/loveruby/cflat/codegenerator/CodeGenerator.java -> net/loveruby/cflat/sysdep
 * net/loveruby/cflat/codegenerator/CodeGeneratorOptions.java -> net/loveruby/cflat/sysdep
 * net/loveruby/cflat/sysdep/Platform.java: ditto.
 * net/loveruby/cflat/sysdep/x86/CodeGenerator.java: ditto.
 * net/loveruby/cflat/sysdep/x86/X86Linux.java: ditto.
 * net/loveruby/cflat/compiler/Compiler.java: ditto.
 * net/loveruby/cflat/compiler/Options.java: ditto.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4205 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-10 16:49:48 +00:00
Minero Aoki 3a7d40e63d r4826@macbookpro: aamine | 2009-05-11 01:40:01 +0900
* net/loveruby/cflat/sysdep/x86/CodeGenerator.java: use PeepholeOptimizer directly.
 * net/loveruby/cflat/asm/PeepholeOptimizer.java -> net/loveruby/cflat/sysdep/x86
 * net/loveruby/cflat/asm/AsmOptimizer.java: removed.
 * net/loveruby/cflat/codegenerator/CodeGeneratorOptions.java: should not provide PeepholeOptimizer, just provide optimizationLevel.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4204 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-10 16:49:47 +00:00
Minero Aoki c970823e99 r4825@macbookpro: aamine | 2009-05-11 01:31:01 +0900
* net/loveruby/cflat/compiler/Compiler.java: move dumper code to AST to minimize Compiler code.
 * net/loveruby/cflat/ast/AST.java: add dumper code.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4203 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-10 16:49:46 +00:00
Minero Aoki 703b44faf5 r4824@macbookpro: aamine | 2009-05-11 01:09:13 +0900
* net/loveruby/cflat/compiler/IRGenerator.java: generate address expression for LHS expr.
 * net/loveruby/cflat/sysdep/x86/CodeGenerator.java: remove #compileLHS.  Just compile LHS expr.
 * net/loveruby/cflat/ir/Addr.java: is a constant address now.
 * net/loveruby/cflat/ir/Var.java: is not a constant address now.
 * net/loveruby/cflat/ir/Expr.java: new base method #addressNode.
 * net/loveruby/cflat/ir/Mem.java: override #addressNode.
 * net/loveruby/cflat/ir/Var.java: ditto.
 * net/loveruby/cflat/ir/Addr.java: ditto.
 * net/loveruby/cflat/ir/Expr.java: new base method #getEntityForce.
 * net/loveruby/cflat/ir/Var.java: override #getEntityForce.
 * net/loveruby/cflat/ir/Addr.java: ditto.
 * net/loveruby/cflat/ir/Call.java: get function entity by Expr#getEntityForce.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4202 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-10 16:49:45 +00:00
Minero Aoki 5c0f37ca8a r4815@macbookpro: aamine | 2009-05-10 23:48:56 +0900
* net/loveruby/cflat/parser/Parser.jj: define SOURCE_ENCODING here (again).
 * net/loveruby/cflat/compiler/Constants.java: removed.
 * net/loveruby/cflat/compiler/CodeGenerator.java -> net/loveruby/cflat/codegenerator
 * net/loveruby/cflat/compiler/CodeGeneratorOptions.java -> net/loveruby/cflat/codegenerator
 * net/loveruby/cflat/compiler/Platform.java -> net/loveruby/cflat/sysdep
 * net/loveruby/cflat/compiler/ErrorHandler.java -> net/loveruby/cflat/utils
 * net/loveruby/cflat/compiler/LibraryLoader.java -> net/loveruby/cflat/parser
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4201 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-10 14:52:00 +00:00
Minero Aoki b2bf10c92d r4814@macbookpro: aamine | 2009-05-10 23:05:44 +0900
* net/loveruby/cflat/sysdep/x86/CodeGenerator.java: move virtual stack to AssemblyFile.
 * net/loveruby/cflat/sysdep/x86/AssemblyFile.java: ditto.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4200 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-10 14:51:58 +00:00
Minero Aoki c1dfb94513 r4813@macbookpro: aamine | 2009-05-10 22:46:19 +0900
* net/loveruby/cflat/sysdep/x86/CodeGenerator.java: protected -> private.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4199 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-10 14:51:57 +00:00
Minero Aoki 2bfba83992 r4811@macbookpro: aamine | 2009-05-10 22:41:42 +0900
* net/loveruby/cflat/sysdep/x86: new package.
 * net/loveruby/cflat/asm/ELFConstants.java -> net/loveruby/cflat/sysdep/x86
 * net/loveruby/cflat/asm/AssemblyFile.java -> net/loveruby/cflat/sysdep/x86
 net/loveruby/cflat/asm/Register.java
 * net/loveruby/cflat/platform/X86Linux.java -> net/loveruby/cflat/sysdep/x86
 * net/loveruby/cflat/compiler/CodeGenerator.java -> net/loveruby/cflat/sysdep/x86
 * net/loveruby/cflat/platform/Platform.java -> net/loveruby/cflat/compiler
 * net/loveruby/cflat/sysdep/x86/Register.java: new file.
 * net/loveruby/cflat/compiler/Options.java: new method #codeGenerator.
 * net/loveruby/cflat/compiler/Compiler.java: get CodeGenerator from Options.
 * net/loveruby/cflat/compiler/CodeGeneratorOptions.java: make public.
 * net/loveruby/cflat/ir/IR.java: now naturalType is useless (provided by CodeGenerator).
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4197 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-10 14:51:56 +00:00
Minero Aoki 2e1cbdaf66 r4808@macbookpro: aamine | 2009-05-10 20:23:48 +0900
* net/loveruby/cflat/asm/Assembler.java -> AssemblyFile.java
 * net/loveruby/cflat/utils/AsmUtils.java: split #align from AssemblyFile.
 * net/loveruby/cflat/type/StructType.java: use it.
 * net/loveruby/cflat/type/UnionType.java: use it.
 * net/loveruby/cflat/platform: new package to extract platform dependent operations.
 * net/loveruby/cflat/compiler/Compiler.java: use it.
 * net/loveruby/cflat/compiler/CodeGenerator.java: use it.
 * net/loveruby/cflat/compiler/Options.java: provide Platform object.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4194 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-10 14:51:53 +00:00
Minero Aoki 6e8bfed7a3 r4762@macbookpro: aamine | 2009-05-07 13:00:19 +0900
* net/loveruby/cflat/compiler/IRGenerator.java: should not return Expr for stmt, to suppress wrong warning.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4193 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-08 10:41:03 +00:00
Minero Aoki 2ce6ddbd93 r4760@macbookpro: aamine | 2009-05-07 12:55:51 +0900
* net/loveruby/cflat/compiler/IRGenerator.java (AddressNode): always omit Addr for #shouldEvaluatedToAddress node.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4191 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-08 10:41:02 +00:00
Minero Aoki e06185e56d r4756@macbookpro: aamine | 2009-05-07 11:06:57 +0900
* net/loveruby/cflat/compiler/IRGenerator.java (BinaryOpNode): evaluate RIGHT before LEFT.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4189 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-08 10:41:00 +00:00
Minero Aoki 586a7d8bd3 r4754@macbookpro: aamine | 2009-05-07 10:31:21 +0900
* net/loveruby/cflat/compiler/IRGenerator.java: fix compile error.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4187 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-08 10:40:59 +00:00
Minero Aoki 9f4a9fc8bc r4753@macbookpro: aamine | 2009-05-07 10:01:52 +0900
* net/loveruby/cflat/compiler/IRGenerator.java: emit statement info for casted stmt.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4186 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-08 10:40:59 +00:00
Minero Aoki 8a57dbbdd8 r4751@macbookpro: aamine | 2009-05-06 18:40:33 +0900
* net/loveruby/cflat/compiler/IRGenerator.java: assignBeforeStmt is useless.  Use assign instead.
 * net/loveruby/cflat/compiler/IRGenerator.java: should be able to create tmp in variable initializers for also function toplevel block.
 * net/loveruby/cflat/compiler/IRGenerator.java: move funcall before stmt.
 * net/loveruby/cflat/compiler/CodeGenerator.java: do not display "(null)" location.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4184 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-08 10:40:57 +00:00
Minero Aoki 98937145c8 r4749@macbookpro: aamine | 2009-05-06 17:08:10 +0900
* net/loveruby/cflat/compiler/CodeGenerator.java: refactoring: rename variables.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4183 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-08 10:40:56 +00:00
Minero Aoki ec4ae3acfd r4747@macbookpro: aamine | 2009-05-06 15:49:51 +0900
* net/loveruby/cflat/asm/Type.java: types should not know signed or not.
 * net/loveruby/cflat/ir/Op.java: have signed/unsigned information.
 * net/loveruby/cflat/compiler/IRGenerator.java: use new op and type.
 * net/loveruby/cflat/compiler/CodeGenerator.java: ditto.
 * net/loveruby/cflat/compiler/TypeChecker.java (FuncallNode): should check optional argument types.
 * net/loveruby/cflat/compiler/CodeGenerator.java: now use simple mov to load values from memory (and cast it later).
 * net/loveruby/cflat/type/TypeTable.java: provide stack value type.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4182 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-08 10:40:53 +00:00
Minero Aoki 12979779e3 r4746@macbookpro: aamine | 2009-05-06 14:53:56 +0900
* net/loveruby/cflat/compiler/IRGenerator.java: isStatement() did not work correctly; e.g. return ++argc failed to return value, because ++argc was wrongly judged as statemen (is really expr).
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4181 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-08 10:40:52 +00:00
Minero Aoki e9beca5096 r4743@macbookpro: aamine | 2009-05-06 14:18:45 +0900
* net/loveruby/cflat/ir/StringValue.java -> Str.java
 * net/loveruby/cflat/ir/IntValue.java -> Int.java
 * net/loveruby/cflat/ir/IRVisitor.java: ditto.
 * net/loveruby/cflat/compiler/IRGenerator.java: ditto.
 * net/loveruby/cflat/compiler/CodeGenerator.java: ditto.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4178 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-08 10:40:50 +00:00
Minero Aoki 4a93ac31fb r4732@macbookpro: aamine | 2009-05-04 19:00:37 +0900
* net/loveruby/cflat/compiler/LocalResolver.java: create ToplevelScope, ConstantTable here (instead of creating them in AST).
 * net/loveruby/cflat/ast/AST.java: do not create ToplevelScope, ConstantTable by myself.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4175 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-08 10:40:47 +00:00
Minero Aoki 0f3e2d4609 r4668@macbookpro: aamine | 2009-05-03 22:18:01 +0900
* net/loveruby/cflat/compiler/Compiler.java: new method dumpExpr to dump single expression.
 * net/loveruby/cflat/compiler/CompilerMode.java: add enum value DumpExpr: define new option --dump-expr.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4173 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-03 14:46:16 +00:00
Minero Aoki 3c409c9bf4 r4659@macbookpro: aamine | 2009-05-03 19:08:18 +0900
* net/loveruby/cflat/parser/Parser.jj: sizeof TYPE requires one more lookahead because EXPR of "sizeof EXPR" may have parentheses, too.  We can distinguish type and expr by 1 look ahead, because Head of type() == head of typeref() == head of typeref_base().  typeref_base has unique terminal on head.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4172 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-03 14:46:13 +00:00
Minero Aoki 6f0f6f729b r4633@macbookpro: aamine | 2009-05-02 09:49:27 +0900
* net/loveruby/cflat/compiler/Compiler.java: refactoring: rename constant: programId -> ProgramName.
 * net/loveruby/cflat/compiler/Options.java: ditto.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4170 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-03 14:46:09 +00:00
Minero Aoki 05e1bc273a r4632@macbookpro: aamine | 2009-05-02 09:30:52 +0900
* net/loveruby/cflat/compiler/Compiler.java (commandMain): refactoring: extract method: #buildTarget.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4169 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-03 14:46:07 +00:00
Minero Aoki b8ed3ab439 r4629@macbookpro: aamine | 2009-04-30 22:53:58 +0900
* net/loveruby/cflat/compiler/CodeGenerator.java: remove unused method #doesSpillDX.
 * net/loveruby/cflat/compiler/CodeGenerator.java: add "left" argument to #compileBinaryOp.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4168 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-03 14:46:05 +00:00
Minero Aoki 1c13cc4aa1 r4628@macbookpro: aamine | 2009-04-30 22:19:48 +0900
* net/loveruby/cflat/ast/ConstantTable.java: move under entity/.
 * net/loveruby/cflat/ast/ConstantEntry.java: ditto.
 * net/loveruby/cflat/compiler/CodeGenerator.java: follow it.
 * net/loveruby/cflat/ast/StringLiteralNode.java: follow it.
 * net/loveruby/cflat/ir/StringValue.java: follow it.
 * net/loveruby/cflat/ir/IR.java: follow it.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4167 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-03 14:46:03 +00:00
Minero Aoki 730345ab89 r4627@macbookpro: aamine | 2009-04-30 22:06:11 +0900
* net/loveruby/cflat/ast/AbstractAssignNode.java: remove unused setter setLHS.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4166 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-03 14:45:59 +00:00
Minero Aoki a5a58d9ef8 r4626@macbookpro: aamine | 2009-04-30 21:49:44 +0900
* net/loveruby/cflat/ast/*.java: remove unused reference to asm.Label.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4165 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-03 14:45:57 +00:00
Minero Aoki e66d1b59d9 * net/loveruby/cflat/entity: new package.
* net/loveruby/cflat/ast: move Entity and its subclasses under entity/.
* net/loveruby/cflat/ast: move Scope and its subclasses under entity/.


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4162 1b9489fe-b721-0410-924e-b54b9192deb8
2009-04-26 17:55:46 +00:00
Minero Aoki 9c1be1e20f * net/loveruby/cflat/ast/DefinedFunction.java: remove unused method #epilogueLabel.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4161 1b9489fe-b721-0410-924e-b54b9192deb8
2009-04-26 17:12:20 +00:00
Minero Aoki 2f7019356a * net/loveruby/cflat/asm/Type.java: new class representing assembly integer types.
* net/loveruby/cflat/asm/*.java: support it.
* net/loveruby/cflat/ir/*.java: support it.
* net/loveruby/cflat/compiler/IRGenerator.java: convert ast Type -> asm Type.
* net/loveruby/cflat/compiler/CodeGenerator.java: use asm Type.


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4160 1b9489fe-b721-0410-924e-b54b9192deb8
2009-04-26 17:04:29 +00:00
Minero Aoki 8e8ae12043 * net/loveruby/cflat/compiler/CodeGenerator.java: remove simple delegators (to Assembler).
* net/loveruby/cflat/asm/Assembler.java: add _byte(long), etc.
* net/loveruby/cflat/ir/IR.java: do not export typeTable, provide natural type instead.


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4159 1b9489fe-b721-0410-924e-b54b9192deb8
2009-04-26 15:24:36 +00:00
Minero Aoki a5eb1024f9 * net/loveruby/cflat/compiler/IRGenerator.java: use ExprNode#shouldEvalutedToAddress again, it contains complex condition.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4158 1b9489fe-b721-0410-924e-b54b9192deb8
2009-04-26 14:54:52 +00:00
Minero Aoki 82586f9184 * net/loveruby/cflat/ir/Expr.java: show Expr type on dump.
* net/loveruby/cflat/type/FunctionType.java: FunctionType#toString should separate each argument types by ",".


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4157 1b9489fe-b721-0410-924e-b54b9192deb8
2009-04-26 14:39:59 +00:00
Minero Aoki 524db547c6 * net/loveruby/cflat/ir: implement IR#dump.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4156 1b9489fe-b721-0410-924e-b54b9192deb8
2009-04-26 14:35:10 +00:00
Minero Aoki 04f5d8e6cc * net/loveruby/cflat/compiler/IRGenerator.java (BlockNode): static variables are special case.
* net/loveruby/cflat/compiler/IRGenerator.java (SwitchNode): Switch must precedes Case bodies to prevent programs from infinite loop.
* net/loveruby/cflat/compiler/CodeGenerator.java (Bin): fix MOD problem.
* net/loveruby/cflat/compiler/CodeGenerator.java (Bin): fix LSHIFT problem.


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4155 1b9489fe-b721-0410-924e-b54b9192deb8
2009-04-26 13:41:19 +00:00
Minero Aoki 0b3098612a * now IR nodes are separated from AST. Sources are compilable but not tested yet.
* ir/*: new classes.


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4154 1b9489fe-b721-0410-924e-b54b9192deb8
2009-04-26 13:08:40 +00:00
Minero Aoki eaba86066f * ast/ASTVisitor.java: fork DeclarationVisitor.
* ast/DeclarationVisitor.java: new class.
* compiler/Visitor.java: do not visit declarations.
* compiler/TypeResolver.java: visit declarations explicitly.
* compiler/IRGenerator.java: remove useless declarations acceptor.
* compiler/CodeGenerator.java: ditto.
* ast/Entity.java: accept DeclarationVisitor.
* ast/DefinedFunction.java: ditto.
* ast/UndefinedFunction.java: ditto.
* ast/DefinedVariable.java: ditto.
* ast/UndefinedVariable.java: ditto.
* ast/TypeDefinition.java: ditto.
* ast/StructNode.java: ditto.
* ast/UnionNode.java: ditto.
* ast/TypedefNode.java: ditto.


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4153 1b9489fe-b721-0410-924e-b54b9192deb8
2009-04-26 09:09:52 +00:00
Minero Aoki 68a99258e5 * net/loveruby/cflat/compiler/IRGenerator.java (SuffixOp): do not calculate twice. Save expr value and reuse it.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4152 1b9489fe-b721-0410-924e-b54b9192deb8
2009-04-26 08:45:30 +00:00
Minero Aoki f23dd70dd2 * net/loveruby/cflat/compiler/IRGenerator.java: must compile initializer.
* net/loveruby/cflat/compiler/IRGenerator.java: f = &puts generated addr(addr(puts)), so remove redundant AddressNode.
* net/loveruby/cflat/compiler/CodeGenerator.java: now --verbose-asm works.


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4151 1b9489fe-b721-0410-924e-b54b9192deb8
2009-04-26 08:25:30 +00:00
Minero Aoki 41e5e61c16 * net/loveruby/cflat/compiler/IRGenerator.java: treat LHS specially and remove AddressNode at the top of the LHS tree (e.g. printf = 0 generates &printf = 0).
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4150 1b9489fe-b721-0410-924e-b54b9192deb8
2009-04-26 07:51:05 +00:00
Minero Aoki e8f10dc3f6 * net/loveruby/cflat/compiler/Simplifier.java -> IRGenerator.java
* net/loveruby/cflat/compiler/Compiler.java: rename class.


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4149 1b9489fe-b721-0410-924e-b54b9192deb8
2009-04-26 07:19:33 +00:00
Minero Aoki 732ebf51d4 * net/loveruby/cflat/compiler/Simplifier.java (SwitchNode): missing end label.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4148 1b9489fe-b721-0410-924e-b54b9192deb8
2009-04-26 07:10:29 +00:00
Minero Aoki 9e9f65d6ce * net/loveruby/cflat/ast/FuncallNode.java: make a static funcall really static funcall (not use pointer).
net/loveruby/cflat/compiler/Simplifier.java: set aref result type.


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4147 1b9489fe-b721-0410-924e-b54b9192deb8
2009-04-26 06:48:12 +00:00
Minero Aoki 78a2217cd9 * net/loveruby/cflat/ast/FuncallNode.java: detect static call.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4146 1b9489fe-b721-0410-924e-b54b9192deb8
2009-04-26 04:50:57 +00:00
Minero Aoki 1074c0177f * net/loveruby/cflat/compiler/Simplifier.java (While): must loop.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4145 1b9489fe-b721-0410-924e-b54b9192deb8
2009-04-26 04:30:15 +00:00
Minero Aoki 487cf1a714 * net/loveruby/cflat/compiler/Simplifier.java (SuffixOp): too few deref.
* net/loveruby/cflat/compiler/Simplifier.java (MemberNode): should set type.
* net/loveruby/cflat/compiler/Simplifier.java (PtrMemberNode): should set type.
* net/loveruby/cflat/compiler/Simplifier.java (Deref, Addr): should compile child expr.
* net/loveruby/cflat/ast/BinaryOpNode.java (ctor): accept type.
* net/loveruby/cflat/ast/TypeNode.java (location): do not raise exception when no typeRef exist.


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4144 1b9489fe-b721-0410-924e-b54b9192deb8
2009-04-26 04:22:42 +00:00
Minero Aoki 99b5be5455 * net/loveruby/cflat/asm/PeepholeOptimizer.java: fix bad operator mnemonic. (fixes 4E)
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4143 1b9489fe-b721-0410-924e-b54b9192deb8
2009-04-26 03:18:09 +00:00
Minero Aoki 63170db30b * now many tests work (30/1709 failed).
* net/loveruby/cflat/compiler/Simplifier.java: set location of AssignStmtNode.
* net/loveruby/cflat/compiler/Simplifier.java: allocate tmp variable in scope.
* net/loveruby/cflat/compiler/Simplifier.java: opAssign/inc/dec handling was completely wrong (there still be some problems yet).
* net/loveruby/cflat/compiler/CodeGenerator.java (compileLHS): implemented for IR.
* net/loveruby/cflat/compiler/CodeGenerator.java (loadVarible): implemented for IR.


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4142 1b9489fe-b721-0410-924e-b54b9192deb8
2009-04-19 18:52:12 +00:00
Minero Aoki 97fbe0672c * net/loveruby/cflat/ast/IR.java: new class to represents IR.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4141 1b9489fe-b721-0410-924e-b54b9192deb8
2009-04-19 15:39:18 +00:00