Commit Graph

224 Commits

Author SHA1 Message Date
Minero Aoki 41d6488cfa * net/loveruby/cflat/compiler/Options.java: --version did not print "\n".
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4305 1b9489fe-b721-0410-924e-b54b9192deb8
2009-07-05 20:22:00 +00:00
Minero Aoki f54cfaab75 fix preproc tags
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4303 1b9489fe-b721-0410-924e-b54b9192deb8
2009-06-27 16:09:22 +00:00
Minero Aoki 274b12a6cd * net/loveruby/cflat/compiler/Options.java: rename option: --readonly-plt -> --readonly-got.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4297 1b9489fe-b721-0410-924e-b54b9192deb8
2009-06-21 08:14:50 +00:00
Minero Aoki 578e495480 r5116@macbookpro: aamine | 2009-06-15 01:05:26 +0900
* net/loveruby/cflat/compiler/Options.java (parseCommaSeparatedOptions): AbstractList does not support #remove.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4293 1b9489fe-b721-0410-924e-b54b9192deb8
2009-06-16 07:43:21 +00:00
Minero Aoki ee8432d4fa r5104@macbookpro: aamine | 2009-06-13 22:43:16 +0900
* rename class: AssemblyFile -> AssemblyCode.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4292 1b9489fe-b721-0410-924e-b54b9192deb8
2009-06-13 13:46:36 +00:00
Minero Aoki 8049035053 r4986@macbookpro: aamine | 2009-05-26 16:07:49 +0900
* net/loveruby/cflat/compiler/Compiler.java: --dump-asm now dumps AssemblyFile.
 * net/loveruby/cflat/compiler/Compiler.java: new option --print-asm, prints assembly source text.
 * net/loveruby/cflat/compiler/CompilerMode.java: new enum PrintAsm.
 * net/loveruby/cflat/compiler/Options.java: new option --print-asm.
 * net/loveruby/cflat/sysdep/x86/AssemblyFile.java: new method #dump.
 * net/loveruby/cflat/sysdep/x86/Register.java: new method #dump.
 * net/loveruby/cflat/asm: new method #dump.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4264 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-26 07:52:44 +00:00
Minero Aoki 1729dbaac0 r4984@macbookpro: aamine | 2009-05-26 15:11:36 +0900
* net/loveruby/cflat/compiler/Compiler.java: change CodeGenerator output: String -> AssemblyFile.
 * net/loveruby/cflat/sysdep/AssemblyFile.java: new interface.
 * net/loveruby/cflat/sysdep/x86/AssemblyFile.java: implement it.
 * net/loveruby/cflat/sysdep/CodeGenerator.java: #generate returns AssemblyFile.
 * net/loveruby/cflat/sysdep/x86/CodeGenerator.java: ditto.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4262 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-26 07:52:42 +00:00
Minero Aoki d50cb63ee5 r4969@macbookpro: aamine | 2009-05-26 12:58:04 +0900
* net/loveruby/cflat/compiler/Compiler.java (writeFile): treat "-" as stdout.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4257 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-26 04:24:44 +00:00
Minero Aoki e593745d2e r4968@macbookpro: aamine | 2009-05-26 12:48:57 +0900
* net/loveruby/cflat/compiler/Compiler.java (dumpAsm): do not print extra '\n'.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4256 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-26 04:24:43 +00:00
Minero Aoki 7ce8034b0f r4967@macbookpro: aamine | 2009-05-26 12:21:40 +0900
* net/loveruby/cflat/compiler/Options.java: check unknown file types.
 * net/loveruby/cflat/compiler/SourceFile.java: new method #isKnownFileType.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4255 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-26 04:24:42 +00:00
Minero Aoki e6b6f20d24 r4966@macbookpro: aamine | 2009-05-26 11:59:25 +0900
* net/loveruby/cflat/compiler/Options.java: allow --verbose-asm too.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4254 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-26 04:24:41 +00:00
Minero Aoki c30f91a58a r4964@macbookpro: aamine | 2009-05-26 11:50:29 +0900
* net/loveruby/cflat/compiler/Options.java: --verbose-asm -> -fverbose-asm
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4253 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-26 02:52:20 +00:00
Minero Aoki b9ad38ef16 r4942@macbookpro: aamine | 2009-05-24 21:56:17 +0900
* net/loveruby/cflat/compiler/IRGenerator.java: do not use Expr#isConstantAddress, it confuses semantics.
 * net/loveruby/cflat/sysdep/x86/CodeGenerator.java: ditto.
 * net/loveruby/cflat/ir/Expr.java: introduce new methods #isVar and #isAddr, instead of #isConstantAddress.
 * net/loveruby/cflat/ir/Addr.java: override #isAddr.
 * net/loveruby/cflat/ir/Var.java: override #isVar.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4247 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-24 12:56:38 +00:00
Minero Aoki de2d14c1fb modify preproc range
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4245 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-24 12:29:15 +00:00
Minero Aoki 2871c6d19d add preproc tags.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4244 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-24 12:18:09 +00:00
Minero Aoki 4d889a2588 r4907@macbookpro: aamine | 2009-05-24 20:23:14 +0900
* net/loveruby/cflat/compiler/IRGenerator.java (Dereference): do not generate Mem for unloadable object (implicit address generation handling).
 * net/loveruby/cflat/ast: dump #type for LHS nodes.
 * net/loveruby/cflat/ast/AddressNode.java: do not inherit UnaryOpNode.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4241 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-24 11:23:29 +00:00
Minero Aoki bfacf5e6c1 r4903@macbookpro: aamine | 2009-05-24 19:22:57 +0900
* net/loveruby/cflat/compiler/TypeResolver.java: now 3 pathes (define, resolve entities, resolve expr) are not required; just use old 2 pathes (define, resolve).  Old TypeResolver fixed a type of AddressNode, it requires 3 path.  But current implementation fixes a type of AddressNode in DereferenceChecker, we do not need 3 path.
 * net/loveruby/cflat/ast/AST.java: #entities -> #definitions.
 * net/loveruby/cflat/ast/AST.java: new method #entities, it returns #definitions + #declarations.
 * net/loveruby/cflat/compiler/TypeResolver.java: follow it.
 * net/loveruby/cflat/compiler/LocalResolver.java: follow it.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4239 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-24 10:23:12 +00:00
Minero Aoki bdfc0de55c add preproc tags.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4238 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-24 06:36:14 +00:00
Minero Aoki e27f329f98 r4898@macbookpro: aamine | 2009-05-24 11:57:29 +0900
* net/loveruby/cflat/compiler/IRGenerator.java (If): refactoring: increase readability.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4237 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-24 02:57:48 +00:00
Minero Aoki ad7af66f8b r4896@macbookpro: aamine | 2009-05-24 02:08:03 +0900
* utilize final field.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4236 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-23 17:08:24 +00:00
Minero Aoki c7254ff547 r4893@macbookpro: aamine | 2009-05-24 01:17:52 +0900
* net/loveruby/cflat/compiler/IRGenerator.java: reorder methods.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4235 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-23 16:18:04 +00:00
Minero Aoki 0f12ee78f1 r4892@macbookpro: aamine | 2009-05-24 00:41:44 +0900
* net/loveruby/cflat/ir: rename class: BranchIf -> CJump.
 * net/loveruby/cflat/ir/IRVisitor.java: follow it.
 * net/loveruby/cflat/compiler/IRGenerator.java: ditto.
 * net/loveruby/cflat/sysdep/x86/CodeGenerator.java: ditto.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4234 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-23 16:18:03 +00:00
Minero Aoki 1e3eae4634 r4890@macbookpro: aamine | 2009-05-24 00:00:20 +0900
* net/loveruby/cflat/compiler/IRGenerator.java: refactoring: reorder stmts.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4233 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-23 15:00:29 +00:00
Minero Aoki a54e95aa16 r4887@macbookpro: aamine | 2009-05-23 23:30:32 +0900
* net/loveruby/cflat/compiler/IRGenerator.java: refactoring: use reverse(node.args) instead of ListIterator.
 * net/loveruby/cflat/sysdep/x86/CodeGenerator.java: ditto.
 * net/loveruby/cflat/utils/ListUtils.java: new utility class.
 * net/loveruby/cflat/ast/FuncallNode.java: remove #finalArgs.
 * net/loveruby/cflat/ir/Call.java: ditto.
 * net/loveruby/cflat/ast/FuncallNode.java: refactoring: rename method: arguments -> args.
 * net/loveruby/cflat/compiler/Visitor.java: follow it.
 * net/loveruby/cflat/compiler/TypeChecker.java: ditto.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4232 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-23 14:31:37 +00:00
Minero Aoki 717bd630c9 * net/loveruby/cflat/compiler/IRGenerator.java: refactoring: rename method: deref -> mem
* net/loveruby/cflat/type/ArrayType.java: remove useless definition of #isScalar.


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4229 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-23 13:22:14 +00:00
Minero Aoki 2bca02006e * net/loveruby/cflat/compiler/IRGenerator.java: refactoring: extract method: #bin.
* net/loveruby/cflat/compiler/IRGenerator.java: refactoring: extract method: #isPointerDiff.
* net/loveruby/cflat/compiler/IRGenerator.java: refactoring: extract method: #isPointerArithmetic.
* net/loveruby/cflat/type/TypeTable.java: new method #longSize.
* net/loveruby/cflat/ast/ExprNode.java: remove unused method #baseSize.


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4228 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-23 12:34:09 +00:00
Minero Aoki db59955467 Add preproc tags. Attach location to all Assign.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4227 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-21 23:20:09 +00:00
Minero Aoki 7af5ebc4a9 r4875@macbookpro: aamine | 2009-05-18 05:10:22 +0900
* net/loveruby/cflat/compiler/TypeChecker.java: allow ptr-ptr.
 * net/loveruby/cflat/compiler/IRGenerator.java: implement ptr-ptr.
 * net/loveruby/cflat/type/VoidType.java: VoidType#size is 1.
 * net/loveruby/cflat/ast/ExprNode.java: new helper method #baseType.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4225 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-17 20:10:28 +00:00
Minero Aoki e8f60b1e9f add preproc tag
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4224 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-17 19:30:00 +00:00
Minero Aoki 7d580ddf77 r4866@macbookpro: aamine | 2009-05-18 03:31:01 +0900
* net/loveruby/cflat/compiler/TypeResolver.java: move x[] -> x* code to DereferenceChecker.
 * net/loveruby/cflat/compiler/DereferenceChecker.java: ditto.
 * net/loveruby/cflat/compiler/Compiler.java: pass TypeTable to DereferenceChecker.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4221 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-17 18:35:04 +00:00
Minero Aoki 3b29c039bd r4865@macbookpro: aamine | 2009-05-18 03:02:28 +0900
* net/loveruby/cflat/parser/Parser.jj: change function pointer syntax: int(*)(int,int) -> int(int,int)*.  Function type is int(int,int).
 * net/loveruby/cflat/parser/Parser.jj: function returns function type, not pointer to function.
 * net/loveruby/cflat/compiler/TypeResolver.java: resolve all function headers first, then resolve bodies.
 * net/loveruby/cflat/compiler/TypeResolver.java: generate a pointer for array-type expression.
 * net/loveruby/cflat/compiler/TypeResolver.java: isDereferable -> isPointer.
 * net/loveruby/cflat/compiler/TypeChecker.java: ditto.
 * net/loveruby/cflat/compiler/DereferenceChecker.java: ditto.
 * net/loveruby/cflat/compiler/IRGenerator.java: ditto.
 * net/loveruby/cflat/compiler/IRGenerator.java: shouldEvaluatedToAddress -> isLoadable (check arrays and functions, not only arrays).
 * net/loveruby/cflat/type/Type.java: remove #isDereferable.
 * net/loveruby/cflat/type/UserType.java: ditto.
 * net/loveruby/cflat/type/ArrayType.java: is not a scalar.
 * net/loveruby/cflat/type/ArrayType.java: is not dereferable itself.
 * net/loveruby/cflat/type/PointerType.java: is incompatible with arrays.
 * net/loveruby/cflat/type/IntegerType.java: ditto.
 * net/loveruby/cflat/type/FunctionType.java: is callable.
 * net/loveruby/cflat/type/ParamTypeRefs.java: x[] -> x* for param types.
 * net/loveruby/cflat/type/TypeTable.java: new method #getParamType.
 * net/loveruby/cflat/ast/ExprNode.java: new method #isLvalue.
 * net/loveruby/cflat/ast/ExprNode.java: new method #isAssignable.
 * net/loveruby/cflat/ast/ExprNode.java: new method #isLoadable.
 * net/loveruby/cflat/ast/CastNode.java: delegate them.
 * net/loveruby/cflat/ast/LHSNode.java: new super class of LHS nodes.
 * net/loveruby/cflat/ast/VariableNode.java: ditto.
 * net/loveruby/cflat/ast/DereferenceNode.java: ditto.
 * net/loveruby/cflat/ast/ArefNode.java: ditto.
 * net/loveruby/cflat/ast/MemberNode.java: ditto.
 * net/loveruby/cflat/ast/PtrMemberNode.java: ditto.
 * net/loveruby/cflat/entity/Entity.java: remove #cannotLoad.
 * net/loveruby/cflat/entity/Function.java: ditto.
 * net/loveruby/cflat/entity/Variable.java: ditto.
 * net/loveruby/cflat/entity/Constant.java: ditto.
 * net/loveruby/cflat/ir/Addr.java: is not LHS node now.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4220 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-17 18:35:02 +00:00
Minero Aoki d3194fb8bd r4853@macbookpro: aamine | 2009-05-17 16:34:27 +0900
* net/loveruby/cflat/parser/Parser.jj: support constant definition.
 * net/loveruby/cflat/ast/Declarations.java: hold constants.
 * net/loveruby/cflat/ast/AST.java: ditto.
 * net/loveruby/cflat/compiler/LocalResolver.java: resolve constants.
 * net/loveruby/cflat/compiler/TypeResolver.java: resolve constants.
 * net/loveruby/cflat/compiler/IRGenerator.java: transform constants reference into literal value.
 * net/loveruby/cflat/compiler/DereferenceChecker.java: check if toplevel variable initializer consists of a literal.
 * net/loveruby/cflat/compiler/DereferenceChecker.java: check if constant value consists of a literal.
 * net/loveruby/cflat/ast/ExprNode.java: new method #isConstant.
 * net/loveruby/cflat/ast/LiteralNode.java: override.
 * net/loveruby/cflat/entity/Entity.java: support Constant.
 * net/loveruby/cflat/entity/Constant.java: new entity.
 * net/loveruby/cflat/entity/EntityVisitor.java: add Constant.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4217 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-17 07:39:00 +00:00
Minero Aoki 9ebdc8c35a r4852@macbookpro: aamine | 2009-05-17 16:19:18 +0900
* net/loveruby/cflat/compiler/Options.java: cbc --dump-* did not work.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4216 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-17 07:38:57 +00:00
Minero Aoki 189c089088 r4839@macbookpro: aamine | 2009-05-13 03:24:14 +0900
* compiler/Compiler.java: grand refactoring.
 * compiler/Options.java: refactoring: avoid ping-pong call with SourceFile.
 * compiler/SourceFile.java: ditto.
 * ast/AST.java: does not contain a TypeTable.
 * compiler/IRGenerator.java
 * compiler/TypeResolver.java
 * compiler/TypeChecker.java
 * sysdep/Linker.java: change arg order.
 * sysdep/GNULinker.java: ditto.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4210 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-12 18:24:47 +00:00
Minero Aoki 9c8af78a97 r4838@macbookpro: aamine | 2009-05-13 01:23:44 +0900
* net/loveruby/cflat/utils/CommandUtils.java: accept a list of string instead of CommandArg.
 * net/loveruby/cflat/sysdep/Linker.java: ditto.
 * net/loveruby/cflat/sysdep/LinkerOptions.java: ditto.
 * net/loveruby/cflat/sysdep/GNULinker.java: ditto.
 * net/loveruby/cflat/sysdep/AssemblerOptions.java: ditto.
 * net/loveruby/cflat/sysdep/GNUAssembler.java: ditto.
 * net/loveruby/cflat/utils/CommandArgStr.java -> compiler/LdOption.java
 * net/loveruby/cflat/utils/CommandArg.java -> compiler/LdArg.java
 * net/loveruby/cflat/compiler/SourceFile.java: CommandArg -> LdArg.
 * 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@4209 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-12 18:24:46 +00:00
Minero Aoki c26eb88f2e r4834@macbookpro: aamine | 2009-05-11 03:17:05 +0900
* net/loveruby/cflat/compiler/Compiler.java: objectify assembler.
 * net/loveruby/cflat/compiler/Compiler.java: objectify linker.
 * net/loveruby/cflat/compiler/Options.java: provide #assembler, #asOptions, #linker, #ldOptions.
 * net/loveruby/cflat/sysdep/x86/X86Linux.java -> sysdep/X86Linux.java
 * net/loveruby/cflat/sysdep/Platform.java: provide #assembler, #linker.
 * net/loveruby/cflat/sysdep/X86Linux.java: ditto.
 * net/loveruby/cflat/sysdep/Assembler.java: new interface.
 * net/loveruby/cflat/sysdep/AssemblerOptions.java: new class.
 * net/loveruby/cflat/sysdep/GNUAssembler.java: new Assembler implementation.
 * net/loveruby/cflat/sysdep/Linker.java: new interface.
 * net/loveruby/cflat/sysdep/LinkerOptions.java: new clas.
 * net/loveruby/cflat/sysdep/GNULinker.java: new Linker implementation.
 * net/loveruby/cflat/utils/CommandUtils.java: new class.
 * net/loveruby/cflat/compiler/LdArg.java -> utils/CommandArg.java
 * net/loveruby/cflat/compiler/LdOption.java -> utils/CommandArgStr.java
 * net/loveruby/cflat/compiler/SourceFile.java: implements CommandArg.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4207 1b9489fe-b721-0410-924e-b54b9192deb8
2009-05-10 18:18:52 +00:00
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 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 23f610e6b5 r4812@macbookpro: aamine | 2009-05-10 22:42:08 +0900
forgot to commit


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4198 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 e57e42b188 r4755@macbookpro: aamine | 2009-05-07 10:32:44 +0900
add preproc tags.


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4188 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