Improved comment to explain why we can use __cxa_get_globals_fast here
llvm-svn: 147554
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: d2bab35080d11fd902315d5c472a5d623911e057
diff --git a/src/cxa_exception.cpp b/src/cxa_exception.cpp
index 9fa7aba..4065aeb 100644
--- a/src/cxa_exception.cpp
+++ b/src/cxa_exception.cpp
@@ -381,6 +381,10 @@
Returns a pointer to the thrown object (if any) at the top of the
caughtExceptions stack. Atommically increment the exception's referenceCount.
If there is no such thrown object, returns null.
+
+ We can use __cxa_get_globals_fast here to get the globals because if there have
+ been no exceptions thrown, ever, on this thread, we can return NULL without
+ the need to allocate the exception-handling globals.
*/
void*
__cxa_current_primary_exception() throw()