Skip to content

Commit 52fafae

Browse files
Add periods to the end of comments in 3C code.
Also fix some typos I noticed.
1 parent 9d60155 commit 52fafae

20 files changed

+104
-103
lines changed

clang-tools-extra/clangd/tool/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
22
include_directories(${CMAKE_CURRENT_BINARY_DIR}/..)
33

4-
# Same idea as add_clangDaemon_target in ../CMakeLists.txt
4+
# Same idea as add_clangDaemon_target in ../CMakeLists.txt.
55
function(add_clangd_target_part1 target_name)
66
add_clang_tool(${target_name}
77
ClangdMain.cpp

clang/include/clang/3C/CastPlacement.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ class CastPlacementVisitor : public RecursiveASTVisitor<CastPlacementVisitor> {
4848
ArrayBoundsRewriter ABRewriter;
4949
std::set<Expr *> &ExprsWithCast;
5050

51-
// Enumeration indicating what type of cast is required at a call site
51+
// Enumeration indicating what type of cast is required at a call site.
5252
enum CastNeeded {
53-
NO_CAST = 0, // No casting required
54-
CAST_TO_CHECKED, // A CheckedC bounds cast required (wild -> checked)
55-
CAST_TO_WILD // A standard C explicit cast required (checked -> wild)
53+
NO_CAST = 0, // No casting required.
54+
CAST_TO_CHECKED, // A CheckedC bounds cast required (wild -> checked).
55+
CAST_TO_WILD // A standard C explicit cast required (checked -> wild).
5656
};
5757

5858
CastNeeded needCasting(ConstraintVariable *SrcInt, ConstraintVariable *SrcExt,

clang/include/clang/3C/ConstraintResolver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class ConstraintResolver {
3232

3333
// Returns a set of ConstraintVariables which represent the result of
3434
// evaluating the expression E. Will explore E recursively, but will
35-
// ignore parts of it that do not contribute to the final result
35+
// ignore parts of it that do not contribute to the final result.
3636
CVarSet getExprConstraintVars(Expr *E);
3737

3838
CVarSet getCalleeConstraintVars(CallExpr *CE);

clang/include/clang/3C/ConstraintVariables.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class ConstraintVariable {
8383
// The 'emitName' parameter is true when the generated string should include
8484
// the name of the variable, false for just the type.
8585
// The 'forIType' parameter is true when the generated string is expected
86-
// to be used inside an itype
86+
// to be used inside an itype.
8787
virtual std::string mkString(const EnvironmentMap &E, bool EmitName = true,
8888
bool ForItype = false, bool EmitPointee = false,
8989
bool UnmaskTypedef = false) const = 0;
@@ -186,7 +186,7 @@ class FunctionVariableConstraint;
186186
// We need to store the level inside the type AST at which the first
187187
// typedef occurs. This allows us to stop rewriting once we hit the
188188
// first typedef. (All subsequent typedefs will not be rewritten, as
189-
// rewriting will stop)
189+
// rewriting will stop.)
190190
struct InternalTypedefInfo {
191191
bool HasTypedef;
192192
int TypedefLevel;
@@ -489,7 +489,7 @@ class FunctionVariableConstraint : public ConstraintVariable {
489489
// Flag to indicate whether this is a function pointer or not.
490490
bool IsFunctionPtr;
491491

492-
// Count of type parameters from `_Itype_for_any(...)`
492+
// Count of type parameters from `_Itype_for_any(...)`.
493493
int TypeParams;
494494

495495
void equateFVConstraintVars(ConstraintVariable *CV, ProgramInfo &Info) const;

clang/include/clang/3C/ProgramInfo.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,12 @@ class ProgramInfo : public ProgramVariableAdder {
125125
// analysis from compilation unit to compilation unit.
126126
VariableMap Variables;
127127

128-
// Map storing constraint information for typedefed types
129-
// The set contains all the constraint variables that also use this tyepdef
130-
// TODO this could be replaced w/ a signle CVar
128+
// Map storing constraint information for typedefed types,
129+
// The set contains all the constraint variables that also use this typedef.
130+
// TODO this could be replaced w/ a single CVar.
131131
// The bool informs the rewriter whether or not this typedef should be
132132
// rewritten. It will be false for typedefs we don't support rewritting,
133-
// such as typedefs that are pointers to anonymous structs
133+
// such as typedefs that are pointers to anonymous structs.
134134
std::map<PersistentSourceLoc, std::pair<CVarSet, bool>> TypedefVars;
135135

136136
// Map with the same purpose as the Variables map, this stores constraint
@@ -153,7 +153,7 @@ class ProgramInfo : public ProgramVariableAdder {
153153
// has been seen before.
154154
std::map<std::string, bool> ExternGVars;
155155

156-
// Maps for global/static functions, global variables
156+
// Maps for global/static functions, global variables.
157157
ExternalFunctionMapType ExternalFunctionFVCons;
158158
StaticFunctionMapType StaticFunctionFVCons;
159159
std::map<std::string, std::set<PVConstraint *>> GlobalVariableSymbols;

clang/include/clang/3C/RewriteUtils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class DeclReplacement {
3232
return getDecl()->getSourceRange();
3333
}
3434

35-
// Discriminator for LLVM-style RTTI (dyn_cast<> et al.)
35+
// Discriminator for LLVM-style RTTI (dyn_cast<> et al.).
3636
enum DRKind {
3737
DRK_VarDecl,
3838
DRK_ParmVarDecl,

clang/include/clang/3C/Utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ bool evaluateToInt(clang::Expr *E, const clang::ASTContext &C, int &Result);
199199
bool isZeroBoundsExpr(clang::BoundsExpr *BE, const clang::ASTContext &C);
200200

201201
// Find the range in the source code for the base type of a type location.
202-
// The base type is the type after removing all
202+
// The base type is the type after removing all.
203203
clang::TypeLoc getBaseTypeLoc(clang::TypeLoc T);
204204

205205
// Ignore all CheckedC temporary and clang implicit expression on E. This

clang/lib/3C/3C.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ bool _3CInterface::writeAllConvertedFilesToDisk() {
494494

495495
ClangTool &Tool = getGlobalClangTool();
496496

497-
// Rewrite the input files
497+
// Rewrite the input files.
498498
std::unique_ptr<ToolAction> RewriteTool =
499499
newFrontendActionFactoryA<RewriteAction<RewriteConsumer, ProgramInfo>>(
500500
GlobalProgramInfo, VerifyDiagnosticOutput);

clang/lib/3C/AVarBoundsInfo.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -811,10 +811,10 @@ bool AvarBoundsInference::predictBounds(BoundsKey K,
811811
}
812812

813813
if (!InferredNBnds.empty()) {
814-
// All the possible inferred bounds for K
814+
// All the possible inferred bounds for K.
815815
InferredKBnds.clear();
816816
std::set<BoundsKey> TmpBKeys, AllKeys;
817-
// TODO: Figure out if there is a discrepency and try to implement
817+
// TODO: Figure out if there is a discrepancy and try to implement
818818
// root-cause analysis.
819819

820820
// Find intersection of all bounds from neighbours.
@@ -1056,7 +1056,7 @@ void AVarBoundsInfo::computerArrPointers(ProgramInfo *PI,
10561056
if (hasArray(PI->getVarMap().at(PSL), CS)) {
10571057
ArrPointers.insert(Bkey);
10581058
}
1059-
// Does this array belongs to a valid program variable?
1059+
// Does this array belong to a valid program variable?
10601060
if (isInSrcArray(PI->getVarMap().at(PSL), CS)) {
10611061
InProgramArrPtrBoundsKeys.insert(Bkey);
10621062
}
@@ -1081,7 +1081,7 @@ void AVarBoundsInfo::computerArrPointers(ProgramInfo *PI,
10811081
if (hasArray(FV->getExternalParam(ParmNum), CS)) {
10821082
ArrPointers.insert(Bkey);
10831083
}
1084-
// Does this array belongs to a valid program variable?
1084+
// Does this array belong to a valid program variable?
10851085
if (isInSrcArray(FV->getExternalParam(ParmNum), CS)) {
10861086
InProgramArrPtrBoundsKeys.insert(Bkey);
10871087
}

clang/lib/3C/CastPlacement.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ bool CastPlacementVisitor::VisitCallExpr(CallExpr *CE) {
4646
if (Info.hasTypeParamBindings(CE, Context))
4747
TypeVars = Info.getTypeParamBindings(CE, Context);
4848

49-
// Cast on arguments
49+
// Cast on arguments.
5050
unsigned PIdx = 0;
5151
for (const auto &A : CE->arguments()) {
5252
if (PIdx < FV->numParams()) {

0 commit comments

Comments
 (0)