diff options
author | Abseil Team <absl-team@google.com> | 2022-02-01 18:44:30 (GMT) |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2022-02-01 18:44:59 (GMT) |
commit | 25ad42aabeaba6227f37795cdd2752e128e83827 (patch) | |
tree | 56bc9b13ac10a11a2f933ed74eaca6d34676983d /googletest/src | |
parent | 4517697675fc0d51c89aca61af5c77c4f1e4ee2d (diff) | |
download | googletest-25ad42aabeaba6227f37795cdd2752e128e83827.zip googletest-25ad42aabeaba6227f37795cdd2752e128e83827.tar.gz googletest-25ad42aabeaba6227f37795cdd2752e128e83827.tar.bz2 |
GetCurrentOsStackTraceExceptTop (both the method of UnitTestImpl and the wrapper function in gtest.cc) rely on the fact that the inner call is not getting optimized.
This CL annotates them with the appropriate attributes.
PiperOrigin-RevId: 425663217
Change-Id: Ib9ec2a69a7dd98d37640b56d4d7798572da66669
Diffstat (limited to 'googletest/src')
-rw-r--r-- | googletest/src/gtest-internal-inl.h | 3 | ||||
-rw-r--r-- | googletest/src/gtest.cc | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/googletest/src/gtest-internal-inl.h b/googletest/src/gtest-internal-inl.h index 62b5b10..3f5551d 100644 --- a/googletest/src/gtest-internal-inl.h +++ b/googletest/src/gtest-internal-inl.h @@ -623,7 +623,8 @@ class GTEST_API_ UnitTestImpl { // For example, if Foo() calls Bar(), which in turn calls // CurrentOsStackTraceExceptTop(1), Foo() will be included in the // trace but Bar() and CurrentOsStackTraceExceptTop() won't. - std::string CurrentOsStackTraceExceptTop(int skip_count) GTEST_NO_INLINE_; + std::string CurrentOsStackTraceExceptTop(int skip_count) + GTEST_NO_INLINE_ GTEST_NO_TAIL_CALL_; // Finds and returns a TestSuite with the given name. If one doesn't // exist, creates one and returns it. diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc index 04266dc..46c3e7f 100644 --- a/googletest/src/gtest.cc +++ b/googletest/src/gtest.cc @@ -6292,8 +6292,8 @@ void UnitTestImpl::UnshuffleTests() { // For example, if Foo() calls Bar(), which in turn calls // GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in // the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't. -std::string GetCurrentOsStackTraceExceptTop(UnitTest* /*unit_test*/, - int skip_count) { +GTEST_NO_INLINE_ GTEST_NO_TAIL_CALL_ std::string +GetCurrentOsStackTraceExceptTop(UnitTest* /*unit_test*/, int skip_count) { // We pass skip_count + 1 to skip this wrapper function in addition // to what the user really wants to skip. return GetUnitTestImpl()->CurrentOsStackTraceExceptTop(skip_count + 1); |