mirror of https://github.com/aamine/cbc
* net/loveruby/cflat/compiler/CodeGenerator.java (compileAST): should not generate .data section when no global variable is defined.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4083 1b9489fe-b721-0410-924e-b54b9192deb8
This commit is contained in:
parent
aa030b42b7
commit
89c7decdad
|
@ -1,3 +1,9 @@
|
|||
Sun Nov 16 20:10:59 2008 Minero Aoki <aamine@loveruby.net>
|
||||
|
||||
* net/loveruby/cflat/compiler/CodeGenerator.java (compileAST):
|
||||
should not generate .data section when no global variable is
|
||||
defined.
|
||||
|
||||
Sun Nov 16 20:01:06 2008 Minero Aoki <aamine@loveruby.net>
|
||||
|
||||
* net/loveruby/cflat/compiler/CodeGenerator.java: should access
|
||||
|
|
|
@ -59,9 +59,12 @@ public class CodeGenerator
|
|||
public void compileAST(AST ast) {
|
||||
_file(ast.fileName());
|
||||
// .data
|
||||
_data();
|
||||
for (DefinedVariable gvar : ast.definedGlobalVariables()) {
|
||||
dataEntry(gvar);
|
||||
List<DefinedVariable> gvars = ast.definedGlobalVariables();
|
||||
if (!gvars.isEmpty()) {
|
||||
_data();
|
||||
for (DefinedVariable gvar : gvars) {
|
||||
dataEntry(gvar);
|
||||
}
|
||||
}
|
||||
if (!ast.constantTable().isEmpty()) {
|
||||
_section(".rodata");
|
||||
|
|
Loading…
Reference in New Issue