summaryrefslogtreecommitdiffstats
path: root/lld/ELF/Strings.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge {COFF,ELF}/Strings.cpp to Common/Strings.cpp.Rui Ueyama2018-02-281-75/+0
| | | | | | | | | This should resolve the issue that lld build fails in some hosts that uses case-insensitive file system. Differential Revision: https://reviews.llvm.org/D43788 llvm-svn: 326339
* Factor out common code to Common/Strings.cpp.Rui Ueyama2017-11-281-4/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D40530 llvm-svn: 319138
* [ELF] - Update after LLVM r314883 change. NFC.George Rimar2017-10-041-1/+0
| | | | llvm-svn: 314884
* Move new lld's code to Common subdirectory.Rui Ueyama2017-10-021-1/+1
| | | | | | | | | | New lld's files are spread under lib subdirectory, and it isn't easy to find which files are actually maintained. This patch moves maintained files to Common subdirectory. Differential Revision: https://reviews.llvm.org/D37645 llvm-svn: 314719
* [ELF] Prevent crash with binary inputs with non-ascii file namesJames Henderson2017-09-071-0/+1
| | | | | | | | | | | | | | If using --format=binary with an input file name that has one or more non-ascii characters in, LLD has undefined behaviour (it crashes on my Windows Debug build) when calling isalnum with these non-ascii characters. Instead, of calling std::isalnum, this patch uses an internal version that ignores the locale and checks a specific subset of characters. Reviewers: ruiu Differential Revision: https://reviews.llvm.org/D37331 llvm-svn: 312705
* [ELF] - Apply clang-format. NFC.George Rimar2017-07-181-2/+2
| | | | llvm-svn: 308297
* Move feature-specific functions out of Strings.cpp.Rui Ueyama2017-07-131-3/+0
| | | | | | | | Functions declared in Strings.h should provide generic string operations for the linker, but some of them are too specific to some features. This patch moves them to the location where they are used. llvm-svn: 307949
* Remove lld toStringRef function.Zachary Turner2017-06-141-4/+0
| | | | | | | I added the same function in llvm, so this is causing an ambiguous symbol. llvm-svn: 305412
* Simplify BinaryFile::parse and add comments.Rui Ueyama2017-04-271-0/+4
| | | | llvm-svn: 301514
* Use ArrayRef instead of `const std::vector`.Rui Ueyama2016-12-201-1/+1
| | | | llvm-svn: 290213
* Move GlobPattern class from LLD to llvm/Support.Rui Ueyama2016-12-201-25/+2
| | | | | | | | | | GlobPattern is a class to handle glob pattern matching. Currently only LLD is using that, but technically that feature is not specific to linkers, so in this patch I move that file to LLVM. Differential Revision: https://reviews.llvm.org/D27969 llvm-svn: 290212
* Make demangle() return None instead of "" if a given string is not a mangled ↵Rui Ueyama2016-12-071-3/+2
| | | | | | symbol. llvm-svn: 288993
* Introduce StringRefZ class to represent null-terminated strings.Rui Ueyama2016-11-291-0/+30
| | | | | | | | | | | | | | 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
* Define toString(const SymbolBody &) and remove maybeDemangle instead.Rui Ueyama2016-11-241-3/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D27065 llvm-svn: 287899
* Add [<chars>] to the glob matcher to eliminate use of llvm::Regex.Rui Ueyama2016-11-031-7/+32
| | | | | | | | | | | | | Previously, it didn't support the character class, so we couldn't eliminate the use fo llvm::Regex. Now that it is supported, we can remove compileGlobPattern, which converts a glob pattern to a regex. This patch contains optimization for exact/prefix/suffix matches. Differential Revision: https://reviews.llvm.org/D26284 llvm-svn: 285949
* Use globMatch() instead of llvm::regex in linker scriptsEugene Leviant2016-11-031-0/+12
| | | | | | | | | This can speed up lld up to 5 times when linking applications with large number of sections and using linker script. Differential revision: https://reviews.llvm.org/D26241 llvm-svn: 285895
* Define a helper function to demangle symbols.Rui Ueyama2016-10-261-0/+3
| | | | llvm-svn: 285219
* Move a utility function to Strings.cpp.Rui Ueyama2016-10-131-0/+6
| | | | | | So that we can use the function from anywhere. llvm-svn: 284092
* Fix old copy-n-paste errors.Rui Ueyama2016-09-151-2/+2
| | | | llvm-svn: 281671
* [ELF] - Linkerscript: implemented SORT_BY_INIT_PRIORITY.George Rimar2016-09-151-0/+1
| | | | | | | | | | | This is PR30386, SORT_BY_INIT_PRIORITY is a keyword can be used to sort sections by numerical value of the GCC init_priority attribute encoded in the section name. Differential revision: https://reviews.llvm.org/D24611 llvm-svn: 281646
* Recommit [ELF] - Versionscript: do not treat non-wildcarded names as wildcards.George Rimar2016-09-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed code that was not checked before on windows for me, because of testcases that are disabled on that platform atm. Inital commit message: "[ELF] - Versionscript: do not treat non-wildcarded names as wildcards." Previously we incorrectly handled cases when symbol name in extern c++ tag was enclosed in quotes. Next case was treated as wildcard: GLIBCXX_3.4 { extern "C++" { "aaa*" } But it should have not. Quotes around aaa here means that we should have do exact name matching. That is PR30268 which has name with pointer is interpreted as wildcard by lld: extern "C++" { "operator delete[](void*)"; Patch fixes the issue. Differential revision: https://reviews.llvm.org/D24229 llvm-svn: 281049
* [ELF] - Use std::regex instead of hand written logic in elf::globMatch()George Rimar2016-09-021-1/+3
| | | | | | | | | | Use std::regex instead of hand written matcher. Patch based on code and ideas of Rui Ueyama. Differential revision: https://reviews.llvm.org/D23829 llvm-svn: 280544
* Move demangle() from Symbols.cpp to Strings.cpp.Rui Ueyama2016-07-071-0/+5
| | | | | | | | | | | | Symbols.cpp contains functions to handle ELF symbols. demangle() function is essentially a function to work on a string rather than on an ELF symbol. So Strings.cpp is a better place to put that function. This change also make demangle to demangle symbols unconditionally. Previously, it demangled symbols only when Config->Demangle is true. llvm-svn: 274804
* Move isValidCIdentifier to Strings.cpp.Rui Ueyama2016-06-291-0/+1
| | | | llvm-svn: 274112
* Create Strings.cpp and move string manipulation functions to that file.Rui Ueyama2016-06-291-0/+23
llvm-svn: 274109
OpenPOWER on IntegriCloud