Skip to content

Commit 1ca496b

Browse files
Remove redundant initialization of std::optional (NFC)
1 parent 9a678fc commit 1ca496b

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ class SymbolFileDWARF : public lldb_private::SymbolFileCommon {
575575
/// no dSYM file is being used, this file index will be set to a
576576
/// valid value that can be used in DIERef objects which will contain
577577
/// an index that identifies the .DWO or .o file.
578-
std::optional<uint64_t> m_file_index = std::nullopt;
578+
std::optional<uint64_t> m_file_index;
579579
};
580580

581581
#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_SYMBOLFILEDWARF_H

llvm/include/llvm/Transforms/Scalar/JumpThreading.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ class JumpThreadingPass : public PassInfoMixin<JumpThreadingPass> {
8383
LazyValueInfo *LVI = nullptr;
8484
AAResults *AA = nullptr;
8585
std::unique_ptr<DomTreeUpdater> DTU;
86-
std::optional<BlockFrequencyInfo *> BFI = std::nullopt;
87-
std::optional<BranchProbabilityInfo *> BPI = std::nullopt;
86+
std::optional<BlockFrequencyInfo *> BFI;
87+
std::optional<BranchProbabilityInfo *> BPI;
8888
bool ChangedSinceLastAnalysisUpdate = false;
8989
bool HasGuards = false;
9090
#ifndef LLVM_ENABLE_ABI_BREAKING_CHECKS

llvm/lib/Transforms/Scalar/SROA.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ static void migrateDebugInfo(AllocaInst *OldAlloca, bool IsSplit,
241241
bool SetKillLocation = false;
242242

243243
if (IsSplit) {
244-
std::optional<DIExpression::FragmentInfo> BaseFragment = std::nullopt;
244+
std::optional<DIExpression::FragmentInfo> BaseFragment;
245245
{
246246
auto R = BaseFragments.find(getAggregateVariable(DbgAssign));
247247
if (R == BaseFragments.end())

mlir/include/mlir/Interfaces/ValueBoundsOpInterface.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class ValueBoundsConstraintSet {
7777

7878
ValueBoundsConstraintSet &cstr;
7979
Value value;
80-
std::optional<int64_t> dim = std::nullopt;
80+
std::optional<int64_t> dim;
8181
};
8282

8383
public:

mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ static bool isTypeCompatibleWithAtomicOp(Type type, bool isPointerTypeAllowed) {
732732
if (type.isa<LLVMPointerType>())
733733
return isPointerTypeAllowed;
734734

735-
std::optional<unsigned> bitWidth = std::nullopt;
735+
std::optional<unsigned> bitWidth;
736736
if (auto floatType = type.dyn_cast<FloatType>()) {
737737
if (!isCompatibleFloatingPointType(type))
738738
return false;

mlir/lib/Dialect/SCF/IR/ValueBoundsOpInterfaceImpl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ struct ForOpInterface
7777

7878
// Check if computed bound equals the corresponding iter_arg.
7979
Value singleValue = nullptr;
80-
std::optional<int64_t> singleDim = std::nullopt;
80+
std::optional<int64_t> singleDim;
8181
if (auto dimExpr = bound.getResult(0).dyn_cast<AffineDimExpr>()) {
8282
int64_t idx = dimExpr.getPosition();
8383
singleValue = boundOperands[idx].first;

mlir/lib/Dialect/Transform/IR/TransformInterfaces.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ void transform::TransformState::recordValueHandleInvalidationByOpHandleOne(
495495

496496
for (Operation *ancestor : potentialAncestors) {
497497
Operation *definingOp;
498-
std::optional<unsigned> resultNo = std::nullopt;
498+
std::optional<unsigned> resultNo;
499499
unsigned argumentNo, blockNo, regionNo;
500500
if (auto opResult = payloadValue.dyn_cast<OpResult>()) {
501501
definingOp = opResult.getOwner();
@@ -1495,7 +1495,7 @@ LogicalResult transform::detail::verifyTransformOpInterface(Operation *op) {
14951495
});
14961496
};
14971497

1498-
std::optional<unsigned> firstConsumedOperand = std::nullopt;
1498+
std::optional<unsigned> firstConsumedOperand;
14991499
for (OpOperand &operand : op->getOpOperands()) {
15001500
auto range = effectsOn(operand.get());
15011501
if (range.empty()) {

0 commit comments

Comments
 (0)