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/include/llvm/Frontend/OpenMP/OMPContext.h | |
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/include/llvm/Frontend/OpenMP/OMPContext.h')
-rw-r--r-- | contrib/libs/llvm12/include/llvm/Frontend/OpenMP/OMPContext.h | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/contrib/libs/llvm12/include/llvm/Frontend/OpenMP/OMPContext.h b/contrib/libs/llvm12/include/llvm/Frontend/OpenMP/OMPContext.h index 4031468da9..a707fc7d72 100644 --- a/contrib/libs/llvm12/include/llvm/Frontend/OpenMP/OMPContext.h +++ b/contrib/libs/llvm12/include/llvm/Frontend/OpenMP/OMPContext.h @@ -77,20 +77,20 @@ TraitSelector getOpenMPContextTraitSelectorForProperty(TraitProperty Property); /// Return a textual representation of the trait selector \p Kind. StringRef getOpenMPContextTraitSelectorName(TraitSelector Kind); -/// Parse \p Str and return the trait property it matches in the set \p Set and -/// selector \p Selector or TraitProperty::invalid. -TraitProperty getOpenMPContextTraitPropertyKind(TraitSet Set, - TraitSelector Selector, - StringRef Str); +/// Parse \p Str and return the trait property it matches in the set \p Set and +/// selector \p Selector or TraitProperty::invalid. +TraitProperty getOpenMPContextTraitPropertyKind(TraitSet Set, + TraitSelector Selector, + StringRef Str); /// Return the trait property for a singleton selector \p Selector. TraitProperty getOpenMPContextTraitPropertyForSelector(TraitSelector Selector); -/// Return a textual representation of the trait property \p Kind, which might -/// be the raw string we parsed (\p RawString) if we do not translate the -/// property into a (distinct) enum. -StringRef getOpenMPContextTraitPropertyName(TraitProperty Kind, - StringRef RawString); +/// Return a textual representation of the trait property \p Kind, which might +/// be the raw string we parsed (\p RawString) if we do not translate the +/// property into a (distinct) enum. +StringRef getOpenMPContextTraitPropertyName(TraitProperty Kind, + StringRef RawString); /// Return a textual representation of the trait property \p Kind with selector /// and set name included. @@ -124,36 +124,36 @@ bool isValidTraitPropertyForTraitSetAndSelector(TraitProperty Property, /// scored (via the ScoresMap). In addition, the required consturct nesting is /// decribed as well. struct VariantMatchInfo { - /// Add the trait \p Property to the required trait set. \p RawString is the - /// string we parsed and derived \p Property from. If \p Score is not null, it - /// recorded as well. If \p Property is in the `construct` set it is recorded - /// in-order in the ConstructTraits as well. - void addTrait(TraitProperty Property, StringRef RawString, - APInt *Score = nullptr) { - addTrait(getOpenMPContextTraitSetForProperty(Property), Property, RawString, - Score); + /// Add the trait \p Property to the required trait set. \p RawString is the + /// string we parsed and derived \p Property from. If \p Score is not null, it + /// recorded as well. If \p Property is in the `construct` set it is recorded + /// in-order in the ConstructTraits as well. + void addTrait(TraitProperty Property, StringRef RawString, + APInt *Score = nullptr) { + addTrait(getOpenMPContextTraitSetForProperty(Property), Property, RawString, + Score); } /// Add the trait \p Property which is in set \p Set to the required trait - /// set. \p RawString is the string we parsed and derived \p Property from. If - /// \p Score is not null, it recorded as well. If \p Set is the `construct` - /// set it is recorded in-order in the ConstructTraits as well. - void addTrait(TraitSet Set, TraitProperty Property, StringRef RawString, - APInt *Score = nullptr) { + /// set. \p RawString is the string we parsed and derived \p Property from. If + /// \p Score is not null, it recorded as well. If \p Set is the `construct` + /// set it is recorded in-order in the ConstructTraits as well. + void addTrait(TraitSet Set, TraitProperty Property, StringRef RawString, + APInt *Score = nullptr) { if (Score) ScoreMap[Property] = *Score; - - // Special handling for `device={isa(...)}` as we do not match the enum but - // the raw string. - if (Property == TraitProperty::device_isa___ANY) - ISATraits.push_back(RawString); - + + // Special handling for `device={isa(...)}` as we do not match the enum but + // the raw string. + if (Property == TraitProperty::device_isa___ANY) + ISATraits.push_back(RawString); + RequiredTraits.set(unsigned(Property)); if (Set == TraitSet::construct) ConstructTraits.push_back(Property); } BitVector RequiredTraits = BitVector(unsigned(TraitProperty::Last) + 1); - SmallVector<StringRef, 8> ISATraits; + SmallVector<StringRef, 8> ISATraits; SmallVector<TraitProperty, 8> ConstructTraits; SmallDenseMap<TraitProperty, APInt> ScoreMap; }; @@ -163,7 +163,7 @@ struct VariantMatchInfo { /// in OpenMP constructs at the location. struct OMPContext { OMPContext(bool IsDeviceCompilation, Triple TargetTriple); - virtual ~OMPContext() = default; + virtual ~OMPContext() = default; void addTrait(TraitProperty Property) { addTrait(getOpenMPContextTraitSetForProperty(Property), Property); @@ -174,11 +174,11 @@ struct OMPContext { ConstructTraits.push_back(Property); } - /// Hook for users to check if an ISA trait matches. The trait is described as - /// the string that got parsed and it depends on the target and context if - /// this matches or not. - virtual bool matchesISATrait(StringRef) const { return false; } - + /// Hook for users to check if an ISA trait matches. The trait is described as + /// the string that got parsed and it depends on the target and context if + /// this matches or not. + virtual bool matchesISATrait(StringRef) const { return false; } + BitVector ActiveTraits = BitVector(unsigned(TraitProperty::Last) + 1); SmallVector<TraitProperty, 8> ConstructTraits; }; |