diff --git a/App/lib/core/Gen/Call/CallGenFd.vp b/App/lib/core/Gen/Call/CallGenFd.vp index 2e273bd..ee84fb1 100644 --- a/App/lib/core/Gen/Call/CallGenFd.vp +++ b/App/lib/core/Gen/Call/CallGenFd.vp @@ -5,17 +5,10 @@ import ast import llvmlite import memhub import string -import stdio -import stdlib -import sys import viperlib -import w32.fileio as fileio -import lib.core.VLogger as VLogger import lib.core.Gen.Translator as HT -import lib.Stub.StubMerger as StubMerger -import lib.core.CompilerFactory as CompilerFactory -import lib.core.Gen.Call.CallGenBase as CallGenBase +from . import CallGenBase # ============================================================ diff --git a/App/lib/core/Gen/Call/CallGenLeafKit.vp b/App/lib/core/Gen/Call/CallGenLeafKit.vp index b4eb98d..8047518 100644 --- a/App/lib/core/Gen/Call/CallGenLeafKit.vp +++ b/App/lib/core/Gen/Call/CallGenLeafKit.vp @@ -5,18 +5,14 @@ import ast import llvmlite import memhub import string -import stdio import stdlib -import sys import viperlib -import w32.fileio as fileio import lib.core.VLogger as VLogger import lib.core.Gen.GenApi as GenApi import lib.core.Gen.Translator as HT -import lib.Stub.StubMerger as StubMerger import lib.core.CompilerFactory as CompilerFactory -import lib.core.Gen.Call.CallGenCBuiltin as CallGenCBuiltin +from . import CallGenCBuiltin # ============================================================ diff --git a/App/lib/core/Gen/Call/CallGenLib.vp b/App/lib/core/Gen/Call/CallGenLib.vp index 346aa17..bb4e24c 100644 --- a/App/lib/core/Gen/Call/CallGenLib.vp +++ b/App/lib/core/Gen/Call/CallGenLib.vp @@ -4,17 +4,10 @@ import ast import llvmlite import memhub import string -import stdio -import stdlib -import sys -import viperlib -import w32.fileio as fileio import lib.core.VLogger as VLogger import lib.core.Gen.Translator as HT -import lib.Stub.StubMerger as StubMerger -import lib.core.CompilerFactory as CompilerFactory -import lib.core.Gen.Call.CallGenBase as CallGenBase +from . import CallGenBase # ============================================================ diff --git a/App/lib/core/Gen/Call/CallGenMixin.vp b/App/lib/core/Gen/Call/CallGenMixin.vp index 0d7d260..a00d84b 100644 --- a/App/lib/core/Gen/Call/CallGenMixin.vp +++ b/App/lib/core/Gen/Call/CallGenMixin.vp @@ -5,18 +5,13 @@ import ast import llvmlite import memhub import string -import stdio import stdlib -import sys import viperlib -import w32.fileio as fileio import lib.core.VLogger as VLogger import lib.core.Gen.Translator as HT -import lib.Stub.StubMerger as StubMerger -import lib.core.CompilerFactory as CompilerFactory import lib.Stub.StubGen.VpiReader as VpiReader -import lib.core.Gen.Call.CallGenBase as CallGenBase +from . import CallGenBase import lib.core.Gen.GenApi as GenApi diff --git a/App/lib/core/Gen/Call/CallGenProp.vp b/App/lib/core/Gen/Call/CallGenProp.vp index f7dab50..1e154e4 100644 --- a/App/lib/core/Gen/Call/CallGenProp.vp +++ b/App/lib/core/Gen/Call/CallGenProp.vp @@ -6,16 +6,10 @@ import llvmlite import memhub import string import stdio -import stdlib -import sys import viperlib -import w32.fileio as fileio -import lib.core.VLogger as VLogger import lib.core.Gen.Translator as HT -import lib.Stub.StubMerger as StubMerger -import lib.core.CompilerFactory as CompilerFactory -import lib.core.Gen.Call.CallGenBase as CallGenBase +from . import CallGenBase # ============================================================ diff --git a/App/lib/core/Gen/Call/CallGenVa.vp b/App/lib/core/Gen/Call/CallGenVa.vp index 6c9b56c..ea3cda4 100644 --- a/App/lib/core/Gen/Call/CallGenVa.vp +++ b/App/lib/core/Gen/Call/CallGenVa.vp @@ -4,17 +4,9 @@ import ast import llvmlite import memhub import string -import stdio -import stdlib -import sys -import viperlib -import w32.fileio as fileio -import lib.core.VLogger as VLogger import lib.core.Gen.Translator as HT -import lib.Stub.StubMerger as StubMerger -import lib.core.CompilerFactory as CompilerFactory -import lib.core.Gen.Call.CallGenBase as CallGenBase +from . import CallGenBase # ============================================================ diff --git a/App/lib/core/Gen/Call/CallGenVt.vp b/App/lib/core/Gen/Call/CallGenVt.vp index 9707951..b8d4f1f 100644 --- a/App/lib/core/Gen/Call/CallGenVt.vp +++ b/App/lib/core/Gen/Call/CallGenVt.vp @@ -1,23 +1,14 @@ -import lib.core.Gen.GenTypes as GenTypes -import lib.core.Gen.Generator as Generator -import lib.core.Gen.Expr.ExprGenAttr as ExprGenAttr import t, c from stdint import * import ast import llvmlite import memhub import string -import stdio -import stdlib -import sys import viperlib -import w32.fileio as fileio -import lib.core.VLogger as VLogger import lib.core.Gen.Translator as HT -import lib.Stub.StubMerger as StubMerger -import lib.core.CompilerFactory as CompilerFactory +import lib.core.Gen.GenTypes as GenTypes -import lib.core.Gen.Call.CallGenBase as CallGenBase +from . import CallGenBase # ============================================================ diff --git a/App/lib/core/Gen/Class/ClassGenBase.vp b/App/lib/core/Gen/Class/ClassGenBase.vp index a66bfcb..a313e25 100644 --- a/App/lib/core/Gen/Class/ClassGenBase.vp +++ b/App/lib/core/Gen/Class/ClassGenBase.vp @@ -1,18 +1,14 @@ -import lib.core.Gen.GenTypes as GenTypes -import lib.core.Gen.Generator as Generator import t, c from stdint import * import ast -import llvmlite import memhub import string -import stdio import stdlib import viperlib -import lib.core.VLogger as VLogger import lib.core.Gen.Translator as HT -import lib.Stub.StubMerger as StubMerger import lib.core.CompilerFactory as CompilerFactory +import lib.core.Gen.GenTypes as GenTypes +import lib.core.Gen.Generator as Generator # ============================================================ diff --git a/App/lib/core/Gen/Class/ClassGenDef.vp b/App/lib/core/Gen/Class/ClassGenDef.vp index f33480e..0041c5b 100644 --- a/App/lib/core/Gen/Class/ClassGenDef.vp +++ b/App/lib/core/Gen/Class/ClassGenDef.vp @@ -6,14 +6,12 @@ import llvmlite import memhub import string import stdio -import stdlib import viperlib import lib.core.VLogger as VLogger import lib.core.Gen.Translator as HT -import lib.Stub.StubMerger as StubMerger import lib.core.CompilerFactory as CompilerFactory -import lib.core.Gen.Class.ClassGenBase as ClassGenBase +from . import ClassGenBase # ============================================================ diff --git a/App/lib/core/Gen/Class/ClassGenEnum.vp b/App/lib/core/Gen/Class/ClassGenEnum.vp index 7f9f762..223d5e4 100644 --- a/App/lib/core/Gen/Class/ClassGenEnum.vp +++ b/App/lib/core/Gen/Class/ClassGenEnum.vp @@ -5,15 +5,12 @@ import ast import llvmlite import memhub import string -import stdio -import stdlib import viperlib import lib.core.VLogger as VLogger import lib.core.Gen.Translator as HT -import lib.Stub.StubMerger as StubMerger import lib.core.CompilerFactory as CompilerFactory -import lib.core.Gen.Class.ClassGenBase as ClassGenBase +from . import ClassGenBase # ============================================================ diff --git a/App/lib/core/Gen/Class/ClassGenGeneric.vp b/App/lib/core/Gen/Class/ClassGenGeneric.vp index df2b40b..1be6f70 100644 --- a/App/lib/core/Gen/Class/ClassGenGeneric.vp +++ b/App/lib/core/Gen/Class/ClassGenGeneric.vp @@ -2,18 +2,14 @@ import lib.core.Gen.GenTypes as GenTypes import t, c from stdint import * import ast -import llvmlite import memhub import string -import stdio -import stdlib import viperlib import lib.core.VLogger as VLogger import lib.core.Gen.Translator as HT -import lib.Stub.StubMerger as StubMerger import lib.core.CompilerFactory as CompilerFactory -import lib.core.Gen.Class.ClassGenBase as ClassGenBase +from . import ClassGenBase import lib.Stub.StubMerger.StubMergerStore as StubMergerStore diff --git a/App/lib/core/Gen/Class/ClassGenMixin.vp b/App/lib/core/Gen/Class/ClassGenMixin.vp index 8b5a97a..7fbbf8f 100644 --- a/App/lib/core/Gen/Class/ClassGenMixin.vp +++ b/App/lib/core/Gen/Class/ClassGenMixin.vp @@ -1,17 +1,6 @@ import t, c from stdint import * -import ast -import llvmlite -import memhub -import string -import stdio -import stdlib -import viperlib -import lib.core.VLogger as VLogger -import lib.core.Gen.Translator as HT -import lib.Stub.StubMerger as StubMerger -import lib.core.CompilerFactory as CompilerFactory -import lib.core.Gen.Class.ClassGenBase as ClassGenBase +from . import ClassGenBase # ============================================================ # ClassGenMixin - 类定义/继承/泛型/vtable/enum/union/renum diff --git a/App/lib/core/Gen/Class/ClassGenVTable.vp b/App/lib/core/Gen/Class/ClassGenVTable.vp index f152d5c..06a5a60 100644 --- a/App/lib/core/Gen/Class/ClassGenVTable.vp +++ b/App/lib/core/Gen/Class/ClassGenVTable.vp @@ -5,15 +5,12 @@ import ast import llvmlite import memhub import string -import stdio -import stdlib import viperlib import lib.core.VLogger as VLogger import lib.core.Gen.Translator as HT -import lib.Stub.StubMerger as StubMerger import lib.core.CompilerFactory as CompilerFactory -import lib.core.Gen.Class.ClassGenBase as ClassGenBase +from . import ClassGenBase import lib.core.Gen.GenApi as GenApi diff --git a/App/lib/core/Gen/Expr/ExprGenAttr.vp b/App/lib/core/Gen/Expr/ExprGenAttr.vp index 45a24b3..0b1d40c 100644 --- a/App/lib/core/Gen/Expr/ExprGenAttr.vp +++ b/App/lib/core/Gen/Expr/ExprGenAttr.vp @@ -8,15 +8,10 @@ import string import stdio import stdlib import viperlib -import w32.fileio as fileio -import lib.core.CompilerFactory as CompilerFactory import lib.core.Gen.Translator as HT -import lib.Stub.StubMerger as StubMerger import lib.Stub.StubMerger.StubMergerStore as StubMergerStore import lib.Stub.StubMerger.StubMergerBuild as StubMergerBuild import lib.core.VLogger as VLogger -import lib.Projectrans.Config as Config -import lib.Projectrans.Utils as Utils import lib.core.Gen.Expr.ExprGenBase as ExprGenBase diff --git a/App/lib/core/Gen/Expr/ExprGenBase.vp b/App/lib/core/Gen/Expr/ExprGenBase.vp index 6fd1d75..c9ba81b 100644 --- a/App/lib/core/Gen/Expr/ExprGenBase.vp +++ b/App/lib/core/Gen/Expr/ExprGenBase.vp @@ -5,15 +5,8 @@ import ast import llvmlite import memhub import string -import stdio -import stdlib import viperlib -import w32.fileio as fileio -import lib.core.CompilerFactory as CompilerFactory import lib.core.Gen.Translator as HT -import lib.Stub.StubMerger as StubMerger -import lib.core.VLogger as VLogger -import lib.Projectrans.Config as Config import lib.Projectrans.Utils as Utils diff --git a/App/lib/core/Gen/Expr/ExprGenCdef.vp b/App/lib/core/Gen/Expr/ExprGenCdef.vp index 40216f7..2d7fe89 100644 --- a/App/lib/core/Gen/Expr/ExprGenCdef.vp +++ b/App/lib/core/Gen/Expr/ExprGenCdef.vp @@ -8,12 +8,9 @@ import stdio import stdlib import viperlib import w32.fileio as fileio -import lib.core.CompilerFactory as CompilerFactory -import lib.core.Gen.Translator as HT import lib.Stub.StubMerger as StubMerger import lib.core.VLogger as VLogger import lib.Projectrans.Config as Config -import lib.Projectrans.Utils as Utils import lib.core.Gen.Expr.ExprGenBase as ExprGenBase import lib.Stub.StubMerger.StubMergerCollect as StubMergerCollect diff --git a/App/lib/core/Gen/Expr/ExprGenCls.vp b/App/lib/core/Gen/Expr/ExprGenCls.vp index 50a3f3b..b8c1b6c 100644 --- a/App/lib/core/Gen/Expr/ExprGenCls.vp +++ b/App/lib/core/Gen/Expr/ExprGenCls.vp @@ -1,24 +1,16 @@ -import lib.core.Gen.GenTypes as GenTypes -import lib.core.Gen.Generator as Generator -import lib.core.Gen.Call.CallGenBase as CallGenBase import t, c from stdint import * import ast import llvmlite import memhub import string -import stdio import stdlib import viperlib -import w32.fileio as fileio import lib.core.CompilerFactory as CompilerFactory import lib.core.Gen.Translator as HT -import lib.Stub.StubMerger as StubMerger -import lib.core.VLogger as VLogger -import lib.Projectrans.Config as Config -import lib.Projectrans.Utils as Utils import lib.Stub.StubGen.VpiReader as VpiReader +import lib.core.Gen.GenTypes as GenTypes import lib.core.Gen.Expr.ExprGenBase as ExprGenBase import lib.Stub.StubMerger.StubMergerStore as StubMergerStore diff --git a/App/lib/core/Gen/Expr/ExprGenConst.vp b/App/lib/core/Gen/Expr/ExprGenConst.vp index addeecb..6b48ffe 100644 --- a/App/lib/core/Gen/Expr/ExprGenConst.vp +++ b/App/lib/core/Gen/Expr/ExprGenConst.vp @@ -1,4 +1,3 @@ -import lib.core.Gen.GenTypes as GenTypes import t, c from stdint import * import ast @@ -8,14 +7,9 @@ import string import stdio import stdlib import viperlib -import w32.fileio as fileio -import lib.core.CompilerFactory as CompilerFactory import lib.core.Gen.Translator as HT -import lib.Stub.StubMerger as StubMerger -import lib.core.VLogger as VLogger -import lib.Projectrans.Config as Config -import lib.Projectrans.Utils as Utils +import lib.core.Gen.GenTypes as GenTypes import lib.core.Gen.Expr.ExprGenBase as ExprGenBase diff --git a/App/lib/core/Gen/Expr/ExprGenFstr.vp b/App/lib/core/Gen/Expr/ExprGenFstr.vp index 22dbea2..6718760 100644 --- a/App/lib/core/Gen/Expr/ExprGenFstr.vp +++ b/App/lib/core/Gen/Expr/ExprGenFstr.vp @@ -4,17 +4,7 @@ import ast import llvmlite import memhub import string -import stdio -import stdlib -import viperlib -import w32.fileio as fileio -import lib.core.CompilerFactory as CompilerFactory import lib.core.Gen.Translator as HT -import lib.Stub.StubMerger as StubMerger -import lib.core.VLogger as VLogger -import lib.Projectrans.Config as Config -import lib.Projectrans.Utils as Utils - import lib.core.Gen.Expr.ExprGenBase as ExprGenBase diff --git a/App/lib/core/Gen/Expr/ExprGenMixin.vp b/App/lib/core/Gen/Expr/ExprGenMixin.vp index 895008d..e920e7d 100644 --- a/App/lib/core/Gen/Expr/ExprGenMixin.vp +++ b/App/lib/core/Gen/Expr/ExprGenMixin.vp @@ -2,18 +2,8 @@ import t, c from stdint import * import ast import memhub -import string import llvmlite -import stdlib -import stdio -import viperlib -import w32.fileio as fileio -import lib.core.CompilerFactory as CompilerFactory import lib.core.Gen.Translator as HT -import lib.Stub.StubMerger as StubMerger -import lib.core.VLogger as VLogger -import lib.Projectrans.Config as Config -import lib.Projectrans.Utils as Utils import lib.core.Gen.Expr.ExprGenBase as ExprGenBase diff --git a/App/lib/core/Gen/Expr/ExprGenName.vp b/App/lib/core/Gen/Expr/ExprGenName.vp index dc6de8f..1fbc247 100644 --- a/App/lib/core/Gen/Expr/ExprGenName.vp +++ b/App/lib/core/Gen/Expr/ExprGenName.vp @@ -6,16 +6,9 @@ import llvmlite import memhub import string import stdio -import stdlib import viperlib -import w32.fileio as fileio -import lib.core.CompilerFactory as CompilerFactory import lib.core.Gen.Translator as HT -import lib.Stub.StubMerger as StubMerger import lib.Stub.StubMerger.StubMergerStore as StubMergerStore -import lib.core.VLogger as VLogger -import lib.Projectrans.Config as Config -import lib.Projectrans.Utils as Utils import lib.core.Gen.Expr.ExprGenBase as ExprGenBase diff --git a/App/lib/core/Gen/Expr/ExprGenOps.vp b/App/lib/core/Gen/Expr/ExprGenOps.vp index 2e85901..66d1ac2 100644 --- a/App/lib/core/Gen/Expr/ExprGenOps.vp +++ b/App/lib/core/Gen/Expr/ExprGenOps.vp @@ -5,16 +5,8 @@ import ast import llvmlite import memhub import string -import stdio -import stdlib import viperlib -import w32.fileio as fileio -import lib.core.CompilerFactory as CompilerFactory import lib.core.Gen.Translator as HT -import lib.Stub.StubMerger as StubMerger -import lib.core.VLogger as VLogger -import lib.Projectrans.Config as Config -import lib.Projectrans.Utils as Utils import lib.core.Gen.Expr.ExprGenBase as ExprGenBase diff --git a/App/lib/core/Gen/Type/TypeGenResolve.vp b/App/lib/core/Gen/Type/TypeGenResolve.vp index 24f27fe..b907db4 100644 --- a/App/lib/core/Gen/Type/TypeGenResolve.vp +++ b/App/lib/core/Gen/Type/TypeGenResolve.vp @@ -672,10 +672,10 @@ class TypeGenResolve(TypeGenBase.TypeGenBase): return llvmlite.Int64(pool) # stdint 指针类型(XxxPTR = XxxType | t.CPtr) - elif string.strcmp(type_name, "INTPTR") == 0: - return llvmlite.Ptr(pool, llvmlite.Int32(pool)) - elif string.strcmp(type_name, "UINTPTR") == 0: - return llvmlite.Ptr(pool, llvmlite.Int32(pool)) + # 注:INTPTR/UINTPTR 已由 stdint.vp CTypedef 声明解析(INTPTR = t.CInt|t.CPtr、 + # UINTPTR = UINT|t.CPtr;stdint.vp L6-14 注释:历史命名 = int*/unsigned int* + # 指针,非 C 标准 intptr_t 整数),删除硬编码避免双事实源(stdint 修改定义 + # 时此处不同步)。CTypedef 动态查表(L1377)先于本 map_t_type 兜底执行。 elif string.strcmp(type_name, "BYTEPTR") == 0: return llvmlite.Ptr(pool, llvmlite.Int8(pool)) elif string.strcmp(type_name, "CHARLIST") == 0: