mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-06 00:10:19 +02:00
* mark the typesyms generated in trecorddef.create_global_internal() as used
so that they don't cause hints about unused types git-svn-id: branches/hlcgllvm@28762 -
This commit is contained in:
parent
12836db931
commit
95b95497d4
@ -3952,6 +3952,7 @@ implementation
|
||||
constructor trecorddef.create_global_internal(n: string; packrecords: shortint);
|
||||
var
|
||||
oldsymtablestack: tsymtablestack;
|
||||
ts: ttypesym;
|
||||
definedname: boolean;
|
||||
begin
|
||||
{ construct name }
|
||||
@ -3967,19 +3968,26 @@ implementation
|
||||
symtable.defowner:=self;
|
||||
isunion:=false;
|
||||
inherited create(n,recorddef);
|
||||
{ if we specified a name, then we'll probably want to look up the
|
||||
type again by name too -> create typesym }
|
||||
if definedname then
|
||||
begin
|
||||
ts:=ctypesym.create(n,self);
|
||||
{ avoid hints about unused types (these may only be used for
|
||||
typed constant data) }
|
||||
ts.increfcount;
|
||||
end;
|
||||
if assigned(current_module.localsymtable) then
|
||||
begin
|
||||
current_module.localsymtable.insertdef(self);
|
||||
{ if we specified a name, then we'll probably wan't to look up the
|
||||
type again by name too }
|
||||
if definedname then
|
||||
current_module.localsymtable.insert(ctypesym.create(n,self));
|
||||
current_module.localsymtable.insert(ts);
|
||||
end
|
||||
else
|
||||
begin
|
||||
current_module.globalsymtable.insertdef(self);
|
||||
if definedname then
|
||||
current_module.globalsymtable.insert(ctypesym.create(n,self));
|
||||
current_module.globalsymtable.insert(ts);
|
||||
end;
|
||||
symtablestack:=oldsymtablestack;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user