diff options
author | Rui Ueyama <ruiu@google.com> | 2018-04-25 22:34:21 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2018-04-25 22:34:21 +0000 |
commit | 5fcebff4851aa942d82df428990acf5c8410cf25 (patch) | |
tree | 6dc05694024e19bdacc17aefb3621ac1ffa90b70 /lld/include/lld | |
parent | 76661e0f36bb200226102eb749e7b56ffbd69403 (diff) | |
download | bcm5719-llvm-5fcebff4851aa942d82df428990acf5c8410cf25.tar.gz bcm5719-llvm-5fcebff4851aa942d82df428990acf5c8410cf25.zip |
Remove unused features from StringRefZ and move it to Symbols.h.
Differential Revision: https://reviews.llvm.org/D46087
llvm-svn: 330879
Diffstat (limited to 'lld/include/lld')
-rw-r--r-- | lld/include/lld/Common/Strings.h | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/lld/include/lld/Common/Strings.h b/lld/include/lld/Common/Strings.h index 9b1469a3b82..177cc15449f 100644 --- a/lld/include/lld/Common/Strings.h +++ b/lld/include/lld/Common/Strings.h @@ -26,39 +26,6 @@ llvm::Optional<std::string> demangleMSVC(llvm::StringRef S); std::vector<uint8_t> parseHex(llvm::StringRef S); bool isValidCIdentifier(llvm::StringRef S); -// This is a lazy version of StringRef. String size is computed lazily -// when it is needed. It is more efficient than StringRef to instantiate -// if you have a string whose size is unknown. -// -// COFF and ELF string tables contain a lot of null-terminated strings. -// Most of them are not necessary for the linker because they are names -// of local symbols and the linker doesn't use local symbol names for -// name resolution. So, we use this class to represents strings read -// from string tables. -class StringRefZ { -public: - StringRefZ() : Start(nullptr), Size(0) {} - StringRefZ(const char *S, size_t Size) : Start(S), Size(Size) {} - - /*implicit*/ StringRefZ(const char *S) : Start(S), Size(-1) {} - - /*implicit*/ StringRefZ(llvm::StringRef S) - : Start(S.data()), Size(S.size()) {} - - const char *data() const { return Start; } - size_t rawSize() const { return Size; }; - - operator llvm::StringRef() const { - if (Size == (size_t)-1) - Size = strlen(Start); - return {Start, Size}; - } - -private: - const char *Start; - mutable size_t Size; -}; - // This class represents multiple glob patterns. class StringMatcher { public: |