[clang-tools-extra] Fixed a number of typos

I went over the output of the following mess of a command:

`(ulimit -m 2000000; ulimit -v 2000000; git ls-files -z | parallel --xargs -0 cat | aspell list --mode=none --ignore-case | grep -E '^[A-Za-z][a-z]*$' | sort | uniq -c | sort -n | grep -vE '.{25}' | aspell pipe -W3 | grep : | cut -d' ' -f2 | less)`

and proceeded to spend a few days looking at it to find probable typos
and fixed a few hundred of them in all of the llvm project (note, the
ones I found are not anywhere near all of them, but it seems like a
good start).

Reviewed By: kadircet

Differential Revision: https://reviews.llvm.org/D130826
This commit is contained in:
Gabriel Ravier
2022-08-01 15:31:59 +02:00
committed by Kadir Cetinkaya
parent ac3cb4ecd0
commit 0ed2bd9311
17 changed files with 21 additions and 21 deletions

View File

@@ -138,7 +138,7 @@ static bool hasRValueOverload(const CXXConstructorDecl *Ctor,
const int ParamIdx = Param->getFunctionScopeIndex();
const CXXRecordDecl *Record = Ctor->getParent();
// Check whether a ctor `C` forms a pair with `Ctor` under the aforementionned
// Check whether a ctor `C` forms a pair with `Ctor` under the aforementioned
// rules.
const auto IsRValueOverload = [&Ctor, ParamIdx](const CXXConstructorDecl *C) {
if (C == Ctor || C->isDeleted() ||

View File

@@ -19,7 +19,7 @@ namespace performance {
/// Finds calls to C math library functions with implicit float to double
/// promotions.
///
/// For example, warns on ::sin(0.f), because this funciton's parameter is a
/// For example, warns on ::sin(0.f), because this function's parameter is a
/// double. You probably meant to call std::sin(0.f) (in C++), or sinf(0.f) (in
/// C).
///

View File

@@ -142,9 +142,9 @@ struct CodeCompleteOptions {
/// CompletionScore is NameMatch * pow(Base, Prediction).
/// The optimal value of Base largely depends on the semantics of the model
/// and prediction score (e.g. algorithm used during training, number of
/// trees, etc.). Usually if the range of Prediciton is [-20, 20] then a Base
/// trees, etc.). Usually if the range of Prediction is [-20, 20] then a Base
/// in [1.2, 1.7] works fine.
/// Semantics: E.g. For Base = 1.3, if the Prediciton score reduces by 2.6
/// Semantics: E.g. For Base = 1.3, if the Prediction score reduces by 2.6
/// points then completion score reduces by 50% or 1.3^(-2.6).
float DecisionForestBase = 1.3f;
};

View File

@@ -163,8 +163,8 @@ struct Fragment {
/// Flags added by the same CompileFlags entry will not be removed.
std::vector<Located<std::string>> Remove;
/// Directory to search for compilation database (compile_comands.json etc).
/// Valid values are:
/// Directory to search for compilation database (compile_commands.json
/// etc). Valid values are:
/// - A single path to a directory (absolute, or relative to the fragment)
/// - Ancestors: search all parent directories (the default)
/// - None: do not use a compilation database, just default flags.

View File

@@ -111,7 +111,7 @@ class DumpVisitor : public RecursiveASTVisitor<DumpVisitor> {
// Attr just uses a weird method name. Maybe we should fix it instead?
SourceRange getSourceRange(const Attr *Node) { return Node->getRange(); }
// Kind is usualy the class name, without the suffix ("Type" etc).
// Kind is usually the class name, without the suffix ("Type" etc).
// Where there's a set of variants instead, we use the 'Kind' enum values.
std::string getKind(const Decl *D) { return D->getDeclKindName(); }

View File

@@ -120,8 +120,8 @@ std::vector<const NamedDecl *> HeuristicResolver::resolveMemberExpr(
return {};
if (const auto *BT = BaseType->getAs<BuiltinType>()) {
// If BaseType is the type of a dependent expression, it's just
// represented as BultinType::Dependent which gives us no information. We
// can get further by analyzing the depedent expression.
// represented as BuiltinType::Dependent which gives us no information. We
// can get further by analyzing the dependent expression.
Expr *Base = ME->isImplicitAccess() ? nullptr : ME->getBase();
if (Base && BT->getKind() == BuiltinType::Dependent) {
BaseType = resolveExprToType(Base);

View File

@@ -286,7 +286,7 @@ static bool mayConsiderUnused(const Inclusion &Inc, ParsedAST &AST,
return false;
}
for (auto &Filter : Cfg.Diagnostics.Includes.IgnoreHeader) {
// Convert the path to Unix slashes and try to match aginast the fiilter.
// Convert the path to Unix slashes and try to match against the filter.
llvm::SmallString<64> Path(Inc.Resolved);
llvm::sys::path::native(Path, llvm::sys::path::Style::posix);
if (Filter(Inc.Resolved)) {

View File

@@ -383,7 +383,7 @@ private:
if (!Cfg.InlayHints.Parameters || Args.size() == 0 || !Callee)
return;
// If the anchor location comes from a macro defintion, there's nowhere to
// If the anchor location comes from a macro definition, there's nowhere to
// put hints.
if (!AST.getSourceManager().getTopMacroCallerLoc(Anchor).isFileID())
return;

View File

@@ -570,7 +570,7 @@ evaluateDecisionForest(const SymbolQualitySignals &Quality,
DecisionForestScores Scores;
// Exponentiating DecisionForest prediction makes the score of each tree a
// multiplciative boost (like NameMatch). This allows us to weigh the
// prediciton score and NameMatch appropriately.
// prediction score and NameMatch appropriately.
Scores.ExcludingName = pow(Base, Evaluate(E));
// Following cases are not part of the generated training dataset:
// - Symbols with `NeedsFixIts`.

View File

@@ -925,7 +925,7 @@ llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, HighlightingKind K) {
llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, HighlightingModifier K) {
switch (K) {
case HighlightingModifier::Declaration:
return OS << "decl"; // abbrevation for common case
return OS << "decl"; // abbreviation for common case
default:
return OS << toSemanticTokenModifier(K);
}

View File

@@ -61,7 +61,7 @@ std::vector<Example> generateRandomDataset(int NumExamples) {
return Examples;
}
void runDecisionForestPrediciton(const std::vector<Example> Examples) {
void runDecisionForestPrediction(const std::vector<Example> Examples) {
for (const Example &E : Examples)
Evaluate(E);
}
@@ -72,7 +72,7 @@ static void decisionForestPredict(benchmark::State &State) {
State.PauseTiming();
const std::vector<Example> Examples = generateRandomDataset(1000000);
State.ResumeTiming();
runDecisionForestPrediciton(Examples);
runDecisionForestPrediction(Examples);
}
}
BENCHMARK(decisionForestPredict);

View File

@@ -78,7 +78,7 @@ private:
/// - export: this is common and potentially interesting, there are three cases:
/// * Points to a public header (common): we can suppress include2 if you
/// already have include1. Only marginally useful.
/// * Points to a private header annotated with `private` (somewhat commmon):
/// * Points to a private header annotated with `private` (somewhat common):
/// Not incrementally useful as we support private.
/// * Points to a private header without pragmas (rare). This is a reversed
/// private pragma, and is valuable but too rare to be worthwhile.

View File

@@ -1035,7 +1035,7 @@ TEST_F(TUSchedulerTests, TUStatus) {
// Starts handling the update action and blocks until the
// first preamble is built.
ASTAction::RunningAction,
// Afterwqards it builds an AST for that preamble to publish
// Afterwards it builds an AST for that preamble to publish
// diagnostics.
ASTAction::Building,
// Then goes idle.

View File

@@ -1801,7 +1801,7 @@ TEST(FindImplementations, Inheritance) {
}
}
TEST(FindImplementations, CaptureDefintion) {
TEST(FindImplementations, CaptureDefinition) {
llvm::StringRef Test = R"cpp(
struct Base {
virtual void F^oo();

View File

@@ -65,7 +65,7 @@ namespace {
// Mangles a symbol name into a valid identifier.
//
// These follow names in the grammar fairly closely:
// nonterminal: `ptr-declartor` becomes `ptr_declarator`;
// nonterminal: `ptr-declarator` becomes `ptr_declarator`;
// punctuator: `,` becomes `COMMA`;
// keyword: `INT` becomes `INT`;
// terminal: `IDENTIFIER` becomes `IDENTIFIER`;

View File

@@ -1,7 +1,7 @@
# This is a C++ grammar from the C++ standard [1].
#
# The grammar is a superset of the true grammar requring semantic constraints to
# resolve ambiguties. The grammar is context-free and ambiguous (beyond the
# resolve ambiguities. The grammar is context-free and ambiguous (beyond the
# limit of LR(k)). We use general parsing algorithm (e.g GLR) to handle the
# grammar and generate a transition table which is used to drive the parsing.
#

View File

@@ -143,7 +143,7 @@ public:
// CHECK-FIXES: virtual ~PublicNonVirtualBaseClass() {}
};
class PublicNonVirtualNonBaseClass { // OK accoring to C.35, since this class does not have any virtual methods.
class PublicNonVirtualNonBaseClass { // OK according to C.35, since this class does not have any virtual methods.
void f();
public: