[clang] 6ba764a - [OpenMP] [NFC] SemaOpenMP.cpp and StmtOpenMP.cpp spelling fixes (#96814)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 28 10:36:23 PDT 2024
Author: Julian Brown
Date: 2024-06-28T12:36:20-05:00
New Revision: 6ba764a54e2ce359117bf9a9d615e06dc3da6144
URL: https://github.com/llvm/llvm-project/commit/6ba764a54e2ce359117bf9a9d615e06dc3da6144
DIFF: https://github.com/llvm/llvm-project/commit/6ba764a54e2ce359117bf9a9d615e06dc3da6144.diff
LOG: [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.)
Added:
Modified:
clang/include/clang/AST/Expr.h
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/lib/AST/StmtOpenMP.cpp
clang/lib/CodeGen/CGStmtOpenMP.cpp
clang/lib/Sema/SemaOpenMP.cpp
Removed:
################################################################################
diff --git a/clang/include/clang/AST/Expr.h b/clang/include/clang/AST/Expr.h
index 59e174954fdbf..a8add9d1337c6 100644
--- a/clang/include/clang/AST/Expr.h
+++ b/clang/include/clang/AST/Expr.h
@@ -384,7 +384,7 @@ class Expr : public ValueStmt {
bool isRValue() const { return Kind >= CL_XValue; }
bool isModifiable() const { return getModifiable() == CM_Modifiable; }
- /// Create a simple, modifiably lvalue
+ /// Create a simple, modifiable lvalue
static Classification makeSimpleLValue() {
return Classification(CL_LValue, CM_Modifiable);
}
@@ -1292,7 +1292,7 @@ class DeclRefExpr final
DeclRefExpr(const ASTContext &Ctx, NestedNameSpecifierLoc QualifierLoc,
SourceLocation TemplateKWLoc, ValueDecl *D,
- bool RefersToEnlosingVariableOrCapture,
+ bool RefersToEnclosingVariableOrCapture,
const DeclarationNameInfo &NameInfo, NamedDecl *FoundD,
const TemplateArgumentListInfo *TemplateArgs, QualType T,
ExprValueKind VK, NonOdrUseReason NOUR);
@@ -1658,14 +1658,14 @@ class FloatingLiteral : public Expr, private APFloatStorage {
}
/// Get a raw enumeration value representing the floating-point semantics of
- /// this literal (32-bit IEEE, x87, ...), suitable for serialisation.
+ /// this literal (32-bit IEEE, x87, ...), suitable for serialization.
llvm::APFloatBase::Semantics getRawSemantics() const {
return static_cast<llvm::APFloatBase::Semantics>(
FloatingLiteralBits.Semantics);
}
/// Set the raw enumeration value representing the floating-point semantics of
- /// this literal (32-bit IEEE, x87, ...), suitable for serialisation.
+ /// this literal (32-bit IEEE, x87, ...), suitable for serialization.
void setRawSemantics(llvm::APFloatBase::Semantics Sem) {
FloatingLiteralBits.Semantics = Sem;
}
@@ -2130,7 +2130,7 @@ class SYCLUniqueStableNameExpr final : public Expr {
static std::string ComputeName(ASTContext &Context, QualType Ty);
};
-/// ParenExpr - This represents a parethesized expression, e.g. "(1)". This
+/// ParenExpr - This represents a parenthesized expression, e.g. "(1)". This
/// AST node is only formed if full location information is requested.
class ParenExpr : public Expr {
SourceLocation L, R;
@@ -2246,7 +2246,7 @@ class UnaryOperator final
bool canOverflow() const { return UnaryOperatorBits.CanOverflow; }
void setCanOverflow(bool C) { UnaryOperatorBits.CanOverflow = C; }
- /// Get the FP contractability status of this operator. Only meaningful for
+ /// Get the FP contractibility status of this operator. Only meaningful for
/// operations on floating point types.
bool isFPContractableWithinStatement(const LangOptions &LO) const {
return getFPFeaturesInEffect(LO).allowFPContractWithinStatement();
@@ -4054,7 +4054,7 @@ class BinaryOperator : public Expr {
return FPOptionsOverride();
}
- /// Get the FP contractability status of this operator. Only meaningful for
+ /// Get the FP contractibility status of this operator. Only meaningful for
/// operations on floating point types.
bool isFPContractableWithinStatement(const LangOptions &LO) const {
return getFPFeaturesInEffect(LO).allowFPContractWithinStatement();
@@ -4295,7 +4295,7 @@ class BinaryConditionalOperator : public AbstractConditionalOperator {
}
/// getFalseExpr - Return the subexpression which will be
- /// evaluated if the condnition evaluates to false; this is
+ /// evaluated if the condition evaluates to false; this is
/// defined in terms of the opaque value.
Expr *getFalseExpr() const {
return cast<Expr>(SubExprs[RHS]);
@@ -6003,7 +6003,7 @@ class GenericSelectionExpr final
// if *It1 and *It2 are bound to the same objects.
// An alternative design approach was discussed during review;
// store an Association object inside the iterator, and return a reference
- // to it when dereferenced. This idea was discarded beacuse of nasty
+ // to it when dereferenced. This idea was discarded because of nasty
// lifetime issues:
// AssociationIterator It = ...;
// const Association &Assoc = *It++; // Oops, Assoc is dangling.
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td
index 96f0c0f0205c2..5dc36c594bcb7 100644
--- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -11117,7 +11117,7 @@ def err_omp_loop_variable_type : Error<
def err_omp_loop_incr_not_compatible : Error<
"increment expression must cause %0 to %select{decrease|increase}1 "
"on each iteration of OpenMP for loop">;
-def note_omp_loop_cond_requres_compatible_incr : Note<
+def note_omp_loop_cond_requires_compatible_incr : Note<
"loop step is expected to be %select{negative|positive}0 due to this condition">;
def err_omp_loop_
diff _cxx : Error<
"could not calculate number of iterations calling 'operator-' with "
diff --git a/clang/lib/AST/StmtOpenMP.cpp b/clang/lib/AST/StmtOpenMP.cpp
index d8519b2071e6d..c8792941a6bb6 100644
--- a/clang/lib/AST/StmtOpenMP.cpp
+++ b/clang/lib/AST/StmtOpenMP.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
//
-// This file implements the subclesses of Stmt class declared in StmtOpenMP.h
+// This file implements the subclasses of Stmt class declared in StmtOpenMP.h
//
//===----------------------------------------------------------------------===//
diff --git a/clang/lib/CodeGen/CGStmtOpenMP.cpp b/clang/lib/CodeGen/CGStmtOpenMP.cpp
index f73d32de7c484..43cf4dc630cd7 100644
--- a/clang/lib/CodeGen/CGStmtOpenMP.cpp
+++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp
@@ -193,7 +193,7 @@ class OMPLoopScope : public CodeGenFunction::RunCleanupsScope {
if (PreInits) {
// CompoundStmts and DeclStmts are used as lists of PreInit statements and
// declarations. Since declarations must be visible in the the following
- // that they initialize, unpack the ComboundStmt they are nested in.
+ // that they initialize, unpack the CompoundStmt they are nested in.
SmallVector<const Stmt *> PreInitStmts;
if (auto *PreInitCompound = dyn_cast<CompoundStmt>(PreInits))
llvm::append_range(PreInitStmts, PreInitCompound->body());
@@ -1411,7 +1411,7 @@ void CodeGenFunction::EmitOMPReductionClauseInit(
case OMPD_end_declare_variant:
case OMPD_unknown:
default:
- llvm_unreachable("Enexpected directive with task reductions.");
+ llvm_unreachable("Unexpected directive with task reductions.");
}
const auto *VD = cast<VarDecl>(cast<DeclRefExpr>(TaskRedRef)->getDecl());
@@ -1766,7 +1766,7 @@ void CodeGenFunction::EmitOMPParallelDirective(const OMPParallelDirective &S) {
using InsertPointTy = llvm::OpenMPIRBuilder::InsertPointTy;
- // The cleanup callback that finalizes all variabels at the given location,
+ // The cleanup callback that finalizes all variables at the given location,
// thus calls destructors etc.
auto FiniCB = [this](InsertPointTy IP) {
OMPBuilderCBHelpers::FinalizeOMPRegion(*this, IP);
@@ -6506,7 +6506,7 @@ static void emitOMPAtomicCompareExpr(
}
if (FailAO == llvm::AtomicOrdering::NotAtomic) {
- // fail clause was not mentionend on the
+ // fail clause was not mentioned on the
// "#pragma omp atomic compare" construct.
CGF.Builder.restoreIP(OMPBuilder.createAtomicCompare(
CGF.Builder, XOpVal, VOpVal, ROpVal, EVal, DVal, AO, Op, IsXBinopExpr,
@@ -7920,7 +7920,7 @@ void CodeGenFunction::EmitOMPGenericLoopDirective(
void CodeGenFunction::EmitOMPParallelGenericLoopDirective(
const OMPLoopDirective &S) {
- // Emit combined directive as if its consituent constructs are 'parallel'
+ // Emit combined directive as if its constituent constructs are 'parallel'
// and 'for'.
auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) {
Action.Enter(CGF);
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp
index 29104b2c0de94..95baaed65e8b4 100644
--- a/clang/lib/Sema/SemaOpenMP.cpp
+++ b/clang/lib/Sema/SemaOpenMP.cpp
@@ -467,7 +467,7 @@ class DSAStackTy {
getTopOfStack().PossiblyLoopCounter = D ? D->getCanonicalDecl() : D;
}
/// Gets the possible loop counter decl.
- const Decl *getPossiblyLoopCunter() const {
+ const Decl *getPossiblyLoopCounter() const {
return getTopOfStack().PossiblyLoopCounter;
}
/// Start new OpenMP region stack in new non-capturing function.
@@ -719,7 +719,7 @@ class DSAStackTy {
TargetLocations.push_back(LocStart);
}
- /// Add location for the first encountered atomicc directive.
+ /// Add location for the first encountered atomic directive.
void addAtomicDirectiveLoc(SourceLocation Loc) {
if (AtomicLocation.isInvalid())
AtomicLocation = Loc;
@@ -2585,7 +2585,7 @@ OpenMPClauseKind SemaOpenMP::isOpenMPPrivateDecl(ValueDecl *D, unsigned Level,
DSAStack->loopStart();
return OMPC_private;
}
- if ((DSAStack->getPossiblyLoopCunter() == D->getCanonicalDecl() ||
+ if ((DSAStack->getPossiblyLoopCounter() == D->getCanonicalDecl() ||
DSAStack->isLoopControlVariable(D).first) &&
!DSAStack->hasExplicitDSA(
D, [](OpenMPClauseKind K, bool) { return K != OMPC_private; },
@@ -2695,8 +2695,8 @@ bool SemaOpenMP::isOpenMPGlobalCapturedDecl(ValueDecl *D, unsigned Level,
unsigned NumLevels =
getOpenMPCaptureLevels(DSAStack->getDirective(Level));
if (Level == 0)
- // non-file scope static variale with default(firstprivate)
- // should be gloabal captured.
+ // non-file scope static variable with default(firstprivate)
+ // should be global captured.
return (NumLevels == CaptureLevel + 1 &&
(TopDVar.CKind != OMPC_shared ||
DSAStack->getDefaultDSA() == DSA_firstprivate));
@@ -2731,11 +2731,11 @@ void SemaOpenMP::finalizeOpenMPDelayedAnalysis(const FunctionDecl *Caller,
assert(getLangOpts().OpenMP && "Expected OpenMP compilation mode.");
std::optional<OMPDeclareTargetDeclAttr::DevTypeTy> DevTy =
OMPDeclareTargetDeclAttr::getDeviceType(Caller->getMostRecentDecl());
- // Ignore host functions during device analyzis.
+ // Ignore host functions during device analysis.
if (getLangOpts().OpenMPIsTargetDevice &&
(!DevTy || *DevTy == OMPDeclareTargetDeclAttr::DT_Host))
return;
- // Ignore nohost functions during host analyzis.
+ // Ignore nohost functions during host analysis.
if (!getLangOpts().OpenMPIsTargetDevice && DevTy &&
*DevTy == OMPDeclareTargetDeclAttr::DT_NoHost)
return;
@@ -3904,7 +3904,7 @@ class DSAAttrChecker final : public StmtVisitor<DSAAttrChecker, void> {
if (SemaRef.LangOpts.OpenMP >= 50)
return !StackComponents.empty();
// Variable is used if it has been marked as an array, array
- // section, array shaping or the variable iself.
+ // section, array shaping or the variable itself.
return StackComponents.size() == 1 ||
llvm::all_of(
llvm::drop_begin(llvm::reverse(StackComponents)),
@@ -5783,7 +5783,7 @@ static CapturedStmt *buildDistanceFunc(Sema &Actions, QualType LogicalTy,
// Divide by the absolute step amount. If the range is not a multiple of
// the step size, rounding-up the effective upper bound ensures that the
// last iteration is included.
- // Note that the rounding-up may cause an overflow in a temporry that
+ // Note that the rounding-up may cause an overflow in a temporary that
// could be avoided, but would have occurred in a C-style for-loop as
// well.
Expr *Divisor = BuildVarRef(NewStep);
@@ -6064,7 +6064,7 @@ static ExprResult buildUserDefinedMapperRef(Sema &SemaRef, Scope *S,
static void
processImplicitMapsWithDefaultMappers(Sema &S, DSAStackTy *Stack,
SmallVectorImpl<OMPClause *> &Clauses) {
- // Check for the deault mapper for data members.
+ // Check for the default mapper for data members.
if (S.getLangOpts().OpenMP < 50)
return;
SmallVector<OMPClause *, 4> ImplicitMaps;
@@ -6882,7 +6882,7 @@ StmtResult SemaOpenMP::ActOnOpenMPExecutableDirective(
switch (C->getClauseKind()) {
case OMPC_num_threads:
case OMPC_dist_schedule:
- // Do not analyse if no parent teams directive.
+ // Do not analyze if no parent teams directive.
if (isOpenMPTeamsDirective(Kind))
break;
continue;
@@ -7703,7 +7703,7 @@ SemaOpenMP::checkOpenMPDeclareVariantFunction(SemaOpenMP::DeclGroupPtrTy DG,
FnPtrType = Context.getMemberPointerType(AdjustedFnType, ClassType);
ExprResult ER;
{
- // Build adrr_of unary op to correctly handle type checks for member
+ // Build addr_of unary op to correctly handle type checks for member
// functions.
Sema::TentativeAnalysisScope Trap(SemaRef);
ER = SemaRef.CreateBuiltinUnaryOp(VariantRef->getBeginLoc(), UO_AddrOf,
@@ -8262,7 +8262,7 @@ bool OpenMPIterationSpaceChecker::setStep(Expr *NewStep, bool Subtract) {
diag::err_omp_loop_incr_not_compatible)
<< LCDecl << *TestIsLessOp << NewStep->getSourceRange();
SemaRef.Diag(ConditionLoc,
- diag::note_omp_loop_cond_requres_compatible_incr)
+ diag::note_omp_loop_cond_requires_compatible_incr)
<< *TestIsLessOp << ConditionSrcRange;
return true;
}
@@ -9345,7 +9345,7 @@ void SemaOpenMP::ActOnOpenMPLoopInitialization(SourceLocation ForLoc,
}
}
DSAStack->addLoopControlVariable(D, VD);
- const Decl *LD = DSAStack->getPossiblyLoopCunter();
+ const Decl *LD = DSAStack->getPossiblyLoopCounter();
if (LD != D->getCanonicalDecl()) {
DSAStack->resetPossibleLoopCounter();
if (auto *Var = dyn_cast_or_null<VarDecl>(LD))
@@ -9407,7 +9407,7 @@ void SemaOpenMP::ActOnOpenMPLoopInitialization(SourceLocation ForLoc,
}
namespace {
-// Utility for openmp doacross clause kind
+// Utility for OpenMP doacross clause kind
class OMPDoacrossKind {
public:
bool isSource(const OMPDoacrossClause *C) {
@@ -9785,7 +9785,7 @@ static Stmt *buildPreInits(ASTContext &Context,
/// stored in lieu of using an explicit list. Flattening is necessary because
/// contained DeclStmts need to be visible after the execution of the list. Used
/// for OpenMP pre-init declarations/statements.
-static void appendFlattendedStmtList(SmallVectorImpl<Stmt *> &TargetList,
+static void appendFlattenedStmtList(SmallVectorImpl<Stmt *> &TargetList,
Stmt *Item) {
// nullptr represents an empty list.
if (!Item)
@@ -9817,7 +9817,7 @@ static Stmt *buildPreInits(ASTContext &Context, ArrayRef<Stmt *> PreInits) {
SmallVector<Stmt *> Stmts;
for (Stmt *S : PreInits)
- appendFlattendedStmtList(Stmts, S);
+ appendFlattenedStmtList(Stmts, S);
return CompoundStmt::Create(Context, PreInits, FPOptionsOverride(), {}, {});
}
@@ -9921,7 +9921,7 @@ checkOpenMPLoop(OpenMPDirectiveKind DKind, Expr *CollapseLoopCountExpr,
// Search for pre-init declared variables that need to be captured
// to be referenceable inside the directive.
SmallVector<Stmt *> Constituents;
- appendFlattendedStmtList(Constituents, DependentPreInits);
+ appendFlattenedStmtList(Constituents, DependentPreInits);
for (Stmt *S : Constituents) {
if (auto *DC = dyn_cast<DeclStmt>(S)) {
for (Decl *C : DC->decls()) {
@@ -11407,7 +11407,7 @@ StmtResult SemaOpenMP::ActOnOpenMPScanDirective(ArrayRef<OMPClause *> Clauses,
diag::err_omp_scan_single_clause_expected);
return StmtError();
}
- // Check that scan directive is used in the scopeof the OpenMP loop body.
+ // Check that scan directive is used in the scope of the OpenMP loop body.
if (Scope *S = DSAStack->getCurScope()) {
Scope *ParentS = S->getParent();
if (!ParentS || ParentS->getParent() != ParentS->getBreakParent() ||
@@ -11562,7 +11562,7 @@ class OpenMPAtomicUpdateChecker {
NotAnAssignmentOp,
/// RHS part of the binary operation is not a binary expression.
NotABinaryExpression,
- /// RHS part is not additive/multiplicative/shift/biwise binary
+ /// RHS part is not additive/multiplicative/shift/bitwise binary
/// expression.
NotABinaryOperator,
/// RHS binary operation does not have reference to the updated LHS
@@ -11840,7 +11840,7 @@ class OpenMPAtomicCompareChecker {
InvalidAssignment,
/// Not if statement
NotIfStmt,
- /// More than two statements in a compund statement.
+ /// More than two statements in a compound statement.
MoreThanTwoStmts,
/// Not a compound statement.
NotCompoundStmt,
@@ -14327,7 +14327,7 @@ bool SemaOpenMP::checkTransformableLoopNest(
else
llvm_unreachable("Unhandled loop transformation");
- appendFlattendedStmtList(OriginalInits.back(), DependentPreInits);
+ appendFlattenedStmtList(OriginalInits.back(), DependentPreInits);
});
assert(OriginalInits.back().empty() && "No preinit after innermost loop");
OriginalInits.pop_back();
More information about the cfe-commits
mailing list