Compare two option name (or prefix) strings for sorting.

Synopsis

Declared in <llvm/Support/OptionStrCmp.h>

int
StrCmpOptionName(
    StringRef A,
    StringRef B,
    bool FallbackCaseSensitive = true);

Description

The ordering is almost case‐insensitive lexicographic, with an exception. 0 comes at the end of the alphabet instead of the beginning (thus options precede any other options which prefix them). Additionally, if two options are identical ignoring case, they are ordered according to case‐sensitive ordering if FallbackCaseSensitive is true.

Return Value

Negative if A sorts before B, positive if after, and zero if equal under the rules above.

Parameters

Name

Description

A

First option name or prefix string.

B

Second option name or prefix string.

FallbackCaseSensitive

When true and the strings compare equal ignoring case, fall back to a case‐sensitive comparison.

Created with MrDocs