[OpenMP][NFC] Open `llvm` and `llvm::omp` namespace in OpenMPClause.cpp

This commit is contained in:
Johannes Doerfert 2020-03-25 19:33:48 -05:00
parent 56d1553dd2
commit b29322435a
1 changed files with 15 additions and 13 deletions

View File

@ -24,6 +24,8 @@
#include <cassert>
using namespace clang;
using namespace llvm;
using namespace omp;
OMPClause::child_range OMPClause::children() {
switch (getClauseKind()) {
@ -1296,7 +1298,7 @@ OMPExclusiveClause *OMPExclusiveClause::CreateEmpty(const ASTContext &C,
void OMPClausePrinter::VisitOMPIfClause(OMPIfClause *Node) {
OS << "if(";
if (Node->getNameModifier() != llvm::omp::OMPD_unknown)
if (Node->getNameModifier() != OMPD_unknown)
OS << getOpenMPDirectiveName(Node->getNameModifier()) << ": ";
Node->getCondition()->printPretty(OS, nullptr, Policy, 0);
OS << ")";
@ -1867,24 +1869,24 @@ void OMPClausePrinter::VisitOMPExclusiveClause(OMPExclusiveClause *Node) {
}
void OMPTraitInfo::getAsVariantMatchInfo(
ASTContext &ASTCtx, llvm::omp::VariantMatchInfo &VMI) const {
ASTContext &ASTCtx, VariantMatchInfo &VMI) const {
for (const OMPTraitSet &Set : Sets) {
for (const OMPTraitSelector &Selector : Set.Selectors) {
// User conditions are special as we evaluate the condition here.
if (Selector.Kind == llvm::omp::TraitSelector::user_condition) {
if (Selector.Kind == TraitSelector::user_condition) {
assert(Selector.ScoreOrCondition &&
"Ill-formed user condition, expected condition expression!");
assert(Selector.Properties.size() == 1 &&
Selector.Properties.front().Kind ==
llvm::omp::TraitProperty::user_condition_unknown &&
TraitProperty::user_condition_unknown &&
"Ill-formed user condition, expected unknown trait property!");
llvm::APInt CondVal =
Selector.ScoreOrCondition->EvaluateKnownConstInt(ASTCtx);
VMI.addTrait(CondVal.isNullValue()
? llvm::omp::TraitProperty::user_condition_false
: llvm::omp::TraitProperty::user_condition_true);
? TraitProperty::user_condition_false
: TraitProperty::user_condition_true);
continue;
}
@ -1897,13 +1899,13 @@ void OMPTraitInfo::getAsVariantMatchInfo(
for (const OMPTraitProperty &Property : Selector.Properties)
VMI.addTrait(Set.Kind, Property.Kind, ScorePtr);
if (Set.Kind != llvm::omp::TraitSet::construct)
if (Set.Kind != TraitSet::construct)
continue;
// TODO: This might not hold once we implement SIMD properly.
assert(Selector.Properties.size() == 1 &&
Selector.Properties.front().Kind ==
llvm::omp::getOpenMPContextTraitPropertyForSelector(
getOpenMPContextTraitPropertyForSelector(
Selector.Kind) &&
"Ill-formed construct selector!");
@ -1919,25 +1921,25 @@ void OMPTraitInfo::print(llvm::raw_ostream &OS,
if (!FirstSet)
OS << ", ";
FirstSet = false;
OS << llvm::omp::getOpenMPContextTraitSetName(Set.Kind) << "={";
OS << getOpenMPContextTraitSetName(Set.Kind) << "={";
bool FirstSelector = true;
for (const OMPTraitInfo::OMPTraitSelector &Selector : Set.Selectors) {
if (!FirstSelector)
OS << ", ";
FirstSelector = false;
OS << llvm::omp::getOpenMPContextTraitSelectorName(Selector.Kind);
OS << getOpenMPContextTraitSelectorName(Selector.Kind);
bool AllowsTraitScore = false;
bool RequiresProperty = false;
llvm::omp::isValidTraitSelectorForTraitSet(
isValidTraitSelectorForTraitSet(
Selector.Kind, Set.Kind, AllowsTraitScore, RequiresProperty);
if (!RequiresProperty)
continue;
OS << "(";
if (Selector.Kind == llvm::omp::TraitSelector::user_condition) {
if (Selector.Kind == TraitSelector::user_condition) {
Selector.ScoreOrCondition->printPretty(OS, nullptr, Policy);
} else {
@ -1953,7 +1955,7 @@ void OMPTraitInfo::print(llvm::raw_ostream &OS,
if (!FirstProperty)
OS << ", ";
FirstProperty = false;
OS << llvm::omp::getOpenMPContextTraitPropertyName(Property.Kind);
OS << getOpenMPContextTraitPropertyName(Property.Kind);
}
}
OS << ")";