[compiler-rt] 46f2fdb - [NFC][scudo] Move macro into a shared header
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 2 14:42:16 PDT 2021
Author: Vitaly Buka
Date: 2021-04-02T14:38:02-07:00
New Revision: 46f2fdb840d66c41a3ee751208f42529c185e29e
URL: https://github.com/llvm/llvm-project/commit/46f2fdb840d66c41a3ee751208f42529c185e29e
DIFF: https://github.com/llvm/llvm-project/commit/46f2fdb840d66c41a3ee751208f42529c185e29e.diff
LOG: [NFC][scudo] Move macro into a shared header
Added:
Modified:
compiler-rt/lib/scudo/standalone/tests/combined_test.cpp
compiler-rt/lib/scudo/standalone/tests/primary_test.cpp
compiler-rt/lib/scudo/standalone/tests/scudo_unit_test.h
Removed:
################################################################################
diff --git a/compiler-rt/lib/scudo/standalone/tests/combined_test.cpp b/compiler-rt/lib/scudo/standalone/tests/combined_test.cpp
index bbe304e697fb..7e334f54e370 100644
--- a/compiler-rt/lib/scudo/standalone/tests/combined_test.cpp
+++ b/compiler-rt/lib/scudo/standalone/tests/combined_test.cpp
@@ -76,20 +76,13 @@ template <typename Config> struct TestAllocator : scudo::Allocator<Config> {
~TestAllocator() { this->unmapTestOnly(); }
};
-namespace testing {
-namespace internal {
-#define SCUDO_DEFINE_GTEST_TYPE_NAME(TYPE) \
- template <> std::string GetTypeName<scudo::TYPE>() { return #TYPE; }
-SCUDO_DEFINE_GTEST_TYPE_NAME(AndroidSvelteConfig)
+SCUDO_DEFINE_GTEST_TYPE_NAME(scudo::AndroidSvelteConfig)
#if SCUDO_FUCHSIA
-SCUDO_DEFINE_GTEST_TYPE_NAME(FuchsiaConfig)
+SCUDO_DEFINE_GTEST_TYPE_NAME(scudo::FuchsiaConfig)
#else
-SCUDO_DEFINE_GTEST_TYPE_NAME(DefaultConfig)
-SCUDO_DEFINE_GTEST_TYPE_NAME(AndroidConfig)
+SCUDO_DEFINE_GTEST_TYPE_NAME(scudo::DefaultConfig)
+SCUDO_DEFINE_GTEST_TYPE_NAME(scudo::AndroidConfig)
#endif
-#undef SCUDO_DEFINE_GTEST_TYPE_NAME
-} // namespace internal
-} // namespace testing
template <class Config> struct ScudoCombinedTest : public ::testing::Test {
ScudoCombinedTest() {
diff --git a/compiler-rt/lib/scudo/standalone/tests/primary_test.cpp b/compiler-rt/lib/scudo/standalone/tests/primary_test.cpp
index 2707985b5c72..80fe1359e138 100644
--- a/compiler-rt/lib/scudo/standalone/tests/primary_test.cpp
+++ b/compiler-rt/lib/scudo/standalone/tests/primary_test.cpp
@@ -65,16 +65,9 @@ struct TestAllocator : public SizeClassAllocator<BaseConfig, SizeClassMapT> {
~TestAllocator() { this->unmapTestOnly(); }
};
-namespace testing {
-namespace internal {
-#define SCUDO_DEFINE_GTEST_TYPE_NAME(TYPE) \
- template <> std::string GetTypeName<TYPE>() { return #TYPE; }
SCUDO_DEFINE_GTEST_TYPE_NAME(TestConfig1)
SCUDO_DEFINE_GTEST_TYPE_NAME(TestConfig2)
SCUDO_DEFINE_GTEST_TYPE_NAME(TestConfig3)
-#undef SCUDO_DEFINE_GTEST_TYPE_NAME
-} // namespace internal
-} // namespace testing
template <class BaseConfig> struct ScudoPrimaryTest : public ::testing::Test {};
diff --git a/compiler-rt/lib/scudo/standalone/tests/scudo_unit_test.h b/compiler-rt/lib/scudo/standalone/tests/scudo_unit_test.h
index 22356c73a86b..f919599cc604 100644
--- a/compiler-rt/lib/scudo/standalone/tests/scudo_unit_test.h
+++ b/compiler-rt/lib/scudo/standalone/tests/scudo_unit_test.h
@@ -32,3 +32,8 @@
#endif
extern bool UseQuarantine;
+
+#define SCUDO_DEFINE_GTEST_TYPE_NAME(TYPE) \
+ template <> std::string testing::internal::GetTypeName<TYPE>() { \
+ return #TYPE; \
+ }
More information about the llvm-commits
mailing list