small fixes for windows

This commit is contained in:
Andreas Rumpf 2008-12-12 14:35:17 +01:00
commit 1c8ddca7e0
4 changed files with 276 additions and 272 deletions

View file

@ -750,7 +750,7 @@ proc collectCycles(gch: var TGcHeap) =
CellSetDeinit(gch.cycleRoots)
gch.cycleRoots = newRoots
proc gcMark(p: pointer) {.fastcall.} =
proc gcMark(p: pointer) = # {.fastcall.} =
# the addresses are not as objects on the stack, so turn them to objects:
var cell = usrToCell(p)
var c = cast[TAddress](cell)

View file

@ -31,6 +31,24 @@
# cog.out(toEnum(key, val))
#]]]
type
TNimrodTypeKind* = enum
ntyNone, ntyBool, ntyChar, ntyEmpty,
ntyArrayConstr, ntyNil, ntyGeneric, ntyGenericInst,
ntyGenericParam, ntyEnum, ntyAnyEnum, ntyArray,
ntyObject, ntyTuple, ntySet, ntyRange,
ntyPtr, ntyRef, ntyVar, ntySequence,
ntyProc, ntyPointer, ntyOpenArray, ntyString,
ntyCString, ntyForward, ntyInt, ntyInt8,
ntyInt16, ntyInt32, ntyInt64, ntyFloat,
ntyFloat32, ntyFloat64, ntyFloat128
TNimTypeKinds* = set[TNimrodTypeKind]
TNimrodSymKind* = enum
nskUnknownSym, nskConditional, nskDynLib, nskParam,
nskTypeParam, nskTemp, nskType, nskConst,
nskVar, nskProc, nskIterator, nskConverter,
nskMacro, nskTemplate, nskField, nskEnumField,
nskForVar, nskModule, nskLabel, nskStub
TNimSymKinds* = set[TNimrodSymKind]
TNimrodNodeKind* = enum
nnkNone, nnkEmpty, nnkIdent, nnkSym,
nnkType, nnkCharLit, nnkIntLit, nnkInt8Lit,
@ -65,24 +83,6 @@ type
nnkVarTy, nnkProcTy, nnkEnumTy, nnkEnumFieldDef,
nnkReturnToken
TNimNodeKinds* = set[TNimrodNodeKind]
TNimrodTypeKind* = enum
ntyNone, ntyBool, ntyChar, ntyEmpty,
ntyArrayConstr, ntyNil, ntyGeneric, ntyGenericInst,
ntyGenericParam, ntyEnum, ntyAnyEnum, ntyArray,
ntyObject, ntyTuple, ntySet, ntyRange,
ntyPtr, ntyRef, ntyVar, ntySequence,
ntyProc, ntyPointer, ntyOpenArray, ntyString,
ntyCString, ntyForward, ntyInt, ntyInt8,
ntyInt16, ntyInt32, ntyInt64, ntyFloat,
ntyFloat32, ntyFloat64, ntyFloat128
TNimTypeKinds* = set[TNimrodTypeKind]
TNimrodSymKind* = enum
nskUnknownSym, nskConditional, nskDynLib, nskParam,
nskTypeParam, nskTemp, nskType, nskConst,
nskVar, nskProc, nskIterator, nskConverter,
nskMacro, nskTemplate, nskField, nskEnumField,
nskForVar, nskModule, nskLabel, nskStub
TNimSymKinds* = set[TNimrodSymKind]
#[[[end]]]
type

View file

@ -65,6 +65,79 @@ for key, val in enums.items():
cog.out(a)
cog.out(b)
]]]*)
type
TTypeFlag = (
tfVarargs, tfFinal, tfAcyclic, tfEnumHasWholes);
TTypeFlags = set of TTypeFlag;
const
TypeFlagToStr: array [TTypeFlag] of string = (
'tfVarargs', 'tfFinal', 'tfAcyclic', 'tfEnumHasWholes');
type
TTypeKind = (
tyNone, tyBool, tyChar, tyEmpty,
tyArrayConstr, tyNil, tyGeneric, tyGenericInst,
tyGenericParam, tyEnum, tyAnyEnum, tyArray,
tyObject, tyTuple, tySet, tyRange,
tyPtr, tyRef, tyVar, tySequence,
tyProc, tyPointer, tyOpenArray, tyString,
tyCString, tyForward, tyInt, tyInt8,
tyInt16, tyInt32, tyInt64, tyFloat,
tyFloat32, tyFloat64, tyFloat128);
TTypeKinds = set of TTypeKind;
const
TypeKindToStr: array [TTypeKind] of string = (
'tyNone', 'tyBool', 'tyChar', 'tyEmpty',
'tyArrayConstr', 'tyNil', 'tyGeneric', 'tyGenericInst',
'tyGenericParam', 'tyEnum', 'tyAnyEnum', 'tyArray',
'tyObject', 'tyTuple', 'tySet', 'tyRange',
'tyPtr', 'tyRef', 'tyVar', 'tySequence',
'tyProc', 'tyPointer', 'tyOpenArray', 'tyString',
'tyCString', 'tyForward', 'tyInt', 'tyInt8',
'tyInt16', 'tyInt32', 'tyInt64', 'tyFloat',
'tyFloat32', 'tyFloat64', 'tyFloat128');
type
TSymFlag = (
sfUsed, sfStar, sfMinus, sfInInterface,
sfFromGeneric, sfGlobal, sfForward, sfImportc,
sfExportc, sfVolatile, sfRegister, sfPure,
sfResult, sfNoSideEffect, sfMainModule, sfSystemModule,
sfNoReturn, sfAddrTaken, sfCompilerProc, sfCppMethod,
sfDiscriminant, sfDeprecated, sfInClosure, sfTypeCheck,
sfCompileTime, sfThreadVar, sfMerge);
TSymFlags = set of TSymFlag;
const
SymFlagToStr: array [TSymFlag] of string = (
'sfUsed', 'sfStar', 'sfMinus', 'sfInInterface',
'sfFromGeneric', 'sfGlobal', 'sfForward', 'sfImportc',
'sfExportc', 'sfVolatile', 'sfRegister', 'sfPure',
'sfResult', 'sfNoSideEffect', 'sfMainModule', 'sfSystemModule',
'sfNoReturn', 'sfAddrTaken', 'sfCompilerProc', 'sfCppMethod',
'sfDiscriminant', 'sfDeprecated', 'sfInClosure', 'sfTypeCheck',
'sfCompileTime', 'sfThreadVar', 'sfMerge');
type
TNodeFlag = (
nfNone, nfBase2, nfBase8, nfBase16,
nfAllConst, nfTransf, nfSem);
TNodeFlags = set of TNodeFlag;
const
NodeFlagToStr: array [TNodeFlag] of string = (
'nfNone', 'nfBase2', 'nfBase8', 'nfBase16',
'nfAllConst', 'nfTransf', 'nfSem');
type
TSymKind = (
skUnknownSym, skConditional, skDynLib, skParam,
skTypeParam, skTemp, skType, skConst,
skVar, skProc, skIterator, skConverter,
skMacro, skTemplate, skField, skEnumField,
skForVar, skModule, skLabel, skStub);
TSymKinds = set of TSymKind;
const
SymKindToStr: array [TSymKind] of string = (
'skUnknownSym', 'skConditional', 'skDynLib', 'skParam',
'skTypeParam', 'skTemp', 'skType', 'skConst',
'skVar', 'skProc', 'skIterator', 'skConverter',
'skMacro', 'skTemplate', 'skField', 'skEnumField',
'skForVar', 'skModule', 'skLabel', 'skStub');
type
TNodeKind = (
nkNone, nkEmpty, nkIdent, nkSym,
@ -134,79 +207,6 @@ const
'nkRecCase', 'nkRecWhen', 'nkRefTy', 'nkPtrTy',
'nkVarTy', 'nkProcTy', 'nkEnumTy', 'nkEnumFieldDef',
'nkReturnToken');
type
TSymFlag = (
sfUsed, sfStar, sfMinus, sfInInterface,
sfFromGeneric, sfGlobal, sfForward, sfImportc,
sfExportc, sfVolatile, sfRegister, sfPure,
sfResult, sfNoSideEffect, sfMainModule, sfSystemModule,
sfNoReturn, sfAddrTaken, sfCompilerProc, sfCppMethod,
sfDiscriminant, sfDeprecated, sfInClosure, sfTypeCheck,
sfCompileTime, sfThreadVar, sfMerge);
TSymFlags = set of TSymFlag;
const
SymFlagToStr: array [TSymFlag] of string = (
'sfUsed', 'sfStar', 'sfMinus', 'sfInInterface',
'sfFromGeneric', 'sfGlobal', 'sfForward', 'sfImportc',
'sfExportc', 'sfVolatile', 'sfRegister', 'sfPure',
'sfResult', 'sfNoSideEffect', 'sfMainModule', 'sfSystemModule',
'sfNoReturn', 'sfAddrTaken', 'sfCompilerProc', 'sfCppMethod',
'sfDiscriminant', 'sfDeprecated', 'sfInClosure', 'sfTypeCheck',
'sfCompileTime', 'sfThreadVar', 'sfMerge');
type
TTypeKind = (
tyNone, tyBool, tyChar, tyEmpty,
tyArrayConstr, tyNil, tyGeneric, tyGenericInst,
tyGenericParam, tyEnum, tyAnyEnum, tyArray,
tyObject, tyTuple, tySet, tyRange,
tyPtr, tyRef, tyVar, tySequence,
tyProc, tyPointer, tyOpenArray, tyString,
tyCString, tyForward, tyInt, tyInt8,
tyInt16, tyInt32, tyInt64, tyFloat,
tyFloat32, tyFloat64, tyFloat128);
TTypeKinds = set of TTypeKind;
const
TypeKindToStr: array [TTypeKind] of string = (
'tyNone', 'tyBool', 'tyChar', 'tyEmpty',
'tyArrayConstr', 'tyNil', 'tyGeneric', 'tyGenericInst',
'tyGenericParam', 'tyEnum', 'tyAnyEnum', 'tyArray',
'tyObject', 'tyTuple', 'tySet', 'tyRange',
'tyPtr', 'tyRef', 'tyVar', 'tySequence',
'tyProc', 'tyPointer', 'tyOpenArray', 'tyString',
'tyCString', 'tyForward', 'tyInt', 'tyInt8',
'tyInt16', 'tyInt32', 'tyInt64', 'tyFloat',
'tyFloat32', 'tyFloat64', 'tyFloat128');
type
TNodeFlag = (
nfNone, nfBase2, nfBase8, nfBase16,
nfAllConst, nfTransf, nfSem);
TNodeFlags = set of TNodeFlag;
const
NodeFlagToStr: array [TNodeFlag] of string = (
'nfNone', 'nfBase2', 'nfBase8', 'nfBase16',
'nfAllConst', 'nfTransf', 'nfSem');
type
TTypeFlag = (
tfVarargs, tfFinal, tfAcyclic, tfEnumHasWholes);
TTypeFlags = set of TTypeFlag;
const
TypeFlagToStr: array [TTypeFlag] of string = (
'tfVarargs', 'tfFinal', 'tfAcyclic', 'tfEnumHasWholes');
type
TSymKind = (
skUnknownSym, skConditional, skDynLib, skParam,
skTypeParam, skTemp, skType, skConst,
skVar, skProc, skIterator, skConverter,
skMacro, skTemplate, skField, skEnumField,
skForVar, skModule, skLabel, skStub);
TSymKinds = set of TSymKind;
const
SymKindToStr: array [TSymKind] of string = (
'skUnknownSym', 'skConditional', 'skDynLib', 'skParam',
'skTypeParam', 'skTemp', 'skType', 'skConst',
'skVar', 'skProc', 'skIterator', 'skConverter',
'skMacro', 'skTemplate', 'skField', 'skEnumField',
'skForVar', 'skModule', 'skLabel', 'skStub');
{[[[end]]]}
type

View file

@ -5,7 +5,11 @@
@if llvm_gcc or gcc:
# GCC, LLVM and Visual C++ have a problem to optimize some modules.
# This is really strange.
@if windows:
cgen.speed = "-O0"
@else:
cgen.speed = "-O1 -fno-strict-aliasing"
@end
@elif vcc:
cgen.speed = ""
@end