Skip to content

Commit 470ce34

Browse files
eZWALTrofirrim
authored andcommitted
Address minor feedback part 2
1 parent a1743a4 commit 470ce34

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

clang/include/clang/AST/OpenMPClause.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,12 +1203,16 @@ class OMPLoopRangeClause final
12031203
void setFirstLoc(SourceLocation Loc) { FirstLoc = Loc; }
12041204
void setCountLoc(SourceLocation Loc) { CountLoc = Loc; }
12051205

1206-
/// Get looprange arguments: first and count
1206+
/// Get looprange 'first' expression
12071207
Expr *getFirst() const { return getArgs()[0]; }
1208+
1209+
/// Get looprange 'count' expression
12081210
Expr *getCount() const { return getArgs()[1]; }
12091211

1210-
/// Set looprange arguments: first and count
1212+
/// Set looprange 'first' expression
12111213
void setFirst(Expr *E) { getArgs()[0] = E; }
1214+
1215+
/// Set looprange 'count' expression
12121216
void setCount(Expr *E) { getArgs()[1] = E; }
12131217

12141218
MutableArrayRef<Expr *> getArgs() {

clang/include/clang/AST/StmtOpenMP.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -975,6 +975,7 @@ class OMPLoopTransformationDirective : public OMPLoopBasedDirective {
975975

976976
/// Set the number of loops generated by this loop transformation.
977977
void setNumGeneratedLoops(unsigned Num) { NumGeneratedLoops = Num; }
978+
978979
/// Set the number of top level canonical loop nests generated by this loop
979980
/// transformation
980981
void setNumGeneratedLoopNests(unsigned Num) { NumGeneratedLoopNests = Num; }

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11664,16 +11664,16 @@ def note_omp_implicit_dsa : Note<
1166411664
"implicitly determined as %0">;
1166511665
def err_omp_loop_var_dsa : Error<
1166611666
"loop iteration variable in the associated loop of 'omp %1' directive may not be %0, predetermined as %2">;
11667-
def err_omp_not_canonical_loop : Error <
11667+
def err_omp_not_canonical_loop : Error<
1166811668
"loop after '#pragma omp %0' is not in canonical form">;
11669-
def err_omp_not_a_loop_sequence : Error <
11669+
def err_omp_not_a_loop_sequence : Error<
1167011670
"statement after '#pragma omp %0' must be a loop sequence containing canonical loops or loop-generating constructs">;
11671-
def err_omp_empty_loop_sequence : Error <
11671+
def err_omp_empty_loop_sequence : Error<
1167211672
"loop sequence after '#pragma omp %0' must contain at least 1 canonical loop or loop-generating construct">;
11673-
def err_omp_invalid_looprange : Error <
11673+
def err_omp_invalid_looprange : Error<
1167411674
"loop range in '#pragma omp %0' exceeds the number of available loops: "
1167511675
"range end '%1' is greater than the total number of loops '%2'">;
11676-
def warn_omp_redundant_fusion : Warning <
11676+
def warn_omp_redundant_fusion : Warning<
1167711677
"loop range in '#pragma omp %0' contains only a single loop, resulting in redundant fusion">,
1167811678
InGroup<OpenMPClauses>;
1167911679
def err_omp_not_for : Error<

clang/lib/Sema/SemaOpenMP.cpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include "clang/AST/DeclOpenMP.h"
2323
#include "clang/AST/DynamicRecursiveASTVisitor.h"
2424
#include "clang/AST/OpenMPClause.h"
25-
#include "clang/AST/RecursiveASTVisitor.h"
2625
#include "clang/AST/StmtCXX.h"
2726
#include "clang/AST/StmtOpenMP.h"
2827
#include "clang/AST/StmtVisitor.h"
@@ -48,7 +47,6 @@
4847
#include "llvm/Frontend/OpenMP/OMPConstants.h"
4948
#include "llvm/IR/Assumptions.h"
5049
#include <optional>
51-
#include <queue>
5250

5351
using namespace clang;
5452
using namespace llvm::omp;
@@ -14218,7 +14216,6 @@ template <typename T, typename F> static bool tryHandleAs(T *t, F &&) {
1421814216
return false;
1421914217
}
1422014218

14221-
///
1422214219
/// Tries to recursively cast `t` to one of the given types and invokes `f` if
1422314220
/// successful.
1422414221
///
@@ -14291,7 +14288,7 @@ bool SemaOpenMP::checkTransformableLoopNest(
1429114288

1429214289
/// Counts the total number of nested loops, including the outermost loop (the
1429314290
/// original loop). PRECONDITION of this visitor is that it must be invoked from
14294-
/// the original loop to be analyzed. The traversal is stop for Decl's and
14291+
/// the original loop to be analyzed. The traversal stops for Decl's and
1429514292
/// Expr's given that they may contain inner loops that must not be counted.
1429614293
///
1429714294
/// Example AST structure for the code:
@@ -15962,7 +15959,7 @@ StmtResult SemaOpenMP::ActOnOpenMPFuseDirective(ArrayRef<OMPClause *> Clauses,
1596215959

1596315960
// Select the type with the largest bit width among all induction variables
1596415961
QualType IVType = LoopHelpers[FirstVal - 1].IterationVarRef->getType();
15965-
for (unsigned int I = FirstVal; I < LastVal; ++I) {
15962+
for (unsigned I = FirstVal; I < LastVal; ++I) {
1596615963
QualType CurrentIVType = LoopHelpers[I].IterationVarRef->getType();
1596715964
if (Context.getTypeSize(CurrentIVType) > Context.getTypeSize(IVType)) {
1596815965
IVType = CurrentIVType;
@@ -16071,9 +16068,8 @@ StmtResult SemaOpenMP::ActOnOpenMPFuseDirective(ArrayRef<OMPClause *> Clauses,
1607116068
auto [IVVD, IVDStmt] =
1607216069
CreateHelperVarAndStmt(LoopHelpers[I].IterationVarRef, "iv", J);
1607316070

16074-
if (!LBVD || !STVD || !NIVD || !IVVD)
16075-
assert(LBVD && STVD && NIVD && IVVD &&
16076-
"OpenMP Fuse Helper variables creation failed");
16071+
assert(LBVD && STVD && NIVD && IVVD &&
16072+
"OpenMP Fuse Helper variables creation failed");
1607716073

1607816074
UBVarDecls.push_back(UBVD);
1607916075
LBVarDecls.push_back(LBVD);
@@ -16114,11 +16110,10 @@ StmtResult SemaOpenMP::ActOnOpenMPFuseDirective(ArrayRef<OMPClause *> Clauses,
1611416110
// original.indexk = ivk
1611516111
// body(k); Expr *InitVal = IntegerLiteral::Create(Context,
1611616112
// llvm::APInt(IVWidth, 0),
16117-
1611816113
// }
1611916114

1612016115
// 1. Create the initialized fuse index
16121-
const std::string IndexName = Twine(".omp.fuse.index").str();
16116+
StringRef IndexName = ".omp.fuse.index";
1612216117
Expr *InitVal = IntegerLiteral::Create(Context, llvm::APInt(IVBitWidth, 0),
1612316118
IVType, SourceLocation());
1612416119
VarDecl *IndexDecl =

0 commit comments

Comments
 (0)