diff options
author | Marshall Clow <mclow.lists@gmail.com> | 2014-06-11 16:54:09 +0000 |
---|---|---|
committer | Marshall Clow <mclow.lists@gmail.com> | 2014-06-11 16:54:09 +0000 |
commit | c9d6b42449f23729acc37ad183e65d6146755a24 (patch) | |
tree | 726597b128b16d5a518f9bd3aaad36a8c33aa261 /www/index.html | |
parent | e53a8f3242d02744c4f634abc3504d3b34302930 (diff) |
Add a FAQ section, with a question about why the std::exception class destructors live in libc++abi
git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@210661 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'www/index.html')
-rw-r--r-- | www/index.html | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/www/index.html b/www/index.html index 5d4e247..a174afd 100644 --- a/www/index.html +++ b/www/index.html @@ -82,6 +82,22 @@ <p>Send discussions to the (<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">clang mailing list</a>).</p> + <!--=====================================================================--> + <h2>Frequently asked questions</h2> + <!--=====================================================================--> + + <p>Q: Why are the destructors for the standard exception classes defined in libc++abi? + They're just empty, can't they be defined inline?</p> + <p>A: The destructors for them live in libc++abi because they are "key" functions. + The Itanium ABI describes a "key" function as the first virtual declared. + And wherever the key function is defined, that is where the <code>type_info</code> gets defined. + And in libc++ types are the same type if and only if they have the same <code>type_info</code> + (as in there must be only one type info per type in the entire application). + And on OS X, libstdc++ and libc++ share these exception types. + So to be able to throw in one dylib and catch in another (a <code>std::exception</code> for example), + there must be only one <code>std::exception type_info</code> in the entire app. + That typeinfo gets laid down beside <code>~exception()</code> in libc++abi (for both libstdc++ and libc++).</p> + <p>--Howard Hinnant</p> </div> </body> |