compiler: 
  - add write_rtti_reference method, 
  - minor refactoring, 
  - always write nil as RTTI reference for objc types and void types

git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@24471 3ad0048d-3df7-0310-abae-a5850022a9f2