libbrillo: Remove RTTI from the library

The main reason why we needed run-time type information is so that
we can get a type name string for a particular type T. This string
was used in type comparisons in brillo::Any as the only reliable way
of determining if two Any instances have values of the same type.

For this typeid(T).name() was used which requires RTTI to be enabled.

However using RTTI causes issues when linking to libraries with RTTI
disabled. To resolve this issue, stop relying on RTTI in libbrillo
and throughout the rest of Brillo code.

A special work-around was implemented to obtain a type name for
a given type, which relies on the fact that __PRETTY_FUNCTION__ macro
on GCC/clang includes the full signature of a method, including any
template parameters.

For example, brillo::GetTypeTag<double>() would return

  const char *brillo::GetTypeTag() [T = double]

and extracting the type name ("double") is just a matter of simple
string manipulations.

To speed up the code at run-time, we don't really need to extract
the type name from this function name when comparing two types, but
rather compare the two function names directly. This function name
with embedded type is called "type tag" in the code.

Unfortunately GCC and CLANG handle __PRETTY_FUNCTION__ differently
for certain template types, so added #error statement to force
compiling using clang only (since this is the compiler used most
often for Brillo targets).

BUG: 26292405
Change-Id: Ie70012b62f66911ee7787e5cf7eeab88359bd959
11 files changed