Introduce StringRefZ class to represent null-terminated strings.
authorRui Ueyama <ruiu@google.com>
Tue, 29 Nov 2016 18:05:04 +0000 (18:05 +0000)
committerRui Ueyama <ruiu@google.com>
Tue, 29 Nov 2016 18:05:04 +0000 (18:05 +0000)
commita13efc2a73106ed35e6477e23d867e5d53909387
tree41696a891fc54f8e77971d8e8c2654cad975ed46
parentc62b64a9e867bc2aa8c9e29245628e4dd6de993c
Introduce StringRefZ class to represent null-terminated strings.

StringRefZ is a class to represent a null-terminated string. String
length is computed lazily, so it's more efficient than StringRef to
represent strings in string table.

The motivation of defining this new class is to merge functions
that only differ in string types; we have many constructors that takes
`const char *` or `StringRef`. With StringRefZ, we can merge them.

Differential Revision: https://reviews.llvm.org/D27037

llvm-svn: 288172
lld/ELF/InputFiles.cpp
lld/ELF/LTO.cpp
lld/ELF/Strings.cpp
lld/ELF/Strings.h
lld/ELF/SymbolTable.cpp
lld/ELF/SymbolTable.h
lld/ELF/Symbols.cpp
lld/ELF/Symbols.h