mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-24 01:29:44 +02:00
+ tobjectdef.jvm_full_typename() which returns the fully mangled type
name of a Java class (package/procname), extracted from jvmdef * several fixes to jvmmangledname (po_has_importdll only applies to unit-level procedures, replace incomplete mangling of class type names with call to jvm_full_typename() git-svn-id: branches/jvmbackend@18326 -
This commit is contained in:
parent
9a9ea1f257
commit
1ace6ec201
@ -181,12 +181,7 @@ implementation
|
||||
case tobjectdef(def).objecttype of
|
||||
odt_javaclass,
|
||||
odt_interfacejava:
|
||||
begin
|
||||
encodedstr:=encodedstr+'L';
|
||||
if assigned(tobjectdef(def).import_lib) then
|
||||
encodedstr:=encodedstr+tobjectdef(def).import_lib^+'/';
|
||||
encodedstr:=encodedstr+tobjectdef(def).objextname^+';';
|
||||
end
|
||||
encodedstr:=encodedstr+'L'+tobjectdef(def).jvm_full_typename+';'
|
||||
else
|
||||
result:=false;
|
||||
end;
|
||||
|
@ -336,6 +336,8 @@ interface
|
||||
function check_objc_types: boolean;
|
||||
{ C++ }
|
||||
procedure finish_cpp_data;
|
||||
{ JVM }
|
||||
function jvm_full_typename: string;
|
||||
end;
|
||||
|
||||
tclassrefdef = class(tabstractpointerdef)
|
||||
@ -4203,8 +4205,8 @@ implementation
|
||||
procedure tprocdef.adornmangledname(var name: string; fordefinition: boolean);
|
||||
{$ifdef jvm}
|
||||
var
|
||||
owningunit:tsymtable;
|
||||
tmpresult:string;
|
||||
owningunit: tsymtable;
|
||||
tmpresult: string;
|
||||
{$endif jvm}
|
||||
begin
|
||||
{$ifdef jvm}
|
||||
@ -4237,31 +4239,33 @@ implementation
|
||||
staticsymtable,
|
||||
localsymtable:
|
||||
begin
|
||||
if po_has_importdll in procoptions then
|
||||
begin
|
||||
tmpresult:='';
|
||||
{ import_dll comes from "external 'import_dll_name' name 'external_name'" }
|
||||
if assigned(import_dll) then
|
||||
tmpresult:=import_dll^+'/'
|
||||
else
|
||||
internalerror(2010122607);
|
||||
end;
|
||||
owningunit:=procsym.owner;
|
||||
while (owningunit.symtabletype in [localsymtable,objectsymtable,recordsymtable]) do
|
||||
owningunit:=owner.defowner.owner;
|
||||
{ TODO: add package name !!! }
|
||||
tmpresult:=owningunit.realname^+'/';
|
||||
tmpresult:=tmpresult+owningunit.realname^+'/';
|
||||
end;
|
||||
objectsymtable:
|
||||
case tobjectdef(procsym.owner.defowner).objecttype of
|
||||
odt_javaclass,
|
||||
odt_interfacejava:
|
||||
tmpresult:=tobjectdef(procsym.owner.defowner).objextname^+'/';
|
||||
begin
|
||||
tmpresult:=tobjectdef(procsym.owner.defowner).jvm_full_typename+'/'
|
||||
end
|
||||
else
|
||||
internalerror(2010122606);
|
||||
end
|
||||
else
|
||||
internalerror(2010122605);
|
||||
end;
|
||||
if po_has_importdll in procoptions then
|
||||
begin
|
||||
{ import_dll comes from "external 'import_dll_name' name 'external_name'" }
|
||||
if assigned(import_dll) then
|
||||
tmpresult:=tmpresult+import_dll^+'/'
|
||||
else
|
||||
internalerror(2010122607);
|
||||
end;
|
||||
end;
|
||||
name:=tmpresult+name;
|
||||
{$endif}
|
||||
@ -5568,6 +5572,15 @@ implementation
|
||||
self.symtable.DefList.ForEachCall(@do_cpp_import_info,nil);
|
||||
end;
|
||||
|
||||
|
||||
function tobjectdef.jvm_full_typename: string;
|
||||
begin
|
||||
result:='';
|
||||
if assigned(import_lib) then
|
||||
result:=import_lib^+'/';
|
||||
result:=result+objextname^;
|
||||
end;
|
||||
|
||||
{****************************************************************************
|
||||
TImplementedInterface
|
||||
****************************************************************************}
|
||||
|
Loading…
Reference in New Issue
Block a user