> Complex types are built from primitive types. And if FPC can verify the
> "pure" attribute is valid, then LLVM can probably also come up with it.
> In fact, if FPC can verify it is valid, it can also come up with it
> itself and add it as an annotation in the LLVM bitcode.

AFAIU, "pure" attribute is planned to be user's responsibility and that's 
probably ok.

e.g. what about returning dynamic arrays? Like:

type TIntArray = array of Integer;
function ArrInit(): TIntArray;
begin
  SetLength(Result, 1);
  Result[0]:=1;
end;
... I am afraid from LLVM perspective it wouldn't be "pure" function (memory 
allocation, initialization, etc.).
From Pascal user's perspective, I would consider it pure.

Second, LLVM is just one backend, right?

-- 
Regards,
Denis Golovan
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to