LLVM 20.0.0git
OptionStrCmp.h
Go to the documentation of this file.
1//===- OptionStrCmp.h - Option String Comparison ----------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_SUPPORT_OPTIONSTRCMP_H
10#define LLVM_SUPPORT_OPTIONSTRCMP_H
11
12#include "llvm/ADT/ArrayRef.h"
13#include "llvm/ADT/StringRef.h"
14
15namespace llvm {
16
17// Comparison function for Option strings (option names & prefixes).
18// The ordering is *almost* case-insensitive lexicographic, with an exception.
19// '\0' comes at the end of the alphabet instead of the beginning (thus options
20// precede any other options which prefix them). Additionally, if two options
21// are identical ignoring case, they are ordered according to case sensitive
22// ordering if `FallbackCaseSensitive` is true.
23int StrCmpOptionName(StringRef A, StringRef B,
24 bool FallbackCaseSensitive = true);
25
26// Comparison function for Option prefixes.
27int StrCmpOptionPrefixes(ArrayRef<StringRef> APrefixes,
28 ArrayRef<StringRef> BPrefixes);
29
30} // namespace llvm
31
32#endif // LLVM_SUPPORT_OPTIONSTRCMP_H
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
int StrCmpOptionName(StringRef A, StringRef B, bool FallbackCaseSensitive=true)
int StrCmpOptionPrefixes(ArrayRef< StringRef > APrefixes, ArrayRef< StringRef > BPrefixes)