diff options
author | orivej <orivej@yandex-team.ru> | 2022-02-10 16:44:49 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:49 +0300 |
commit | 718c552901d703c502ccbefdfc3c9028d608b947 (patch) | |
tree | 46534a98bbefcd7b1f3faa5b52c138ab27db75b7 /contrib/libs/llvm12/include/llvm/Support/GlobPattern.h | |
parent | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (diff) | |
download | ydb-718c552901d703c502ccbefdfc3c9028d608b947.tar.gz |
Restoring authorship annotation for <orivej@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/llvm12/include/llvm/Support/GlobPattern.h')
-rw-r--r-- | contrib/libs/llvm12/include/llvm/Support/GlobPattern.h | 116 |
1 files changed, 58 insertions, 58 deletions
diff --git a/contrib/libs/llvm12/include/llvm/Support/GlobPattern.h b/contrib/libs/llvm12/include/llvm/Support/GlobPattern.h index 5e31bea143..8c39005b7a 100644 --- a/contrib/libs/llvm12/include/llvm/Support/GlobPattern.h +++ b/contrib/libs/llvm12/include/llvm/Support/GlobPattern.h @@ -1,43 +1,43 @@ -#pragma once - -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#endif - -//===-- GlobPattern.h - glob pattern matcher implementation -*- C++ -*-----===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -// -// This file implements a glob pattern matcher. The glob pattern is the -// rule used by the shell. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_SUPPORT_GLOB_PATTERN_H -#define LLVM_SUPPORT_GLOB_PATTERN_H - -#include "llvm/ADT/BitVector.h" -#include "llvm/ADT/Optional.h" -#include "llvm/Support/Error.h" -#include <vector> - -// This class represents a glob pattern. Supported metacharacters -// are "*", "?", "\", "[<chars>]", "[^<chars>]", and "[!<chars>]". -namespace llvm { - -template <typename T> class ArrayRef; -class StringRef; - -class GlobPattern { -public: - static Expected<GlobPattern> create(StringRef Pat); - bool match(StringRef S) const; - +#pragma once + +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif + +//===-- GlobPattern.h - glob pattern matcher implementation -*- C++ -*-----===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +// +// This file implements a glob pattern matcher. The glob pattern is the +// rule used by the shell. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_SUPPORT_GLOB_PATTERN_H +#define LLVM_SUPPORT_GLOB_PATTERN_H + +#include "llvm/ADT/BitVector.h" +#include "llvm/ADT/Optional.h" +#include "llvm/Support/Error.h" +#include <vector> + +// This class represents a glob pattern. Supported metacharacters +// are "*", "?", "\", "[<chars>]", "[^<chars>]", and "[!<chars>]". +namespace llvm { + +template <typename T> class ArrayRef; +class StringRef; + +class GlobPattern { +public: + static Expected<GlobPattern> create(StringRef Pat); + bool match(StringRef S) const; + // Returns true for glob pattern "*". Can be used to avoid expensive // preparation/acquisition of the input for match(). bool isTrivialMatchAll() const { @@ -48,21 +48,21 @@ public: return false; } -private: - bool matchOne(ArrayRef<BitVector> Pat, StringRef S) const; - - // Parsed glob pattern. - std::vector<BitVector> Tokens; - - // The following members are for optimization. - Optional<StringRef> Exact; - Optional<StringRef> Prefix; - Optional<StringRef> Suffix; -}; -} - -#endif // LLVM_SUPPORT_GLOB_PATTERN_H - -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif +private: + bool matchOne(ArrayRef<BitVector> Pat, StringRef S) const; + + // Parsed glob pattern. + std::vector<BitVector> Tokens; + + // The following members are for optimization. + Optional<StringRef> Exact; + Optional<StringRef> Prefix; + Optional<StringRef> Suffix; +}; +} + +#endif // LLVM_SUPPORT_GLOB_PATTERN_H + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif |