diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
commit | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch) | |
tree | 012bb94d777798f1f56ac1cec429509766d05181 /contrib/libs/llvm12/lib/IR/Assumptions.cpp | |
parent | 6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff) | |
download | ydb-2598ef1d0aee359b4b6d5fdd1758916d5907d04f.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/llvm12/lib/IR/Assumptions.cpp')
-rw-r--r-- | contrib/libs/llvm12/lib/IR/Assumptions.cpp | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/contrib/libs/llvm12/lib/IR/Assumptions.cpp b/contrib/libs/llvm12/lib/IR/Assumptions.cpp index 1bd8b7f51e..8e6ee41993 100644 --- a/contrib/libs/llvm12/lib/IR/Assumptions.cpp +++ b/contrib/libs/llvm12/lib/IR/Assumptions.cpp @@ -1,36 +1,36 @@ -//===- Assumptions.cpp ------ Collection of helpers for assumptions -------===// -// -// 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 -// -//===----------------------------------------------------------------------===// -// -//===----------------------------------------------------------------------===// - -#include "llvm/IR/Assumptions.h" -#include "llvm/IR/Attributes.h" -#include "llvm/IR/Function.h" - -using namespace llvm; - -bool llvm::hasAssumption(Function &F, - const KnownAssumptionString &AssumptionStr) { - const Attribute &A = F.getFnAttribute(AssumptionAttrKey); - if (!A.isValid()) - return false; - assert(A.isStringAttribute() && "Expected a string attribute!"); - - SmallVector<StringRef, 8> Strings; - A.getValueAsString().split(Strings, ","); - - return llvm::any_of(Strings, [=](StringRef Assumption) { - return Assumption == AssumptionStr; - }); -} - -StringSet<> llvm::KnownAssumptionStrings({ - "omp_no_openmp", // OpenMP 5.1 - "omp_no_openmp_routines", // OpenMP 5.1 - "omp_no_parallelism", // OpenMP 5.1 -}); +//===- Assumptions.cpp ------ Collection of helpers for assumptions -------===// +// +// 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 +// +//===----------------------------------------------------------------------===// +// +//===----------------------------------------------------------------------===// + +#include "llvm/IR/Assumptions.h" +#include "llvm/IR/Attributes.h" +#include "llvm/IR/Function.h" + +using namespace llvm; + +bool llvm::hasAssumption(Function &F, + const KnownAssumptionString &AssumptionStr) { + const Attribute &A = F.getFnAttribute(AssumptionAttrKey); + if (!A.isValid()) + return false; + assert(A.isStringAttribute() && "Expected a string attribute!"); + + SmallVector<StringRef, 8> Strings; + A.getValueAsString().split(Strings, ","); + + return llvm::any_of(Strings, [=](StringRef Assumption) { + return Assumption == AssumptionStr; + }); +} + +StringSet<> llvm::KnownAssumptionStrings({ + "omp_no_openmp", // OpenMP 5.1 + "omp_no_openmp_routines", // OpenMP 5.1 + "omp_no_parallelism", // OpenMP 5.1 +}); |