Skip to content

Commit b53e0d1

Browse files
Use std::nullopt instead of None in comments (NFC)
1 parent 2d86143 commit b53e0d1

File tree

7 files changed

+16
-15
lines changed

7 files changed

+16
-15
lines changed

clang/lib/Frontend/PrecompiledPreamble.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class MissingFileCollector : public PPCallbacks {
100100
OptionalFileEntryRef File, StringRef SearchPath,
101101
StringRef RelativePath, const Module *Imported,
102102
SrcMgr::CharacteristicKind FileType) override {
103-
// File is None if it wasn't found.
103+
// File is std::nullopt if it wasn't found.
104104
// (We have some false negatives if PP recovered e.g. <foo> -> "foo")
105105
if (File)
106106
return;

llvm/lib/ProfileData/Coverage/CoverageMapping.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ class SegmentBuilder {
454454

455455
/// Emit segments for active regions which end before \p Loc.
456456
///
457-
/// \p Loc: The start location of the next region. If None, all active
457+
/// \p Loc: The start location of the next region. If std::nullopt, all active
458458
/// regions are completed.
459459
/// \p FirstCompletedRegion: Index of the first completed region.
460460
void completeRegionsUntil(std::optional<LineColPair> Loc,

llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ class AArch64InstructionSelector : public InstructionSelector {
144144
Register Scalar,
145145
MachineIRBuilder &MIRBuilder) const;
146146

147-
/// Emit a lane insert into \p DstReg, or a new vector register if None is
148-
/// provided.
147+
/// Emit a lane insert into \p DstReg, or a new vector register if
148+
/// std::nullopt is provided.
149149
///
150150
/// The lane inserted into is defined by \p LaneIdx. The vector source
151151
/// register is given by \p SrcReg. The register containing the element is

llvm/lib/Transforms/Scalar/LoopFuse.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -885,8 +885,8 @@ struct LoopFuser {
885885
// Check if the candidates have identical tripcounts (first value of
886886
// pair), and if not check the difference in the tripcounts between
887887
// the loops (second value of pair). The difference is not equal to
888-
// None iff the loops iterate a constant number of times, and have a
889-
// single exit.
888+
// std::nullopt iff the loops iterate a constant number of times, and
889+
// have a single exit.
890890
std::pair<bool, std::optional<unsigned>> IdenticalTripCountRes =
891891
haveIdenticalTripCounts(*FC0, *FC1);
892892
bool SameTripCount = IdenticalTripCountRes.first;

mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,8 @@ using CopyCallbackFn =
264264
std::function<LogicalResult(OpBuilder &b, Value src, Value dst)>;
265265

266266
struct LinalgPromotionOptions {
267-
/// Indices of subViews to promote. If `None`, try to promote all operands.
267+
/// Indices of subViews to promote. If `std::nullopt`, try to promote all
268+
/// operands.
268269
std::optional<DenseSet<unsigned>> operandsToPromote = std::nullopt;
269270
LinalgPromotionOptions &setOperandsToPromote(ArrayRef<int64_t> operands) {
270271
operandsToPromote = DenseSet<unsigned>();
@@ -292,7 +293,7 @@ struct LinalgPromotionOptions {
292293
useFullTileBuffersDefault = use;
293294
return *this;
294295
}
295-
/// Alignment of promoted buffer. If `None` do not specify alignment.
296+
/// Alignment of promoted buffer. If `std::nullopt` do not specify alignment.
296297
std::optional<unsigned> alignment = std::nullopt;
297298
LinalgPromotionOptions &setAlignment(unsigned align) {
298299
alignment = align;
@@ -304,9 +305,9 @@ struct LinalgPromotionOptions {
304305
useAlloca = use;
305306
return *this;
306307
}
307-
/// Callback function to do the allocation of the promoted buffer. If None,
308-
/// then the default allocation scheme of allocating a memref<?xi8> buffer
309-
/// followed by a view operation is used.
308+
/// Callback function to do the allocation of the promoted buffer. If
309+
/// std::nullopt, then the default allocation scheme of allocating a
310+
/// memref<?xi8> buffer followed by a view operation is used.
310311
std::optional<AllocBufferCallbackFn> allocationFn = std::nullopt;
311312
std::optional<DeallocBufferCallbackFn> deallocationFn = std::nullopt;
312313
LinalgPromotionOptions &
@@ -317,7 +318,7 @@ struct LinalgPromotionOptions {
317318
return *this;
318319
}
319320
/// Callback function to do the copy of data to and from the promoted
320-
/// subview. If None then a memref.copy is used.
321+
/// subview. If std::nullopt then a memref.copy is used.
321322
std::optional<CopyCallbackFn> copyInFn = std::nullopt;
322323
std::optional<CopyCallbackFn> copyOutFn = std::nullopt;
323324
LinalgPromotionOptions &setCopyInOutFns(CopyCallbackFn const &copyIn,

mlir/include/mlir/Tools/PDLL/AST/Nodes.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -681,8 +681,8 @@ class Decl : public Node {
681681
/// PatternDecl.
682682
const Name *name;
683683

684-
/// The documentation comment attached to this decl. Defaults to None if
685-
/// the comment is unset/unknown.
684+
/// The documentation comment attached to this decl. Defaults to std::nullopt
685+
/// if the comment is unset/unknown.
686686
std::optional<StringRef> docComment;
687687
};
688688

mlir/lib/Dialect/Affine/Analysis/AffineStructures.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1382,7 +1382,7 @@ void FlatAffineValueConstraints::swapVar(unsigned posA, unsigned posB) {
13821382
getVarKindAt(posB) == VarKind::Local)
13831383
return;
13841384

1385-
// Treat value of a local variable as None.
1385+
// Treat value of a local variable as std::nullopt.
13861386
if (getVarKindAt(posA) == VarKind::Local)
13871387
values[posB] = std::nullopt;
13881388
else if (getVarKindAt(posB) == VarKind::Local)

0 commit comments

Comments
 (0)