Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:44:33

0001 //===- OptionStrCmp.h - Option String Comparison ----------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLVM_SUPPORT_OPTIONSTRCMP_H
0010 #define LLVM_SUPPORT_OPTIONSTRCMP_H
0011 
0012 #include "llvm/ADT/ArrayRef.h"
0013 #include "llvm/ADT/StringRef.h"
0014 
0015 namespace llvm {
0016 
0017 // Comparison function for Option strings (option names & prefixes).
0018 // The ordering is *almost* case-insensitive lexicographic, with an exception.
0019 // '\0' comes at the end of the alphabet instead of the beginning (thus options
0020 // precede any other options which prefix them). Additionally, if two options
0021 // are identical ignoring case, they are ordered according to case sensitive
0022 // ordering if `FallbackCaseSensitive` is true.
0023 int StrCmpOptionName(StringRef A, StringRef B,
0024                      bool FallbackCaseSensitive = true);
0025 
0026 // Comparison function for Option prefixes.
0027 int StrCmpOptionPrefixes(ArrayRef<StringRef> APrefixes,
0028                          ArrayRef<StringRef> BPrefixes);
0029 
0030 } // namespace llvm
0031 
0032 #endif // LLVM_SUPPORT_OPTIONSTRCMP_H