mirror of
https://gitlab.com/camelot/kickc.git
synced 2024-06-03 07:29:37 +00:00
- Fixing setting exported and imported globals as volatile method...
Now using the directives approach at pass0 instead of in VariableBuilder.
This commit is contained in:
parent
fab740f797
commit
f2b5d160a8
|
@ -107,7 +107,6 @@ public class Variable implements Symbol {
|
|||
if(asmLibraryName != null) {
|
||||
this.asmExportLibrary = new AsmIdentifier(asmLibraryName);
|
||||
setExport(true);
|
||||
setOptimize(false);
|
||||
setDeclarationOnly(false);
|
||||
}
|
||||
}
|
||||
|
@ -117,7 +116,6 @@ public class Variable implements Symbol {
|
|||
this.asmImportLibrary = new AsmIdentifier(asmLibraryName);
|
||||
setExport(false);
|
||||
setDeclarationOnly(false);
|
||||
setOptimize(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1144,6 +1144,14 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
|
|||
} else if(directive instanceof Directive.Const) {
|
||||
// Type-qualifier directive const
|
||||
this.declType = this.declType.getQualified(this.declType.isVolatile(), true);
|
||||
} else if(directive instanceof Directive.AsmExportDirective) {
|
||||
// Type-qualifier directive volatile
|
||||
this.declDirectives.add(directive);
|
||||
this.declType = this.declType.getQualified(true, this.declType.isNomodify());
|
||||
} else if(directive instanceof Directive.AsmImportDirective) {
|
||||
// Type-qualifier directive volatile
|
||||
this.declDirectives.add(directive);
|
||||
this.declType = this.declType.getQualified(true, this.declType.isNomodify());
|
||||
} else {
|
||||
// variable directive
|
||||
if(!this.declDirectives.contains(directive))
|
||||
|
@ -1512,6 +1520,7 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
|
|||
// if(asmExport == null) {
|
||||
// throw new CompileError("__asm_export directive used before #pragma asm_library declaration.", new StatementSource(ctx));
|
||||
// }
|
||||
|
||||
return new Directive.AsmExportDirective(asmExport);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user