mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 07:46:00 +02:00
pastojs: fixed creating enum shortrefs for precompiled code
git-svn-id: trunk@48924 -
(cherry picked from commit f7b819526c
)
This commit is contained in:
parent
a487401c7b
commit
9da119038e
@ -8183,7 +8183,7 @@ Var
|
|||||||
HasImplUsesClause, ok, NeedRTLCheckVersion: Boolean;
|
HasImplUsesClause, ok, NeedRTLCheckVersion: Boolean;
|
||||||
Prg: TPasProgram;
|
Prg: TPasProgram;
|
||||||
Lib: TPasLibrary;
|
Lib: TPasLibrary;
|
||||||
AssignSt: TJSSimpleAssignStatement;
|
ImplFuncAssignSt: TJSSimpleAssignStatement;
|
||||||
IntfSecCtx: TInterfaceSectionContext;
|
IntfSecCtx: TInterfaceSectionContext;
|
||||||
ModScope: TPas2JSModuleScope;
|
ModScope: TPas2JSModuleScope;
|
||||||
begin
|
begin
|
||||||
@ -8290,10 +8290,10 @@ begin
|
|||||||
|
|
||||||
ImplFunc:=CreateImplementationSection(El,IntfSecCtx);
|
ImplFunc:=CreateImplementationSection(El,IntfSecCtx);
|
||||||
// add $mod.$implcode = ImplFunc;
|
// add $mod.$implcode = ImplFunc;
|
||||||
AssignSt:=TJSSimpleAssignStatement(CreateElement(TJSSimpleAssignStatement,El));
|
ImplFuncAssignSt:=TJSSimpleAssignStatement(CreateElement(TJSSimpleAssignStatement,El));
|
||||||
AssignSt.LHS:=CreateMemberExpression([ModVarName,GetBIName(pbivnImplCode)]);
|
ImplFuncAssignSt.LHS:=CreateMemberExpression([ModVarName,GetBIName(pbivnImplCode)]);
|
||||||
AssignSt.Expr:=ImplFunc;
|
ImplFuncAssignSt.Expr:=ImplFunc;
|
||||||
AddToSourceElements(Src,AssignSt);
|
AddToSourceElements(Src,ImplFuncAssignSt);
|
||||||
|
|
||||||
// append initialization section
|
// append initialization section
|
||||||
CreateInitSection(El,Src,IntfSecCtx);
|
CreateInitSection(El,Src,IntfSecCtx);
|
||||||
@ -8305,7 +8305,7 @@ begin
|
|||||||
// remove unneeded $impl from interface
|
// remove unneeded $impl from interface
|
||||||
RemoveFromSourceElements(Src,ImplVarSt);
|
RemoveFromSourceElements(Src,ImplVarSt);
|
||||||
// remove unneeded $mod.$implcode = function(){}
|
// remove unneeded $mod.$implcode = function(){}
|
||||||
RemoveFromSourceElements(Src,AssignSt);
|
RemoveFromSourceElements(Src,ImplFuncAssignSt);
|
||||||
HasImplUsesClause:=(El.ImplementationSection<>nil)
|
HasImplUsesClause:=(El.ImplementationSection<>nil)
|
||||||
and (length(El.ImplementationSection.UsesClause)>0);
|
and (length(El.ImplementationSection.UsesClause)>0);
|
||||||
end
|
end
|
||||||
@ -27078,8 +27078,8 @@ begin
|
|||||||
for i:=0 to ElRefList.Count-1 do
|
for i:=0 to ElRefList.Count-1 do
|
||||||
begin
|
begin
|
||||||
El:=TPasElement(ElRefList[i]);
|
El:=TPasElement(ElRefList[i]);
|
||||||
if ElNeedsGlobalAlias(El) then
|
// Note: they are all needed by precompiled code, do not check ElNeedsGlobalAlias
|
||||||
CreateGlobalElPath(El,SectionContext);
|
CreateGlobalElPath(El,SectionContext);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -46,8 +46,6 @@ Works:
|
|||||||
- gzipped json
|
- gzipped json
|
||||||
- write final switches
|
- write final switches
|
||||||
- srcmaps for precompiled js
|
- srcmaps for precompiled js
|
||||||
|
|
||||||
ToDo:
|
|
||||||
- generics:
|
- generics:
|
||||||
- generic proc bodies are stored with all elements, but without resolver customdata
|
- generic proc bodies are stored with all elements, but without resolver customdata
|
||||||
- specializations are stored like external elements
|
- specializations are stored like external elements
|
||||||
@ -70,8 +68,9 @@ ToDo:
|
|||||||
- TPCUReader.ReadExternalSpecialized
|
- TPCUReader.ReadExternalSpecialized
|
||||||
-
|
-
|
||||||
- TPCUReader.ReadSpecializeType reads a TPasSpecializeType and creates specialized type
|
- TPCUReader.ReadSpecializeType reads a TPasSpecializeType and creates specialized type
|
||||||
- TPCUReader.ReadInlineSpecializeExpr: ToDo create specialized type
|
- TPCUReader.ReadInlineSpecializeExpr: create specialized type
|
||||||
|
|
||||||
|
Todo:
|
||||||
- store used GUIDs
|
- store used GUIDs
|
||||||
- distinguish reader errors in fatal and error
|
- distinguish reader errors in fatal and error
|
||||||
- when pcu is bad, unload and use src
|
- when pcu is bad, unload and use src
|
||||||
|
Loading…
Reference in New Issue
Block a user