llvm/unittests
Chandler Carruth 0e5b32301d [Support] Add a fancy helper function to get a static name for a type.
This extracts the type name from __PRETTY_FUNCTION__ for compilers that
support it (I've opted Clang, GCC, and ICC into this as I've tested that
they work) and from __FUNCSIG__ which is very similar on MSVC. The
routine falls back gracefully on a stub "UNKNOWN_TYPE" string with
compilers or formats it doesn't understand.

This should be enough for a lot of common cases in LLVM where the real
goal is just to log or print a type name as a debugging aid, and save
a ton of boilerplate in the process. Notably, I'm planning to use this
to remove all the getName() boiler plate from the new pass manager.

The design and implementation is based on a bunch of advice and
discussion with Richard Smith and experimenting with most versions of
Clang and GCC. David Majnemer also provided excellent advice on how best
to do this with MSVC. Richard also checked that ICC does something
reasonable and I'll watch the build bots for other compilers. It'd be
great if someone could contribute logic for xlC and/or other toolchains.

Differential Revision: http://reviews.llvm.org/D17565

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261819 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-25 03:58:21 +00:00
..
ADT [ADT] Fix PointerEmbeddedInt when the underlying type is uintptr_t. 2016-02-18 21:00:08 +00:00
Analysis [PM] Remove an overly aggressive assert now that I can actually test the 2016-02-23 10:47:57 +00:00
AsmParser Remove autoconf support 2016-01-26 21:29:08 +00:00
Bitcode Remove autoconf support 2016-01-26 21:29:08 +00:00
CodeGen Remove autoconf support 2016-01-26 21:29:08 +00:00
DebugInfo [DebugInfoPDB] Add source / line number accessors for PDB. 2016-02-18 18:47:29 +00:00
ExecutionEngine Kill LLVMAddTargetData 2016-02-16 00:22:02 +00:00
IR [ConstantRange] Rename a method and add more doc 2016-02-22 16:13:02 +00:00
LineEditor Remove autoconf support 2016-01-26 21:29:08 +00:00
Linker Delete the deprecated LLVMLinkModules. 2016-02-12 15:28:45 +00:00
MC [unittests] Move TargetRegistry test from Support to MC 2016-02-03 21:41:24 +00:00
MI Make a stub version of MITests, instead of reverting. 2016-02-18 07:37:17 +00:00
Option Remove autoconf support 2016-01-26 21:29:08 +00:00
ProfileData Add profile summary support for sample profile. 2016-02-19 03:15:33 +00:00
Support [Support] Add a fancy helper function to get a static name for a type. 2016-02-25 03:58:21 +00:00
Transforms [Cloning] Clone every Function's Debug Info 2016-02-13 02:04:29 +00:00
CMakeLists.txt Make a stub version of MITests, instead of reverting. 2016-02-18 07:37:17 +00:00