Skip to content

[OpenMP] [NFC] SemaOpenMP.cpp and StmtOpenMP.cpp spelling fixes #96814

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions clang/include/clang/AST/Expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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]);
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion clang/include/clang/Basic/DiagnosticSemaKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/AST/StmtOpenMP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
//
//===----------------------------------------------------------------------===//

Expand Down
10 changes: 5 additions & 5 deletions clang/lib/CodeGen/CGStmtOpenMP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down
44 changes: 22 additions & 22 deletions clang/lib/Sema/SemaOpenMP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,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.
Expand Down Expand Up @@ -718,7 +718,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;
Expand Down Expand Up @@ -2584,7 +2584,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; },
Expand Down Expand Up @@ -2694,8 +2694,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));
Expand Down Expand Up @@ -2730,11 +2730,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;
Expand Down Expand Up @@ -3880,7 +3880,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)),
Expand Down Expand Up @@ -5759,7 +5759,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);
Expand Down Expand Up @@ -6040,7 +6040,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;
Expand Down Expand Up @@ -6941,7 +6941,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;
Expand Down Expand Up @@ -7757,7 +7757,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,
Expand Down Expand Up @@ -8299,7 +8299,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;
}
Expand Down Expand Up @@ -9382,7 +9382,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))
Expand Down Expand Up @@ -9444,7 +9444,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) {
Expand Down Expand Up @@ -9822,7 +9822,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)
Expand Down Expand Up @@ -9854,7 +9854,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(), {}, {});
}

Expand Down Expand Up @@ -9958,7 +9958,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()) {
Expand Down Expand Up @@ -11628,7 +11628,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() ||
Expand Down Expand Up @@ -11783,7 +11783,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
Expand Down Expand Up @@ -12061,7 +12061,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,
Expand Down Expand Up @@ -15138,7 +15138,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();
Expand Down
Loading