Skip to content

Commit 009d863

Browse files
committed
Address minor feedback part 2
1 parent 1c8f0fe commit 009d863

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
@@ -1197,12 +1197,16 @@ class OMPLoopRangeClause final
11971197
void setFirstLoc(SourceLocation Loc) { FirstLoc = Loc; }
11981198
void setCountLoc(SourceLocation Loc) { CountLoc = Loc; }
11991199

1200-
/// Get looprange arguments: first and count
1200+
/// Get looprange 'first' expression
12011201
Expr *getFirst() const { return getArgs()[0]; }
1202+
1203+
/// Get looprange 'count' expression
12021204
Expr *getCount() const { return getArgs()[1]; }
12031205

1204-
/// Set looprange arguments: first and count
1206+
/// Set looprange 'first' expression
12051207
void setFirst(Expr *E) { getArgs()[0] = E; }
1208+
1209+
/// Set looprange 'count' expression
12061210
void setCount(Expr *E) { getArgs()[1] = E; }
12071211

12081212
MutableArrayRef<Expr *> getArgs() {

clang/include/clang/AST/StmtOpenMP.h

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

977977
/// Set the number of loops generated by this loop transformation.
978978
void setNumGeneratedLoops(unsigned Num) { NumGeneratedLoops = Num; }
979+
979980
/// Set the number of top level canonical loop nests generated by this loop
980981
/// transformation
981982
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
@@ -11612,16 +11612,16 @@ def note_omp_implicit_dsa : Note<
1161211612
"implicitly determined as %0">;
1161311613
def err_omp_loop_var_dsa : Error<
1161411614
"loop iteration variable in the associated loop of 'omp %1' directive may not be %0, predetermined as %2">;
11615-
def err_omp_not_canonical_loop : Error <
11615+
def err_omp_not_canonical_loop : Error<
1161611616
"loop after '#pragma omp %0' is not in canonical form">;
11617-
def err_omp_not_a_loop_sequence : Error <
11617+
def err_omp_not_a_loop_sequence : Error<
1161811618
"statement after '#pragma omp %0' must be a loop sequence containing canonical loops or loop-generating constructs">;
11619-
def err_omp_empty_loop_sequence : Error <
11619+
def err_omp_empty_loop_sequence : Error<
1162011620
"loop sequence after '#pragma omp %0' must contain at least 1 canonical loop or loop-generating construct">;
11621-
def err_omp_invalid_looprange : Error <
11621+
def err_omp_invalid_looprange : Error<
1162211622
"loop range in '#pragma omp %0' exceeds the number of available loops: "
1162311623
"range end '%1' is greater than the total number of loops '%2'">;
11624-
def warn_omp_redundant_fusion : Warning <
11624+
def warn_omp_redundant_fusion : Warning<
1162511625
"loop range in '#pragma omp %0' contains only a single loop, resulting in redundant fusion">,
1162611626
InGroup<OpenMPClauses>;
1162711627
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;
@@ -14201,7 +14199,6 @@ template <typename T, typename F> static bool tryHandleAs(T *t, F &&) {
1420114199
return false;
1420214200
}
1420314201

14204-
///
1420514202
/// Tries to recursively cast `t` to one of the given types and invokes `f` if
1420614203
/// successful.
1420714204
///
@@ -14274,7 +14271,7 @@ bool SemaOpenMP::checkTransformableLoopNest(
1427414271

1427514272
/// Counts the total number of nested loops, including the outermost loop (the
1427614273
/// original loop). PRECONDITION of this visitor is that it must be invoked from
14277-
/// the original loop to be analyzed. The traversal is stop for Decl's and
14274+
/// the original loop to be analyzed. The traversal stops for Decl's and
1427814275
/// Expr's given that they may contain inner loops that must not be counted.
1427914276
///
1428014277
/// Example AST structure for the code:
@@ -15945,7 +15942,7 @@ StmtResult SemaOpenMP::ActOnOpenMPFuseDirective(ArrayRef<OMPClause *> Clauses,
1594515942

1594615943
// Select the type with the largest bit width among all induction variables
1594715944
QualType IVType = LoopHelpers[FirstVal - 1].IterationVarRef->getType();
15948-
for (unsigned int I = FirstVal; I < LastVal; ++I) {
15945+
for (unsigned I = FirstVal; I < LastVal; ++I) {
1594915946
QualType CurrentIVType = LoopHelpers[I].IterationVarRef->getType();
1595015947
if (Context.getTypeSize(CurrentIVType) > Context.getTypeSize(IVType)) {
1595115948
IVType = CurrentIVType;
@@ -16054,9 +16051,8 @@ StmtResult SemaOpenMP::ActOnOpenMPFuseDirective(ArrayRef<OMPClause *> Clauses,
1605416051
auto [IVVD, IVDStmt] =
1605516052
CreateHelperVarAndStmt(LoopHelpers[I].IterationVarRef, "iv", J);
1605616053

16057-
if (!LBVD || !STVD || !NIVD || !IVVD)
16058-
assert(LBVD && STVD && NIVD && IVVD &&
16059-
"OpenMP Fuse Helper variables creation failed");
16054+
assert(LBVD && STVD && NIVD && IVVD &&
16055+
"OpenMP Fuse Helper variables creation failed");
1606016056

1606116057
UBVarDecls.push_back(UBVD);
1606216058
LBVarDecls.push_back(LBVD);
@@ -16097,11 +16093,10 @@ StmtResult SemaOpenMP::ActOnOpenMPFuseDirective(ArrayRef<OMPClause *> Clauses,
1609716093
// original.indexk = ivk
1609816094
// body(k); Expr *InitVal = IntegerLiteral::Create(Context,
1609916095
// llvm::APInt(IVWidth, 0),
16100-
1610116096
// }
1610216097

1610316098
// 1. Create the initialized fuse index
16104-
const std::string IndexName = Twine(".omp.fuse.index").str();
16099+
StringRef IndexName = ".omp.fuse.index";
1610516100
Expr *InitVal = IntegerLiteral::Create(Context, llvm::APInt(IVBitWidth, 0),
1610616101
IVType, SourceLocation());
1610716102
VarDecl *IndexDecl =

0 commit comments

Comments
 (0)