LLVM: lib/Support/OptionStrCmp.cpp Source File (original) (raw)
Go to the documentation of this file.
1
2
3
4
5
6
7
8
11
12using namespace llvm;
13
14
15
16
17
18
19
21 bool FallbackCaseSensitive) {
22 size_t MinSize = std::min(A.size(), B.size());
23 if (int Res = A.substr(0, MinSize).compare_insensitive(B.substr(0, MinSize)))
24 return Res;
25
26
28 return FallbackCaseSensitive ? A.compare(B) : 0;
29
30 return (A.size() == MinSize) ? 1
31 : -1 ;
32}
33
34
37 for (const auto &[APre, BPre] : zip(APrefixes, BPrefixes)) {
39 return Cmp;
40 }
41
42 return 0;
43}
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
StringRef - Represent a constant reference to a string, i.e.
This is an optimization pass for GlobalISel generic memory operations.
detail::zippy< detail::zip_shortest, T, U, Args... > zip(T &&t, U &&u, Args &&...args)
zip iterator for two or more iteratable types.
int StrCmpOptionName(StringRef A, StringRef B, bool FallbackCaseSensitive=true)
Definition OptionStrCmp.cpp:20
int StrCmpOptionPrefixes(ArrayRef< StringRef > APrefixes, ArrayRef< StringRef > BPrefixes)
Definition OptionStrCmp.cpp:35