1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 04:22:57 +02:00
llvm-mirror/include/llvm
Chandler Carruth e9c3d2d316 [ADT] Fix a confusing interface spec and some annoying peculiarities
with the StringRef::split method when used with a MaxSplit argument
other than '-1' (which nobody really does today, but which should
actually work).

The spec claimed both to split up to MaxSplit times, but also to append
<= MaxSplit strings to the vector. One of these doesn't make sense.
Given the name "MaxSplit", let's go with it being a max over how many
*splits* occur, which means the max on how many strings get appended is
MaxSplit+1. I'm not actually sure the implementation correctly provided
this logic either, as it used a really opaque loop structure.

The implementation was also playing weird games with nullptr in the data
field to try to rely on a totally opaque hidden property of the split
method that returns a pair. Nasty IMO.

Replace all of this with what is (IMO) simpler code that doesn't use the
pair returning split method, and instead just finds each separator and
appends directly. I think this is a lot easier to read, and it most
definitely matches the spec. Added some tests that exercise the corner
cases around StringRef() and StringRef("") that all now pass.

I'll start using this in code in the next commit.

llvm-svn: 247249
2015-09-10 07:51:37 +00:00
..
ADT [ADT] Fix a confusing interface spec and some annoying peculiarities 2015-09-10 07:51:37 +00:00
Analysis [PM/AA] Rebuild LLVM's alias analysis infrastructure in a way compatible 2015-09-09 17:55:00 +00:00
AsmParser AsmParser: Save and restore the parsing state for types using SlotMapping. 2015-08-21 21:32:39 +00:00
Bitcode Makes EmitRecord() accepting ArrayRef and raw array (NFC) 2015-09-10 01:45:55 +00:00
CodeGen Added isUndef() interface for SDNode 2015-09-10 06:33:13 +00:00
Config Temporarily revert r244012 while we see if it's really necessary. 2015-08-05 05:32:22 +00:00
DebugInfo -Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated in C++11 2015-08-05 20:20:29 +00:00
ExecutionEngine Revert r247216: "Fix Clang-tidy misc-use-override warnings, other minor fixes" 2015-09-10 00:57:26 +00:00
IR [LPM] Use a map from analysis ID to immutable passes in the legacy pass 2015-09-10 02:31:42 +00:00
IRReader Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
LibDriver LibDriver: Replace references to lld-link2 with lld-link. 2015-08-06 19:00:42 +00:00
LineEditor Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
Linker New bitcode linker flags: 2015-09-01 17:55:55 +00:00
LTO LTO: Cleanup parameter names and header docs, NFC 2015-08-31 23:44:06 +00:00
MC Sink COFF.h MC include into .cpp files 2015-09-03 16:41:50 +00:00
Object Pass a symbol table to getRelocationSymbol instead of returning one. 2015-09-02 15:07:39 +00:00
Option Add an ArgList::AddAllArgs that accepts a vector of OptSpecifier. 2015-07-29 17:34:41 +00:00
Passes Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
ProfileData Fix some comment typos. 2015-08-08 18:27:36 +00:00
Support Revert r247216: "Fix Clang-tidy misc-use-override warnings, other minor fixes" 2015-09-10 00:57:26 +00:00
TableGen Revert r247216: "Fix Clang-tidy misc-use-override warnings, other minor fixes" 2015-09-10 00:57:26 +00:00
Target [CodeGen] Make x86 nontemporal store patfrags generic. NFC. 2015-09-10 00:53:15 +00:00
Transforms [PM/AA] Rebuild LLVM's alias analysis infrastructure in a way compatible 2015-09-09 17:55:00 +00:00
CMakeLists.txt
InitializePasses.h [PM/AA] Rebuild LLVM's alias analysis infrastructure in a way compatible 2015-09-09 17:55:00 +00:00
LinkAllIR.h
LinkAllPasses.h [PM/AA] Rebuild LLVM's alias analysis infrastructure in a way compatible 2015-09-09 17:55:00 +00:00
module.modulemap Add Value.def to the list of textual includes, excluding it from the modules build. 2015-06-26 20:16:44 +00:00
module.modulemap.build
Pass.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
PassAnalysisSupport.h [LPM] Teach the legacy pass manager to support *using* an analysis 2015-08-19 03:02:12 +00:00
PassInfo.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
PassRegistry.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
PassSupport.h Support: Clean up TSan annotations. 2015-08-18 22:31:24 +00:00