+ llvmaggregatetype() helper that returns whether a def is represented by an

aggregate type in llvm

git-svn-id: branches/hlcgllvm@26986 -
This commit is contained in:
Jonas Maebe 2014-03-06 21:40:36 +00:00
parent f344adaf22
commit 43e0eb3cfd

View File

@ -41,6 +41,10 @@ interface
function llvmencodeproctype(def: tabstractprocdef; withprocname, withparanames: boolean): TSymStr;
procedure llvmaddencodedproctype(def: tabstractprocdef; withprocname, withparanames: boolean; var encodedstr: TSymStr);
{ returns whether a def is representated by an aggregate type in llvm
(struct, array) }
function llvmaggregatetype(def: tdef): boolean;
implementation
@ -56,6 +60,20 @@ implementation
Type encoding
*******************************************************************}
function llvmaggregatetype(def: tdef): boolean;
begin
result:=
(def.typ in [recorddef,filedef,variantdef]) or
((def.typ=arraydef) and
not is_dynamic_array(def)) or
((def.typ=setdef) and
not is_smallset(def)) or
is_shortstring(def) or
is_object(def) or
((def.typ=procvardef) and
not tprocvardef(def).is_addressonly)
end;
procedure llvmaddencodedtype(def: tdef; inaggregate: boolean; var encodedstr: TSymStr);
begin