[OpenMP][NFC] Open `llvm` and `llvm::omp` namespace in OpenMPClause.cpp
authorJohannes Doerfert <johannes@jdoerfert.de>
Thu, 26 Mar 2020 00:33:48 +0000 (19:33 -0500)
committerJohannes Doerfert <johannes@jdoerfert.de>
Fri, 27 Mar 2020 07:30:57 +0000 (02:30 -0500)
clang/lib/AST/OpenMPClause.cpp

index fc7912d..dc74a95 100644 (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 << ")";