Skip to content

Commit 6ba764a

Browse files
authored
[OpenMP] [NFC] SemaOpenMP.cpp and StmtOpenMP.cpp spelling fixes (#96814)
This patch just fixes a few spelling mistakes in the above two files. (I changed one British spelling to American -- analyse to analyze -- because the latter spelling is used elsewhere in file, and it's probably best to be consistent.)
1 parent 2c8b912 commit 6ba764a

File tree

5 files changed

+38
-38
lines changed

5 files changed

+38
-38
lines changed

clang/include/clang/AST/Expr.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ class Expr : public ValueStmt {
384384
bool isRValue() const { return Kind >= CL_XValue; }
385385
bool isModifiable() const { return getModifiable() == CM_Modifiable; }
386386

387-
/// Create a simple, modifiably lvalue
387+
/// Create a simple, modifiable lvalue
388388
static Classification makeSimpleLValue() {
389389
return Classification(CL_LValue, CM_Modifiable);
390390
}
@@ -1292,7 +1292,7 @@ class DeclRefExpr final
12921292

12931293
DeclRefExpr(const ASTContext &Ctx, NestedNameSpecifierLoc QualifierLoc,
12941294
SourceLocation TemplateKWLoc, ValueDecl *D,
1295-
bool RefersToEnlosingVariableOrCapture,
1295+
bool RefersToEnclosingVariableOrCapture,
12961296
const DeclarationNameInfo &NameInfo, NamedDecl *FoundD,
12971297
const TemplateArgumentListInfo *TemplateArgs, QualType T,
12981298
ExprValueKind VK, NonOdrUseReason NOUR);
@@ -1658,14 +1658,14 @@ class FloatingLiteral : public Expr, private APFloatStorage {
16581658
}
16591659

16601660
/// Get a raw enumeration value representing the floating-point semantics of
1661-
/// this literal (32-bit IEEE, x87, ...), suitable for serialisation.
1661+
/// this literal (32-bit IEEE, x87, ...), suitable for serialization.
16621662
llvm::APFloatBase::Semantics getRawSemantics() const {
16631663
return static_cast<llvm::APFloatBase::Semantics>(
16641664
FloatingLiteralBits.Semantics);
16651665
}
16661666

16671667
/// Set the raw enumeration value representing the floating-point semantics of
1668-
/// this literal (32-bit IEEE, x87, ...), suitable for serialisation.
1668+
/// this literal (32-bit IEEE, x87, ...), suitable for serialization.
16691669
void setRawSemantics(llvm::APFloatBase::Semantics Sem) {
16701670
FloatingLiteralBits.Semantics = Sem;
16711671
}
@@ -2130,7 +2130,7 @@ class SYCLUniqueStableNameExpr final : public Expr {
21302130
static std::string ComputeName(ASTContext &Context, QualType Ty);
21312131
};
21322132

2133-
/// ParenExpr - This represents a parethesized expression, e.g. "(1)". This
2133+
/// ParenExpr - This represents a parenthesized expression, e.g. "(1)". This
21342134
/// AST node is only formed if full location information is requested.
21352135
class ParenExpr : public Expr {
21362136
SourceLocation L, R;
@@ -2246,7 +2246,7 @@ class UnaryOperator final
22462246
bool canOverflow() const { return UnaryOperatorBits.CanOverflow; }
22472247
void setCanOverflow(bool C) { UnaryOperatorBits.CanOverflow = C; }
22482248

2249-
/// Get the FP contractability status of this operator. Only meaningful for
2249+
/// Get the FP contractibility status of this operator. Only meaningful for
22502250
/// operations on floating point types.
22512251
bool isFPContractableWithinStatement(const LangOptions &LO) const {
22522252
return getFPFeaturesInEffect(LO).allowFPContractWithinStatement();
@@ -4054,7 +4054,7 @@ class BinaryOperator : public Expr {
40544054
return FPOptionsOverride();
40554055
}
40564056

4057-
/// Get the FP contractability status of this operator. Only meaningful for
4057+
/// Get the FP contractibility status of this operator. Only meaningful for
40584058
/// operations on floating point types.
40594059
bool isFPContractableWithinStatement(const LangOptions &LO) const {
40604060
return getFPFeaturesInEffect(LO).allowFPContractWithinStatement();
@@ -4295,7 +4295,7 @@ class BinaryConditionalOperator : public AbstractConditionalOperator {
42954295
}
42964296

42974297
/// getFalseExpr - Return the subexpression which will be
4298-
/// evaluated if the condnition evaluates to false; this is
4298+
/// evaluated if the condition evaluates to false; this is
42994299
/// defined in terms of the opaque value.
43004300
Expr *getFalseExpr() const {
43014301
return cast<Expr>(SubExprs[RHS]);
@@ -6003,7 +6003,7 @@ class GenericSelectionExpr final
60036003
// if *It1 and *It2 are bound to the same objects.
60046004
// An alternative design approach was discussed during review;
60056005
// store an Association object inside the iterator, and return a reference
6006-
// to it when dereferenced. This idea was discarded beacuse of nasty
6006+
// to it when dereferenced. This idea was discarded because of nasty
60076007
// lifetime issues:
60086008
// AssociationIterator It = ...;
60096009
// const Association &Assoc = *It++; // Oops, Assoc is dangling.

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11117,7 +11117,7 @@ def err_omp_loop_variable_type : Error<
1111711117
def err_omp_loop_incr_not_compatible : Error<
1111811118
"increment expression must cause %0 to %select{decrease|increase}1 "
1111911119
"on each iteration of OpenMP for loop">;
11120-
def note_omp_loop_cond_requres_compatible_incr : Note<
11120+
def note_omp_loop_cond_requires_compatible_incr : Note<
1112111121
"loop step is expected to be %select{negative|positive}0 due to this condition">;
1112211122
def err_omp_loop_diff_cxx : Error<
1112311123
"could not calculate number of iterations calling 'operator-' with "

clang/lib/AST/StmtOpenMP.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88
//
9-
// This file implements the subclesses of Stmt class declared in StmtOpenMP.h
9+
// This file implements the subclasses of Stmt class declared in StmtOpenMP.h
1010
//
1111
//===----------------------------------------------------------------------===//
1212

clang/lib/CodeGen/CGStmtOpenMP.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ class OMPLoopScope : public CodeGenFunction::RunCleanupsScope {
193193
if (PreInits) {
194194
// CompoundStmts and DeclStmts are used as lists of PreInit statements and
195195
// declarations. Since declarations must be visible in the the following
196-
// that they initialize, unpack the ComboundStmt they are nested in.
196+
// that they initialize, unpack the CompoundStmt they are nested in.
197197
SmallVector<const Stmt *> PreInitStmts;
198198
if (auto *PreInitCompound = dyn_cast<CompoundStmt>(PreInits))
199199
llvm::append_range(PreInitStmts, PreInitCompound->body());
@@ -1411,7 +1411,7 @@ void CodeGenFunction::EmitOMPReductionClauseInit(
14111411
case OMPD_end_declare_variant:
14121412
case OMPD_unknown:
14131413
default:
1414-
llvm_unreachable("Enexpected directive with task reductions.");
1414+
llvm_unreachable("Unexpected directive with task reductions.");
14151415
}
14161416

14171417
const auto *VD = cast<VarDecl>(cast<DeclRefExpr>(TaskRedRef)->getDecl());
@@ -1766,7 +1766,7 @@ void CodeGenFunction::EmitOMPParallelDirective(const OMPParallelDirective &S) {
17661766

17671767
using InsertPointTy = llvm::OpenMPIRBuilder::InsertPointTy;
17681768

1769-
// The cleanup callback that finalizes all variabels at the given location,
1769+
// The cleanup callback that finalizes all variables at the given location,
17701770
// thus calls destructors etc.
17711771
auto FiniCB = [this](InsertPointTy IP) {
17721772
OMPBuilderCBHelpers::FinalizeOMPRegion(*this, IP);
@@ -6506,7 +6506,7 @@ static void emitOMPAtomicCompareExpr(
65066506
}
65076507

65086508
if (FailAO == llvm::AtomicOrdering::NotAtomic) {
6509-
// fail clause was not mentionend on the
6509+
// fail clause was not mentioned on the
65106510
// "#pragma omp atomic compare" construct.
65116511
CGF.Builder.restoreIP(OMPBuilder.createAtomicCompare(
65126512
CGF.Builder, XOpVal, VOpVal, ROpVal, EVal, DVal, AO, Op, IsXBinopExpr,
@@ -7920,7 +7920,7 @@ void CodeGenFunction::EmitOMPGenericLoopDirective(
79207920

79217921
void CodeGenFunction::EmitOMPParallelGenericLoopDirective(
79227922
const OMPLoopDirective &S) {
7923-
// Emit combined directive as if its consituent constructs are 'parallel'
7923+
// Emit combined directive as if its constituent constructs are 'parallel'
79247924
// and 'for'.
79257925
auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
79267926
Action.Enter(CGF);

clang/lib/Sema/SemaOpenMP.cpp

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ class DSAStackTy {
467467
getTopOfStack().PossiblyLoopCounter = D ? D->getCanonicalDecl() : D;
468468
}
469469
/// Gets the possible loop counter decl.
470-
const Decl *getPossiblyLoopCunter() const {
470+
const Decl *getPossiblyLoopCounter() const {
471471
return getTopOfStack().PossiblyLoopCounter;
472472
}
473473
/// Start new OpenMP region stack in new non-capturing function.
@@ -719,7 +719,7 @@ class DSAStackTy {
719719
TargetLocations.push_back(LocStart);
720720
}
721721

722-
/// Add location for the first encountered atomicc directive.
722+
/// Add location for the first encountered atomic directive.
723723
void addAtomicDirectiveLoc(SourceLocation Loc) {
724724
if (AtomicLocation.isInvalid())
725725
AtomicLocation = Loc;
@@ -2585,7 +2585,7 @@ OpenMPClauseKind SemaOpenMP::isOpenMPPrivateDecl(ValueDecl *D, unsigned Level,
25852585
DSAStack->loopStart();
25862586
return OMPC_private;
25872587
}
2588-
if ((DSAStack->getPossiblyLoopCunter() == D->getCanonicalDecl() ||
2588+
if ((DSAStack->getPossiblyLoopCounter() == D->getCanonicalDecl() ||
25892589
DSAStack->isLoopControlVariable(D).first) &&
25902590
!DSAStack->hasExplicitDSA(
25912591
D, [](OpenMPClauseKind K, bool) { return K != OMPC_private; },
@@ -2695,8 +2695,8 @@ bool SemaOpenMP::isOpenMPGlobalCapturedDecl(ValueDecl *D, unsigned Level,
26952695
unsigned NumLevels =
26962696
getOpenMPCaptureLevels(DSAStack->getDirective(Level));
26972697
if (Level == 0)
2698-
// non-file scope static variale with default(firstprivate)
2699-
// should be gloabal captured.
2698+
// non-file scope static variable with default(firstprivate)
2699+
// should be global captured.
27002700
return (NumLevels == CaptureLevel + 1 &&
27012701
(TopDVar.CKind != OMPC_shared ||
27022702
DSAStack->getDefaultDSA() == DSA_firstprivate));
@@ -2731,11 +2731,11 @@ void SemaOpenMP::finalizeOpenMPDelayedAnalysis(const FunctionDecl *Caller,
27312731
assert(getLangOpts().OpenMP && "Expected OpenMP compilation mode.");
27322732
std::optional<OMPDeclareTargetDeclAttr::DevTypeTy> DevTy =
27332733
OMPDeclareTargetDeclAttr::getDeviceType(Caller->getMostRecentDecl());
2734-
// Ignore host functions during device analyzis.
2734+
// Ignore host functions during device analysis.
27352735
if (getLangOpts().OpenMPIsTargetDevice &&
27362736
(!DevTy || *DevTy == OMPDeclareTargetDeclAttr::DT_Host))
27372737
return;
2738-
// Ignore nohost functions during host analyzis.
2738+
// Ignore nohost functions during host analysis.
27392739
if (!getLangOpts().OpenMPIsTargetDevice && DevTy &&
27402740
*DevTy == OMPDeclareTargetDeclAttr::DT_NoHost)
27412741
return;
@@ -3904,7 +3904,7 @@ class DSAAttrChecker final : public StmtVisitor<DSAAttrChecker, void> {
39043904
if (SemaRef.LangOpts.OpenMP >= 50)
39053905
return !StackComponents.empty();
39063906
// Variable is used if it has been marked as an array, array
3907-
// section, array shaping or the variable iself.
3907+
// section, array shaping or the variable itself.
39083908
return StackComponents.size() == 1 ||
39093909
llvm::all_of(
39103910
llvm::drop_begin(llvm::reverse(StackComponents)),
@@ -5783,7 +5783,7 @@ static CapturedStmt *buildDistanceFunc(Sema &Actions, QualType LogicalTy,
57835783
// Divide by the absolute step amount. If the range is not a multiple of
57845784
// the step size, rounding-up the effective upper bound ensures that the
57855785
// last iteration is included.
5786-
// Note that the rounding-up may cause an overflow in a temporry that
5786+
// Note that the rounding-up may cause an overflow in a temporary that
57875787
// could be avoided, but would have occurred in a C-style for-loop as
57885788
// well.
57895789
Expr *Divisor = BuildVarRef(NewStep);
@@ -6064,7 +6064,7 @@ static ExprResult buildUserDefinedMapperRef(Sema &SemaRef, Scope *S,
60646064
static void
60656065
processImplicitMapsWithDefaultMappers(Sema &S, DSAStackTy *Stack,
60666066
SmallVectorImpl<OMPClause *> &Clauses) {
6067-
// Check for the deault mapper for data members.
6067+
// Check for the default mapper for data members.
60686068
if (S.getLangOpts().OpenMP < 50)
60696069
return;
60706070
SmallVector<OMPClause *, 4> ImplicitMaps;
@@ -6882,7 +6882,7 @@ StmtResult SemaOpenMP::ActOnOpenMPExecutableDirective(
68826882
switch (C->getClauseKind()) {
68836883
case OMPC_num_threads:
68846884
case OMPC_dist_schedule:
6885-
// Do not analyse if no parent teams directive.
6885+
// Do not analyze if no parent teams directive.
68866886
if (isOpenMPTeamsDirective(Kind))
68876887
break;
68886888
continue;
@@ -7703,7 +7703,7 @@ SemaOpenMP::checkOpenMPDeclareVariantFunction(SemaOpenMP::DeclGroupPtrTy DG,
77037703
FnPtrType = Context.getMemberPointerType(AdjustedFnType, ClassType);
77047704
ExprResult ER;
77057705
{
7706-
// Build adrr_of unary op to correctly handle type checks for member
7706+
// Build addr_of unary op to correctly handle type checks for member
77077707
// functions.
77087708
Sema::TentativeAnalysisScope Trap(SemaRef);
77097709
ER = SemaRef.CreateBuiltinUnaryOp(VariantRef->getBeginLoc(), UO_AddrOf,
@@ -8262,7 +8262,7 @@ bool OpenMPIterationSpaceChecker::setStep(Expr *NewStep, bool Subtract) {
82628262
diag::err_omp_loop_incr_not_compatible)
82638263
<< LCDecl << *TestIsLessOp << NewStep->getSourceRange();
82648264
SemaRef.Diag(ConditionLoc,
8265-
diag::note_omp_loop_cond_requres_compatible_incr)
8265+
diag::note_omp_loop_cond_requires_compatible_incr)
82668266
<< *TestIsLessOp << ConditionSrcRange;
82678267
return true;
82688268
}
@@ -9345,7 +9345,7 @@ void SemaOpenMP::ActOnOpenMPLoopInitialization(SourceLocation ForLoc,
93459345
}
93469346
}
93479347
DSAStack->addLoopControlVariable(D, VD);
9348-
const Decl *LD = DSAStack->getPossiblyLoopCunter();
9348+
const Decl *LD = DSAStack->getPossiblyLoopCounter();
93499349
if (LD != D->getCanonicalDecl()) {
93509350
DSAStack->resetPossibleLoopCounter();
93519351
if (auto *Var = dyn_cast_or_null<VarDecl>(LD))
@@ -9407,7 +9407,7 @@ void SemaOpenMP::ActOnOpenMPLoopInitialization(SourceLocation ForLoc,
94079407
}
94089408

94099409
namespace {
9410-
// Utility for openmp doacross clause kind
9410+
// Utility for OpenMP doacross clause kind
94119411
class OMPDoacrossKind {
94129412
public:
94139413
bool isSource(const OMPDoacrossClause *C) {
@@ -9785,7 +9785,7 @@ static Stmt *buildPreInits(ASTContext &Context,
97859785
/// stored in lieu of using an explicit list. Flattening is necessary because
97869786
/// contained DeclStmts need to be visible after the execution of the list. Used
97879787
/// for OpenMP pre-init declarations/statements.
9788-
static void appendFlattendedStmtList(SmallVectorImpl<Stmt *> &TargetList,
9788+
static void appendFlattenedStmtList(SmallVectorImpl<Stmt *> &TargetList,
97899789
Stmt *Item) {
97909790
// nullptr represents an empty list.
97919791
if (!Item)
@@ -9817,7 +9817,7 @@ static Stmt *buildPreInits(ASTContext &Context, ArrayRef<Stmt *> PreInits) {
98179817

98189818
SmallVector<Stmt *> Stmts;
98199819
for (Stmt *S : PreInits)
9820-
appendFlattendedStmtList(Stmts, S);
9820+
appendFlattenedStmtList(Stmts, S);
98219821
return CompoundStmt::Create(Context, PreInits, FPOptionsOverride(), {}, {});
98229822
}
98239823

@@ -9921,7 +9921,7 @@ checkOpenMPLoop(OpenMPDirectiveKind DKind, Expr *CollapseLoopCountExpr,
99219921
// Search for pre-init declared variables that need to be captured
99229922
// to be referenceable inside the directive.
99239923
SmallVector<Stmt *> Constituents;
9924-
appendFlattendedStmtList(Constituents, DependentPreInits);
9924+
appendFlattenedStmtList(Constituents, DependentPreInits);
99259925
for (Stmt *S : Constituents) {
99269926
if (auto *DC = dyn_cast<DeclStmt>(S)) {
99279927
for (Decl *C : DC->decls()) {
@@ -11407,7 +11407,7 @@ StmtResult SemaOpenMP::ActOnOpenMPScanDirective(ArrayRef<OMPClause *> Clauses,
1140711407
diag::err_omp_scan_single_clause_expected);
1140811408
return StmtError();
1140911409
}
11410-
// Check that scan directive is used in the scopeof the OpenMP loop body.
11410+
// Check that scan directive is used in the scope of the OpenMP loop body.
1141111411
if (Scope *S = DSAStack->getCurScope()) {
1141211412
Scope *ParentS = S->getParent();
1141311413
if (!ParentS || ParentS->getParent() != ParentS->getBreakParent() ||
@@ -11562,7 +11562,7 @@ class OpenMPAtomicUpdateChecker {
1156211562
NotAnAssignmentOp,
1156311563
/// RHS part of the binary operation is not a binary expression.
1156411564
NotABinaryExpression,
11565-
/// RHS part is not additive/multiplicative/shift/biwise binary
11565+
/// RHS part is not additive/multiplicative/shift/bitwise binary
1156611566
/// expression.
1156711567
NotABinaryOperator,
1156811568
/// RHS binary operation does not have reference to the updated LHS
@@ -11840,7 +11840,7 @@ class OpenMPAtomicCompareChecker {
1184011840
InvalidAssignment,
1184111841
/// Not if statement
1184211842
NotIfStmt,
11843-
/// More than two statements in a compund statement.
11843+
/// More than two statements in a compound statement.
1184411844
MoreThanTwoStmts,
1184511845
/// Not a compound statement.
1184611846
NotCompoundStmt,
@@ -14327,7 +14327,7 @@ bool SemaOpenMP::checkTransformableLoopNest(
1432714327
else
1432814328
llvm_unreachable("Unhandled loop transformation");
1432914329

14330-
appendFlattendedStmtList(OriginalInits.back(), DependentPreInits);
14330+
appendFlattenedStmtList(OriginalInits.back(), DependentPreInits);
1433114331
});
1433214332
assert(OriginalInits.back().empty() && "No preinit after innermost loop");
1433314333
OriginalInits.pop_back();

0 commit comments

Comments
 (0)