summaryrefslogtreecommitdiffstats
path: root/libcxxabi
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2014-06-11 16:54:09 +0000
committerMarshall Clow <mclow.lists@gmail.com>2014-06-11 16:54:09 +0000
commitfa9fd4a09b52a58f5cdf6d7474929d57361379fb (patch)
tree285e8a4eb6401c452c672ccd9a806cce533293c2 /libcxxabi
parent5cbbb1be9274d2c41cc8198424536cffd15d4d05 (diff)
downloadbcm5719-llvm-fa9fd4a09b52a58f5cdf6d7474929d57361379fb.tar.gz
bcm5719-llvm-fa9fd4a09b52a58f5cdf6d7474929d57361379fb.zip
Add a FAQ section, with a question about why the std::exception class destructors live in libc++abi
llvm-svn: 210661
Diffstat (limited to 'libcxxabi')
-rw-r--r--libcxxabi/www/index.html16
1 files changed, 16 insertions, 0 deletions
diff --git a/libcxxabi/www/index.html b/libcxxabi/www/index.html
index 5d4e247775d..a174afdb80d 100644
--- a/libcxxabi/www/index.html
+++ b/libcxxabi/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>
OpenPOWER on IntegriCloud