|
Class: STCCompilerInterface
Object
|
+--STCCompilerInterface
- Package:
- stx:libcomp
- Category:
- System-Compiler
- Version:
- rev:
1.68
date: 2019/08/16 16:40:48
- user: cg
- file: STCCompilerInterface.st directory: libcomp
- module: stx stc-classLibrary: libcomp
a refactored complex method - originally found in ByteCodeCompiler.
accessing
-
getCCDefine
-
return a string which was used to identify the C-Compiler used
when STX was compiled, and which should be passed down when compiling methods.
For example, when compiled with GNUC, this is '__GNUC__';
on windows, this is either '__VISUAL__', '__BORLANDC__' or '__MINGW64__'
usage example(s):
STCCompilerInterface getCCDefine
|
-
getCPUDefine
-
return a string which was used to identify this CPU type when STX was
compiled, and which should be passed down when compiling methods.
For example, on a 386 (and successors), this may be '-D__x86__';
on a vax, this would be '-D__vax__'.
This is normally not of interest to 'normal' users; however, it is passed
down to the c-compiler when methods are incrementally compiled to machine code.
Do not use this for CPU determination; only to pass on to stc for compilation.
(see OperatingSystem getCPUType for this)
usage example(s):
STCCompilerInterface getCPUDefine
|
-
getOSDefine
-
return a string which was used to identify this machine when stx was
compiled, and which should be passed down when compiling methods.
For example, on linux, this is '-D__linux__'; on osx, it is '-D__osx__'.
Do not use this for OS determination; only to pass on to stc for compilation.
(see OperatingSystem getOSType for this)
usage example(s):
STCCompilerInterface getOSDefine
|
-
stcPathOf: command
-
return the path to an stc command, or nil if not found.
usage example(s):
STCCompilerInterface stcPathOf:'stc'
|
-
verbose
-
if on, trace command execution on the Transcript
-
verbose: aBoolean
-
if on, trace command execution on the Transcript
class initialization
-
initialize
-
(comment from inherited method)
called only once - initialize signals
accessing
-
cFileName: something
-
-
incrementalStcPath
-
return the path to the stc command for incremental method compilation,
or nil if not found.
-
originator: something
-
-
parserFlags: something
-
-
stFileName: something
-
error raising
-
parseError: messageText position: position
-
not normally reached
machine code generation
-
compileToMachineCode: aString forClass: aClass selector: selector inCategory: categoryArg notifying: requestorArg install: install skipIfSame: skipIfSame silent: silent
-
this is called to compile primitive code.
It saves the code to a tmporary, calls stc to create C-code, compiles it, links
it to a tiny little dll and loads it.
As you already see, this takes some time and is therefore ONLY done for code containing prims;
all pure smalltalk code is compiled to bytecode and jitted by the VM.
-
compileToMachineCode: aString forClass: aClass selector: selector inCategory: categoryArg notifying: requestorArg install: install skipIfSame: skipIfSame silent: silent generateCOnly: generateCOnly
-
this is called to compile primitive code.
It saves the code to a tmporary, calls stc to create C-code, compiles it, links
it to a tiny little dll and loads it.
As you already see, this takes some time and is therefore ONLY done for code containing prims;
all pure smalltalk code is compiled to bytecode and jitted by the VM.
machine code generation-helpers
-
compileToC_onError: aBlock
-
compile st to C using stc.
If any error happens, call aBlock passing it the fileName containing diagnostics
-
compileToExe_onError: aBlock
-
compile C to exe, using cc.
If any error happens, call aBlock passing it the fileName containing diagnostics
-
compileToObj_onError: aBlock
-
compile C to obj, using cc.
If any error happens, call aBlock passing it the fileName containing diagnostics
-
compileToS_onError: aBlock
-
compile C to assembler, using cc.
If any error happens, call aBlock passing it the fileName containing diagnostics
-
ensureExternalToolsArePresent
-
make it absolute, so that we are immune to directory changes
-
ensureModuleDirectoryExists
-
create a small README there ...
-
ensureSuperClassesAreLoadedOf: aClass
-
-
fileOutAllDefinitionsOf: aClass to: aStream rememberIn: definedClasses
-
-
generateSTSource: aString
-
generate a unique name, consisting of my processID and a sequence number
-
reportCompilationErrorFor: aCommand
-
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
reportCompilationErrorFor: aCommand fromFile: anErrorFilename
-
replace the filename string
-
setupCompilationCommandArguments
-
ParserFlags useBorlandC ifTrue:[
|