clang-tlb-import: main: simplify organization of callbacks

one callback for opaque-resolution: adding an alias to the underlying
type for typedefs named like the given string

one callback for actual tlb-import: doing all the fancy work to note the
record-layout into the database

Signed-off-by: Martin Zenzes <martin.zenzes@dfki.de>
clang-tlb-import: cleanup header, signatures and stuff

no functional changes.

TypelibBuilder:
- remove superfluous forward-declarations and includes
- move functions not used publicly into private section
- rename public functions for consistent naming based on type of
  argument (registerTypeDef->registerTypedefNameDecl)
- remove some old non-existing declarations
- add doxygen to a few more public functions
- oh, there is an actual functional change: make "loadRegistry" return
  void instead of always true...

Signed-off-by: Martin Zenzes <martin.zenzes@dfki.de>
clang-tlb-import: add "saveRegistry()" function

same as "loadRegistry()"

Signed-off-by: Martin Zenzes <martin.zenzes@dfki.de>
clang-tlb-import: rename meta-data function

and move them to bottom of file

Signed-off-by: Martin Zenzes <martin.zenzes@dfki.de>
clang-tlb-import: more simplification of TlbImportCallback

use clangs "Decl" class hierarchy proper

Signed-off-by: Martin Zenzes <martin.zenzes@dfki.de>
clang-tlb-import: use "llvm::dyn_cast<>" instead of "static_cast<>"

compile-time safetey

Signed-off-by: Martin Zenzes <martin.zenzes@dfki.de>
clang-tlb-import: renovate tests in "registerType()"

don't do string-manipulation to detect to-be-excluded types as it does
not make sense -- use the clang-API for this.

extended the test for "function pointer" to excludede "any pointer"
types. and removed the "sizeof" test... can find an example in the
test-suite where the missing test will create an error. in the contrary:
a (mean) test-case now passes where is should pass. updated tlb-file of
the test-case included.

Signed-off-by: Martin Zenzes <martin.zenzes@dfki.de>
clang-tlb-import: add comment to "TypelibBuilder::registerType()", move return stmt

returning earlier safes one superfluous print to the console.

Signed-off-by: Martin Zenzes <martin.zenzes@dfki.de>
clang-tlb-import: renovate "registerBuiltIn()"

- rename function from "registerBuildIn()" to "registerBuiltIn()"
- add comment for size-is-multiple-of-8-check
- use the "canonicalTypeName" given in argument. don't create another
  local string "typeName"

this renaming-thing is still strange for me...

Signed-off-by: Martin Zenzes <martin.zenzes@dfki.de>
clang-tlb-import: renovate "addArray()"

- change argument-type from "clang::Type" to "clang::ConstantArrayType".
  way more specific.
- add documentation

Signed-off-by: Martin Zenzes <martin.zenzes@dfki.de>
clang-tlb-import: "addRecord()": move test for already added types to beginning

testing if the work will be futile before doing all the work might save
the work.

will remove superfluous add of a "numeric double" to "classes.tlb". was
created before because the "/classes/C1" have a double-field. but they
are also opaques and hence in the database from the beginning. no
information for these need to be known by typelib, the heavy-lifting
will be done by the user-supplied opaque-specific code.

Signed-off-by: Martin Zenzes <martin.zenzes@dfki.de>
clang-tlb-import: NamingConversion: also export string-variant of cxxToTypelibName

before the hope was to hide the string-based version behind the clang-type system.

but I need this variant elsewhere, so...

Signed-off-by: Martin Zenzes <martin.zenzes@dfki.de>
clang-tlb-import: renovate "registerContainer()"

also fix it...

various changes, still not working... there are broken underlying
assumptions in the code... need a bigger hammer!

Signed-off-by: Martin Zenzes <martin.zenzes@dfki.de>
clang-tlb-import: make various functions return "Typelib::Type const*"

...instead of a boring "bool"

lets see if this helps... close to re-start this whole heap of shit from
scratch...

Signed-off-by: Martin Zenzes <martin.zenzes@dfki.de>
clang-tlb-import: dismiss "checkRegisterType()"

since now most of the functions return the pointer to a Typelib::Type
object, we don't need any additional layer of function to look this
pointer up. it is the return value of "registerType()"

Signed-off-by: Martin Zenzes <martin.zenzes@dfki.de>
registry: minor "fixes"

- return explicit NULL
- use explicit const_cast instead of static_cast

Signed-off-by: Martin Zenzes <martin.zenzes@dfki.de>
clang-tlb-import: minor fixes to checkRegisterContainer

typos, prints and such...

Signed-off-by: Martin Zenzes <martin.zenzes@dfki.de>
clang-tlb-import: rework "setMetaDataDoc()" to handle more comment types

also tell the operator if a comment-kind was not handled, and where it is located

Signed-off-by: Martin Zenzes <martin.zenzes@dfki.de>
clang-tlb-import: minor rewrites, nicer debug printing

make some things more clear for the human at the shell trying to follow
whats going on.

also some minor re-orderings in the code, for more clarity.

Signed-off-by: Martin Zenzes <martin.zenzes@dfki.de>
clang-tlb-import: move injected-class-name guard into "registerTypeDecl()"

don't test in main, but inside the specific functions...

Signed-off-by: Martin Zenzes <martin.zenzes@dfki.de>