diff options
author | Sam McCall <sam.mccall@gmail.com> | 2019-08-21 13:31:44 +0000 |
---|---|---|
committer | Sam McCall <sam.mccall@gmail.com> | 2019-08-21 13:31:44 +0000 |
commit | e7c0356b69acd9e7b536c843c056db98f043961d (patch) | |
tree | b7ee73d0a6a7e881ba987eb82492792cea44bf06 /llvm/utils/unittest/googletest | |
parent | 34a04e703d9e19403b02c5e31f51db26c980bb45 (diff) | |
download | bcm5719-llvm-e7c0356b69acd9e7b536c843c056db98f043961d.tar.gz bcm5719-llvm-e7c0356b69acd9e7b536c843c056db98f043961d.zip |
Revert "[gtest] Fix printing of StringRef and SmallString in assert messages."
This reverts commit 4becb2ab4e9f52ce98272d1f5930d6942af5172b.
llvm-svn: 369525
Diffstat (limited to 'llvm/utils/unittest/googletest')
-rw-r--r-- | llvm/utils/unittest/googletest/include/gtest/internal/custom/gtest-printers.h | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/llvm/utils/unittest/googletest/include/gtest/internal/custom/gtest-printers.h b/llvm/utils/unittest/googletest/include/gtest/internal/custom/gtest-printers.h index da2b418525c..60c1ea050b6 100644 --- a/llvm/utils/unittest/googletest/include/gtest/internal/custom/gtest-printers.h +++ b/llvm/utils/unittest/googletest/include/gtest/internal/custom/gtest-printers.h @@ -39,33 +39,4 @@ #ifndef GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_ #define GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_ -#include "llvm/ADT/SmallString.h" -#include "llvm/ADT/StringRef.h" -#include <ostream> - -namespace llvm { - -// Printing of llvm String types. -// gtest sees these as containers of char (they have nested iterator types), -// so their operator<< is never considered unless we provide PrintTo(). -// PrintStringTo provides quotes and escaping, at the cost of a copy. - -inline void PrintTo(llvm::StringRef S, std::ostream *OS) { - *OS << ::testing::PrintToString(S.str()); -} -// We need both SmallString<N> and SmallVectorImpl<char> overloads: -// - the SmallString<N> template is needed as overload resolution will -// instantiate generic PrintTo<T> rather than do derived-to-base conversion -// - but SmallVectorImpl<char> is sometimes the actual static type, in code -// that erases the small size -template <unsigned N> -inline void PrintTo(const SmallString<N> &S, std::ostream *OS) { - *OS << ::testing::PrintToString(std::string(S.data(), S.size())); -} -inline void PrintTo(const SmallVectorImpl<char> &S, std::ostream *OS) { - *OS << ::testing::PrintToString(std::string(S.data(), S.size())); -} - -} // namespace llvm - #endif // GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_ |