summaryrefslogtreecommitdiffstats
path: root/llvm/utils/unittest/googletest/src
diff options
context:
space:
mode:
authorJuergen Ributzka <juergen@apple.com>2013-11-19 00:57:56 +0000
committerJuergen Ributzka <juergen@apple.com>2013-11-19 00:57:56 +0000
commitd12ccbd3434135bf4dce0d3bd9d0ac1943b20183 (patch)
treef3fa6b788d2ec312bcca95ab1aa7fe8148c99ce1 /llvm/utils/unittest/googletest/src
parent3af14421f2d8af2da639c7316bd90b5e397cef33 (diff)
downloadbcm5719-llvm-d12ccbd3434135bf4dce0d3bd9d0ac1943b20183.tar.gz
bcm5719-llvm-d12ccbd3434135bf4dce0d3bd9d0ac1943b20183.zip
[weak vtables] Remove a bunch of weak vtables
This patch removes most of the trivial cases of weak vtables by pinning them to a single object file. The memory leaks in this version have been fixed. Thanks Alexey for pointing them out. Differential Revision: http://llvm-reviews.chandlerc.com/D2068 Reviewed by Andy llvm-svn: 195064
Diffstat (limited to 'llvm/utils/unittest/googletest/src')
-rw-r--r--llvm/utils/unittest/googletest/src/gtest-death-test.cc6
-rw-r--r--llvm/utils/unittest/googletest/src/gtest-internal-inl.h2
-rw-r--r--llvm/utils/unittest/googletest/src/gtest-port.cc14
-rw-r--r--llvm/utils/unittest/googletest/src/gtest.cc10
4 files changed, 31 insertions, 1 deletions
diff --git a/llvm/utils/unittest/googletest/src/gtest-death-test.cc b/llvm/utils/unittest/googletest/src/gtest-death-test.cc
index 82453f20fd5..314dba2116e 100644
--- a/llvm/utils/unittest/googletest/src/gtest-death-test.cc
+++ b/llvm/utils/unittest/googletest/src/gtest-death-test.cc
@@ -300,6 +300,9 @@ DeathTest::DeathTest() {
}
}
+// Pin the vtable to this file.
+DeathTest::~DeathTest() {}
+
// Creates and returns a death test by dispatching to the current
// death test factory.
bool DeathTest::Create(const char* statement, const RE* regex,
@@ -1091,6 +1094,9 @@ bool DefaultDeathTestFactory::Create(const char* statement, const RE* regex,
return true;
}
+// Pin the vtable to this file.
+DeathTestFactory::~DeathTestFactory() {}
+
// Splits a given string on a given delimiter, populating a given
// vector with the fields. GTEST_HAS_DEATH_TEST implies that we have
// ::std::string, so we can use it here.
diff --git a/llvm/utils/unittest/googletest/src/gtest-internal-inl.h b/llvm/utils/unittest/googletest/src/gtest-internal-inl.h
index 6554cfc07e6..1bae630127b 100644
--- a/llvm/utils/unittest/googletest/src/gtest-internal-inl.h
+++ b/llvm/utils/unittest/googletest/src/gtest-internal-inl.h
@@ -408,7 +408,7 @@ GTEST_API_ FilePath GetCurrentExecutableName();
class OsStackTraceGetterInterface {
public:
OsStackTraceGetterInterface() {}
- virtual ~OsStackTraceGetterInterface() {}
+ virtual ~OsStackTraceGetterInterface();
// Returns the current OS stack trace as a String. Parameters:
//
diff --git a/llvm/utils/unittest/googletest/src/gtest-port.cc b/llvm/utils/unittest/googletest/src/gtest-port.cc
index 745956247a6..94fc57f89b3 100644
--- a/llvm/utils/unittest/googletest/src/gtest-port.cc
+++ b/llvm/utils/unittest/googletest/src/gtest-port.cc
@@ -746,5 +746,19 @@ const char* StringFromGTestEnv(const char* flag, const char* default_value) {
return value == NULL ? default_value : value;
}
+// Pin the vtables to this file.
+#if GTEST_HAS_PTHREAD
+ThreadWithParamBase::~ThreadWithParamBase() {}
+ThreadLocalValueHolderBase::~ThreadLocalValueHolderBase() {}
+#endif
+TestFactoryBase::~TestFactoryBase() {}
+
} // namespace internal
} // namespace testing
+
+// Pin the vtable to this file.
+#if !GTEST_NO_LLVM_RAW_OSTREAM
+namespace llvm {
+void convertible_fwd_ostream::anchor() {}
+}
+#endif
diff --git a/llvm/utils/unittest/googletest/src/gtest.cc b/llvm/utils/unittest/googletest/src/gtest.cc
index 9891928048a..bf850c6cd97 100644
--- a/llvm/utils/unittest/googletest/src/gtest.cc
+++ b/llvm/utils/unittest/googletest/src/gtest.cc
@@ -4863,4 +4863,14 @@ void InitGoogleTest(int* argc, wchar_t** argv) {
internal::InitGoogleTestImpl(argc, argv);
}
+// Pin the vtables to this file.
+Environment::~Environment() {}
+TestPartResultReporterInterface::~TestPartResultReporterInterface() {}
+TestEventListener::~TestEventListener() {}
+void EmptyTestEventListener::anchor() {}
+namespace internal {
+OsStackTraceGetterInterface::~OsStackTraceGetterInterface() {}
+ParameterizedTestCaseInfoBase::~ParameterizedTestCaseInfoBase() {}
+}
+
} // namespace testing
OpenPOWER on IntegriCloud