* 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
* 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
* lib/Makefile: should generate PIC for libcbc.o.
* net/loveruby/cflat/compiler/Compiler.java: pass CodeGeneratorOptions to CodeGenerator.
* net/loveruby/cflat/compiler/Options.java: new options -fpic, -fPIC.
* net/loveruby/cflat/compiler/CodeGenerator.java: use position independent address for global variables, common symbols, defined/undefined functions and string constants.
* net/loveruby/cflat/compiler/CodeGeneratorOptions.java: new class.
* net/loveruby/cflat/asm/ELFConstants.java: new interface to define ELF-related constants.
* net/loveruby/cflat/asm/Assembler.java: new method #hidden.
* net/loveruby/cflat/asm/Assembler.java: new overload #section(s,s,s,s,s).
* net/loveruby/cflat/asm/IndirectMemoryReference.java: offset may not long, but Literal.
* net/loveruby/cflat/asm/Literal.java: new method #isZero.
* net/loveruby/cflat/asm/IntegerLiteral.java: ditto.
* net/loveruby/cflat/asm/LabelRef.java: ditto.
* net/loveruby/cflat/ast/ExprNode.java: new method #shouldEvaluatedToAddres.
* net/loveruby/cflat/ast/VariableNode.java: override it.
* net/loveruby/cflat/ast/CastNode.java: override it.
* net/loveruby/cflat/ast/Entity.java: new method #cannotLoad, to implement #shouldEvaluatedToAddress.
* net/loveruby/cflat/ast/Variable.java: override it.
* net/loveruby/cflat/ast/Function.java: override it.
* net/loveruby/cflat/ast/ExprNode.java: rename method: #AsmLiteral -> #AsmValue because it now returns ImmediateValue instead of Literal.
* net/loveruby/cflat/ast/CastNode.java: override it.
* net/loveruby/cflat/ast/LiteralNode.java: rename method also.
* net/loveruby/cflat/ast/IntegerLiteralNode.java: ditto.
* net/loveruby/cflat/ast/StringLiteralNode.java: ditto.
* net/loveruby/cflat/ast/Variable.java: holds memref and address here, not in subclasses.
* net/loveruby/cflat/ast/DefinedVariable.java: ditto.
* net/loveruby/cflat/ast/UndefinedVariable.java: ditto.
* net/loveruby/cflat/ast/LiteralNode.java: new method #memref.
* net/loveruby/cflat/ast/IntegerLiteralNode.java: implement it.
* net/loveruby/cflat/ast/StringLiteralNode.java: implement it.
* net/loveruby/cflat/ast/ConstantEntry.java: holds memref and address.
* net/loveruby/cflat/ast/AST.java: new method #allFunctions, to access undefined functions from code generator.
* net/loveruby/cflat/ast/ToplevelScope.java: ditto.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4057 1b9489fe-b721-0410-924e-b54b9192deb8
* net/loveruby/cflat/ast/*Node.java: ditto.
* net/loveruby/cflat/ast/Location.java: new class.
* net/loveruby/cflat/ast/Dumper.java (printClass): show location.
* net/loveruby/cflat/type/*Ref.java: support Location.
* net/loveruby/cflat/parser/Parser.jj: pass location to nodes.
* net/loveruby/cflat/parser/Parser.jj: long long removed.
* net/loveruby/cflat/type/SignedLongLongRef.java: ditto.
* net/loveruby/cflat/type/UnsignedLongLongRef.java: ditto.
* net/loveruby/cflat/type/SignedLongLongType.java: ditto.
* net/loveruby/cflat/type/UnsignedLongLongType.java: ditto.
* net/loveruby/cflat/type/TypeTable.java: ditto.
* net/loveruby/cflat/ast/LiteralNode.java: introduce new superclass of all literal nodes.
* net/loveruby/cflat/ast/StmtNode.java: introduce new superclass of all statement nodes.
* net/loveruby/cflat/ast/Declaration.java: is subclass of Node.
* net/loveruby/cflat/ast/Dumpable.java: removed: Now declarations are subclass of Node.
* net/loveruby/cflat/ast/Dumper.java: follow new class hierarchy.
* net/loveruby/cflat/ast/DefinitionVisitor.java: removed: merge into ASTVisitor again.
* net/loveruby/cflat/compiler/Visitor.java: follow new class hierarchy.
* net/loveruby/cflat/compiler/CodeGenerator.java: ditto.
* net/loveruby/cflat/compiler/TypeResolver.java: ditto.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@3800 1b9489fe-b721-0410-924e-b54b9192deb8
* net/loveruby/cflat/ast/Node.java: new generic method #isAssignable.
* net/loveruby/cflat/ast/VariableNode.java: is assignable.
* net/loveruby/cflat/ast/DereferenceNode.java: is assignable.
* net/loveruby/cflat/ast/ArefNode.java: is assignable.
* net/loveruby/cflat/ast/MemberNode.java: is assignable.
* net/loveruby/cflat/ast/PtrMemberNode.java: is assignable.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@3772 1b9489fe-b721-0410-924e-b54b9192deb8