Skip to content

Commit 0916d96

Browse files
Don't use Optional::hasValue (NFC)
1 parent 064a08c commit 0916d96

File tree

55 files changed

+82
-82
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+82
-82
lines changed

clang-tools-extra/clang-tidy/bugprone/NotNullTerminatedResultCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ void NotNullTerminatedResultCheck::check(
799799
Optional<bool> AreSafeFunctionsWanted;
800800

801801
Preprocessor::macro_iterator It = PP->macro_begin();
802-
while (It != PP->macro_end() && !AreSafeFunctionsWanted.hasValue()) {
802+
while (It != PP->macro_end() && !AreSafeFunctionsWanted) {
803803
if (It->first->getName() == "__STDC_WANT_LIB_EXT1__") {
804804
const auto *MI = PP->getMacroInfo(It->first);
805805
// PP->getMacroInfo() returns nullptr if macro has no definition.

clang-tools-extra/clangd/CodeComplete.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ struct CodeCompletionBuilder {
375375
std::move(*Spelled),
376376
Includes.shouldInsertInclude(*ResolvedDeclaring, *ResolvedInserted));
377377
};
378-
bool ShouldInsert = C.headerToInsertIfAllowed(Opts).hasValue();
378+
bool ShouldInsert = C.headerToInsertIfAllowed(Opts).has_value();
379379
// Calculate include paths and edits for all possible headers.
380380
for (const auto &Inc : C.RankedIncludeHeaders) {
381381
if (auto ToInclude = Inserted(Inc)) {

clang-tools-extra/clangd/Quality.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ wordMatching(llvm::StringRef Name, const llvm::StringSet<> *ContextWords) {
378378
SymbolRelevanceSignals::DerivedSignals
379379
SymbolRelevanceSignals::calculateDerivedSignals() const {
380380
DerivedSignals Derived;
381-
Derived.NameMatchesContext = wordMatching(Name, ContextWords).hasValue();
381+
Derived.NameMatchesContext = wordMatching(Name, ContextWords).has_value();
382382
Derived.FileProximityDistance = !FileProximityMatch || SymbolURI.empty()
383383
? FileDistance::Unreachable
384384
: FileProximityMatch->distance(SymbolURI);

clang-tools-extra/clangd/TUScheduler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ class PreambleThread {
452452
{
453453
std::lock_guard<std::mutex> Lock(Mutex);
454454
CurrentReq.reset();
455-
IsEmpty = !NextReq.hasValue();
455+
IsEmpty = !NextReq;
456456
}
457457
if (IsEmpty) {
458458
// We don't perform this above, before waiting for a request to make
@@ -1146,7 +1146,7 @@ void ASTWorker::generateDiagnostics(
11461146
}
11471147
Status.update([&](TUStatus &Status) {
11481148
Status.Details.ReuseAST = false;
1149-
Status.Details.BuildFailed = !NewAST.hasValue();
1149+
Status.Details.BuildFailed = !NewAST;
11501150
});
11511151
AST = NewAST ? std::make_unique<ParsedAST>(std::move(*NewAST)) : nullptr;
11521152
} else {

clang-tools-extra/clangd/tool/Check.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ class Checker {
253253
vlog(" definition: {0}", Definitions);
254254

255255
auto Hover = getHover(*AST, Pos, Style, &Index);
256-
vlog(" hover: {0}", Hover.hasValue());
256+
vlog(" hover: {0}", Hover.has_value());
257257

258258
unsigned DocHighlights = findDocumentHighlights(*AST, Pos).size();
259259
vlog(" documentHighlight: {0}", DocHighlights);

clang/include/clang/APINotes/Types.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ class ObjCContextInfo : public CommonTypeInfo {
238238
: llvm::None;
239239
}
240240
void setSwiftImportAsNonGeneric(llvm::Optional<bool> Value) {
241-
SwiftImportAsNonGenericSpecified = Value.hasValue();
241+
SwiftImportAsNonGenericSpecified = Value.has_value();
242242
SwiftImportAsNonGeneric = Value.value_or(false);
243243
}
244244

@@ -247,7 +247,7 @@ class ObjCContextInfo : public CommonTypeInfo {
247247
: llvm::None;
248248
}
249249
void setSwiftObjCMembers(llvm::Optional<bool> Value) {
250-
SwiftObjCMembersSpecified = Value.hasValue();
250+
SwiftObjCMembersSpecified = Value.has_value();
251251
SwiftObjCMembers = Value.value_or(false);
252252
}
253253

@@ -365,7 +365,7 @@ class ObjCPropertyInfo : public VariableInfo {
365365
: llvm::None;
366366
}
367367
void setSwiftImportAsAccessors(llvm::Optional<bool> Value) {
368-
SwiftImportAsAccessorsSpecified = Value.hasValue();
368+
SwiftImportAsAccessorsSpecified = Value.has_value();
369369
SwiftImportAsAccessors = Value.value_or(false);
370370
}
371371

@@ -429,7 +429,7 @@ class ParamInfo : public VariableInfo {
429429
return NoEscape;
430430
}
431431
void setNoEscape(llvm::Optional<bool> Value) {
432-
NoEscapeSpecified = Value.hasValue();
432+
NoEscapeSpecified = Value.has_value();
433433
NoEscape = Value.value_or(false);
434434
}
435435

@@ -666,7 +666,7 @@ class TagInfo : public CommonTypeInfo {
666666
return llvm::None;
667667
}
668668
void setFlagEnum(llvm::Optional<bool> Value) {
669-
HasFlagEnum = Value.hasValue();
669+
HasFlagEnum = Value.has_value();
670670
IsFlagEnum = Value.value_or(false);
671671
}
672672

clang/include/clang/AST/Type.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5805,7 +5805,7 @@ class PackExpansionType : public Type, public llvm::FoldingSetNode {
58055805
static void Profile(llvm::FoldingSetNodeID &ID, QualType Pattern,
58065806
Optional<unsigned> NumExpansions) {
58075807
ID.AddPointer(Pattern.getAsOpaquePtr());
5808-
ID.AddBoolean(NumExpansions.hasValue());
5808+
ID.AddBoolean(NumExpansions.has_value());
58095809
if (NumExpansions)
58105810
ID.AddInteger(*NumExpansions);
58115811
}

clang/lib/AST/ExprCXX.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ CXXNewExpr::CXXNewExpr(bool IsGlobalNew, FunctionDecl *OperatorNew,
196196
"Only NoInit can have no initializer!");
197197

198198
CXXNewExprBits.IsGlobalNew = IsGlobalNew;
199-
CXXNewExprBits.IsArray = ArraySize.hasValue();
199+
CXXNewExprBits.IsArray = ArraySize.has_value();
200200
CXXNewExprBits.ShouldPassAlignment = ShouldPassAlignment;
201201
CXXNewExprBits.UsualArrayDeleteWantsSize = UsualArrayDeleteWantsSize;
202202
CXXNewExprBits.StoredInitializationStyle =
@@ -248,7 +248,7 @@ CXXNewExpr::Create(const ASTContext &Ctx, bool IsGlobalNew,
248248
InitializationStyle InitializationStyle, Expr *Initializer,
249249
QualType Ty, TypeSourceInfo *AllocatedTypeInfo,
250250
SourceRange Range, SourceRange DirectInitRange) {
251-
bool IsArray = ArraySize.hasValue();
251+
bool IsArray = ArraySize.has_value();
252252
bool HasInit = Initializer != nullptr;
253253
unsigned NumPlacementArgs = PlacementArgs.size();
254254
bool IsParenTypeId = TypeIdParens.isValid();

clang/lib/ASTMatchers/ASTMatchFinder.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ class MatchASTVisitor : public RecursiveASTVisitor<MatchASTVisitor>,
429429
}
430430

431431
void onStartOfTranslationUnit() {
432-
const bool EnableCheckProfiling = Options.CheckProfiling.hasValue();
432+
const bool EnableCheckProfiling = Options.CheckProfiling.has_value();
433433
TimeBucketRegion Timer;
434434
for (MatchCallback *MC : Matchers->AllCallbacks) {
435435
if (EnableCheckProfiling)
@@ -439,7 +439,7 @@ class MatchASTVisitor : public RecursiveASTVisitor<MatchASTVisitor>,
439439
}
440440

441441
void onEndOfTranslationUnit() {
442-
const bool EnableCheckProfiling = Options.CheckProfiling.hasValue();
442+
const bool EnableCheckProfiling = Options.CheckProfiling.has_value();
443443
TimeBucketRegion Timer;
444444
for (MatchCallback *MC : Matchers->AllCallbacks) {
445445
if (EnableCheckProfiling)
@@ -1010,7 +1010,7 @@ class MatchASTVisitor : public RecursiveASTVisitor<MatchASTVisitor>,
10101010
/// Used by \c matchDispatch() below.
10111011
template <typename T, typename MC>
10121012
void matchWithoutFilter(const T &Node, const MC &Matchers) {
1013-
const bool EnableCheckProfiling = Options.CheckProfiling.hasValue();
1013+
const bool EnableCheckProfiling = Options.CheckProfiling.has_value();
10141014
TimeBucketRegion Timer;
10151015
for (const auto &MP : Matchers) {
10161016
if (EnableCheckProfiling)
@@ -1033,7 +1033,7 @@ class MatchASTVisitor : public RecursiveASTVisitor<MatchASTVisitor>,
10331033
if (Filter.empty())
10341034
return;
10351035

1036-
const bool EnableCheckProfiling = Options.CheckProfiling.hasValue();
1036+
const bool EnableCheckProfiling = Options.CheckProfiling.has_value();
10371037
TimeBucketRegion Timer;
10381038
auto &Matchers = this->Matchers->DeclOrStmt;
10391039
for (unsigned short I : Filter) {

clang/lib/Lex/HeaderSearch.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ Optional<FileEntryRef> DirectoryLookup::DoFrameworkLookup(
626626

627627
// Set out flags.
628628
InUserSpecifiedSystemFramework = CacheEntry.IsUserSpecifiedSystemFramework;
629-
IsFrameworkFound = CacheEntry.Directory.hasValue();
629+
IsFrameworkFound = CacheEntry.Directory.has_value();
630630

631631
if (RelativePath) {
632632
RelativePath->clear();

clang/lib/Sema/SemaExprCXX.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1926,7 +1926,7 @@ Sema::isUnavailableAlignedAllocationFunction(const FunctionDecl &FD) const {
19261926
return false;
19271927
Optional<unsigned> AlignmentParam;
19281928
if (FD.isReplaceableGlobalAllocationFunction(&AlignmentParam) &&
1929-
AlignmentParam.hasValue())
1929+
AlignmentParam)
19301930
return true;
19311931
return false;
19321932
}
@@ -2231,7 +2231,7 @@ Sema::BuildCXXNew(SourceRange Range, bool UseGlobal,
22312231
!Expr::hasAnyTypeDependentArguments(PlacementArgs) &&
22322232
FindAllocationFunctions(
22332233
StartLoc, SourceRange(PlacementLParen, PlacementRParen), Scope, Scope,
2234-
AllocType, ArraySize.hasValue(), PassAlignment, PlacementArgs,
2234+
AllocType, ArraySize.has_value(), PassAlignment, PlacementArgs,
22352235
OperatorNew, OperatorDelete))
22362236
return ExprError();
22372237

@@ -2314,7 +2314,7 @@ Sema::BuildCXXNew(SourceRange Range, bool UseGlobal,
23142314
// Adjust placement args by prepending conjured size and alignment exprs.
23152315
llvm::SmallVector<Expr *, 8> CallArgs;
23162316
CallArgs.reserve(NumImplicitArgs + PlacementArgs.size());
2317-
CallArgs.emplace_back(AllocationSize.hasValue()
2317+
CallArgs.emplace_back(AllocationSize
23182318
? static_cast<Expr *>(&AllocationSizeLiteral)
23192319
: &OpaqueAllocationSize);
23202320
if (PassAlignment)

clang/lib/StaticAnalyzer/Core/CallEvent.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1406,7 +1406,7 @@ CallEventManager::getCaller(const StackFrameContext *CalleeCtx,
14061406
Trigger = Dtor->getBody();
14071407

14081408
return getCXXDestructorCall(Dtor, Trigger, ThisVal.getAsRegion(),
1409-
E.getAs<CFGBaseDtor>().hasValue(), State,
1409+
E.getAs<CFGBaseDtor>().has_value(), State,
14101410
CallerCtx);
14111411
}
14121412

clang/lib/StaticAnalyzer/Core/RegionStore.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2481,7 +2481,7 @@ RegionStoreManager::bindArray(RegionBindingsConstRef B,
24812481

24822482
RegionBindingsRef NewB(B);
24832483

2484-
for (; Size.hasValue() ? i < Size.getValue() : true ; ++i, ++VI) {
2484+
for (; Size ? i < *Size : true; ++i, ++VI) {
24852485
// The init list might be shorter than the array length.
24862486
if (VI == VE)
24872487
break;

clang/lib/Tooling/Syntax/BuildTree.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ class syntax::TreeBuilder {
572572
for (const auto &T : A.getTokenBuffer().expandedTokens().drop_back()) {
573573
auto *L = new (A.getAllocator()) syntax::Leaf(&T);
574574
L->Original = true;
575-
L->CanModify = A.getTokenBuffer().spelledForExpanded(T).hasValue();
575+
L->CanModify = A.getTokenBuffer().spelledForExpanded(T).has_value();
576576
Trees.insert(Trees.end(), {&T, L});
577577
}
578578
}
@@ -646,7 +646,7 @@ class syntax::TreeBuilder {
646646
// Mark that this node came from the AST and is backed by the source code.
647647
Node->Original = true;
648648
Node->CanModify =
649-
A.getTokenBuffer().spelledForExpanded(Tokens).hasValue();
649+
A.getTokenBuffer().spelledForExpanded(Tokens).has_value();
650650

651651
Trees.erase(BeginChildren, EndChildren);
652652
Trees.insert({FirstToken, Node});

clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1318,7 +1318,7 @@ static Error UnbundleArchive() {
13181318
if (!NextTripleOrErr)
13191319
return NextTripleOrErr.takeError();
13201320

1321-
CodeObject = ((*NextTripleOrErr).hasValue()) ? **NextTripleOrErr : "";
1321+
CodeObject = NextTripleOrErr->value_or("");
13221322
} // End of processing of all bundle entries of this child of input archive.
13231323
} // End of while over children of input archive.
13241324

flang/lib/Lower/IO.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,7 +1229,7 @@ genConditionHandlerCall(Fortran::lower::AbstractConverter &converter,
12291229
boolValue(csi.hasErr),
12301230
boolValue(csi.hasEnd),
12311231
boolValue(csi.hasEor),
1232-
boolValue(csi.ioMsg.hasValue())};
1232+
boolValue(csi.ioMsg.has_value())};
12331233
builder.create<fir::CallOp>(loc, enableHandlers, ioArgs);
12341234
}
12351235

@@ -1902,7 +1902,7 @@ genDataTransferStmt(Fortran::lower::AbstractConverter &converter,
19021902
llvm::Optional<fir::ExtendedValue> descRef =
19031903
isInternal ? maybeGetInternalIODescriptor(converter, stmt, stmtCtx)
19041904
: llvm::None;
1905-
const bool isInternalWithDesc = descRef.hasValue();
1905+
const bool isInternalWithDesc = descRef.has_value();
19061906
const bool isAsync = isDataTransferAsynchronous(loc, stmt);
19071907
const bool isNml = isDataTransferNamelist(stmt);
19081908

flang/lib/Optimizer/Dialect/FIROps.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3079,7 +3079,7 @@ void fir::StringLitOp::build(mlir::OpBuilder &builder,
30793079
fir::CharacterType inType, llvm::StringRef val,
30803080
llvm::Optional<int64_t> len) {
30813081
auto valAttr = builder.getNamedAttr(value(), builder.getStringAttr(val));
3082-
int64_t length = len.hasValue() ? len.getValue() : inType.getLen();
3082+
int64_t length = len ? *len : inType.getLen();
30833083
auto lenAttr = mkNamedIntegerAttr(builder, size(), length);
30843084
result.addAttributes({valAttr, lenAttr});
30853085
result.addTypes(inType);
@@ -3102,7 +3102,7 @@ void fir::StringLitOp::build(mlir::OpBuilder &builder,
31023102
llvm::Optional<std::int64_t> len) {
31033103
auto valAttr =
31043104
builder.getNamedAttr(xlist(), convertToArrayAttr(builder, vlist));
3105-
std::int64_t length = len.hasValue() ? len.getValue() : inType.getLen();
3105+
std::int64_t length = len ? *len : inType.getLen();
31063106
auto lenAttr = mkNamedIntegerAttr(builder, size(), length);
31073107
result.addAttributes({valAttr, lenAttr});
31083108
result.addTypes(inType);
@@ -3115,7 +3115,7 @@ void fir::StringLitOp::build(mlir::OpBuilder &builder,
31153115
llvm::Optional<std::int64_t> len) {
31163116
auto valAttr =
31173117
builder.getNamedAttr(xlist(), convertToArrayAttr(builder, vlist));
3118-
std::int64_t length = len.hasValue() ? len.getValue() : inType.getLen();
3118+
std::int64_t length = len ? *len : inType.getLen();
31193119
auto lenAttr = mkNamedIntegerAttr(builder, size(), length);
31203120
result.addAttributes({valAttr, lenAttr});
31213121
result.addTypes(inType);
@@ -3128,7 +3128,7 @@ void fir::StringLitOp::build(mlir::OpBuilder &builder,
31283128
llvm::Optional<std::int64_t> len) {
31293129
auto valAttr =
31303130
builder.getNamedAttr(xlist(), convertToArrayAttr(builder, vlist));
3131-
std::int64_t length = len.hasValue() ? len.getValue() : inType.getLen();
3131+
std::int64_t length = len ? *len : inType.getLen();
31323132
auto lenAttr = mkNamedIntegerAttr(builder, size(), length);
31333133
result.addAttributes({valAttr, lenAttr});
31343134
result.addTypes(inType);

lldb/source/Interpreter/CommandInterpreter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ bool CommandInterpreter::SetQuitExitCode(int exit_code) {
212212
}
213213

214214
int CommandInterpreter::GetQuitExitCode(bool &exited) const {
215-
exited = m_quit_exit_code.hasValue();
215+
exited = m_quit_exit_code.has_value();
216216
if (exited)
217217
return *m_quit_exit_code;
218218
return 0;

lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ void SymbolFileBreakpad::AddSymbols(Symtab &symtab) {
489489
/*is_trampoline*/ false, /*is_artificial*/ false,
490490
AddressRange(section_sp, address - section_sp->GetFileAddress(),
491491
size.value_or(0)),
492-
size.hasValue(), /*contains_linker_annotations*/ false, /*flags*/ 0);
492+
size.has_value(), /*contains_linker_annotations*/ false, /*flags*/ 0);
493493
};
494494

495495
for (llvm::StringRef line : lines(Record::Public)) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1373,7 +1373,7 @@ user_id_t SymbolFileDWARF::GetUID(DIERef ref) {
13731373

13741374
lldbassert(GetDwoNum().value_or(0) <= 0x3fffffff);
13751375
return user_id_t(GetDwoNum().value_or(0)) << 32 | ref.die_offset() |
1376-
lldb::user_id_t(GetDwoNum().hasValue()) << 62 |
1376+
lldb::user_id_t(GetDwoNum().has_value()) << 62 |
13771377
lldb::user_id_t(ref.section() == DIERef::Section::DebugTypes) << 63;
13781378
}
13791379

lldb/source/Plugins/SymbolFile/NativePDB/UdtRecordCompleter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ clang::QualType UdtRecordCompleter::AddBaseClassForTypeIndex(
6666
std::unique_ptr<clang::CXXBaseSpecifier> base_spec =
6767
m_ast_builder.clang().CreateBaseClassSpecifier(
6868
qt.getAsOpaquePtr(), TranslateMemberAccess(access),
69-
vtable_idx.hasValue(), udt_cvt.kind() == LF_CLASS);
69+
vtable_idx.has_value(), udt_cvt.kind() == LF_CLASS);
7070
if (!base_spec)
7171
return {};
7272

lldb/source/Symbol/CompileUnit.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ void CompileUnit::ResolveSymbolContext(
323323
const bool inlines = false;
324324
const bool exact = true;
325325
const llvm::Optional<uint16_t> column =
326-
src_location_spec.GetColumn().hasValue()
326+
src_location_spec.GetColumn()
327327
? llvm::Optional<uint16_t>(line_entry.column)
328328
: llvm::None;
329329

llvm/include/llvm/Analysis/InlineAdvisor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ class DefaultInlineAdvice : public InlineAdvice {
145145
DefaultInlineAdvice(InlineAdvisor *Advisor, CallBase &CB,
146146
Optional<InlineCost> OIC, OptimizationRemarkEmitter &ORE,
147147
bool EmitRemarks = true)
148-
: InlineAdvice(Advisor, CB, ORE, OIC.hasValue()), OriginalCB(&CB),
148+
: InlineAdvice(Advisor, CB, ORE, OIC.has_value()), OriginalCB(&CB),
149149
OIC(OIC), EmitRemarks(EmitRemarks) {}
150150

151151
private:

llvm/include/llvm/Analysis/ObjCARCUtil.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ inline bool hasAttachedCallOpBundle(const CallBase *CB) {
3535
// functions.
3636
return !CB->getFunctionType()->getReturnType()->isVoidTy() &&
3737
CB->getOperandBundle(LLVMContext::OB_clang_arc_attachedcall)
38-
.hasValue();
38+
.has_value();
3939
}
4040

4141
/// This function returns operand bundle clang_arc_attachedcall's argument,

llvm/include/llvm/DebugInfo/CodeView/TypeCollection.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class TypeCollection {
3434
template <typename TFunc> void ForEachRecord(TFunc Func) {
3535
Optional<TypeIndex> Next = getFirst();
3636

37-
while (Next.hasValue()) {
37+
while (Next) {
3838
TypeIndex N = *Next;
3939
Func(N, getType(N));
4040
Next = getNext(N);

llvm/include/llvm/DebugInfo/DWARF/DWARFAbbreviationDeclaration.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class DWARFAbbreviationDeclaration {
3434
AttributeSpec(dwarf::Attribute A, dwarf::Form F, Optional<uint8_t> ByteSize)
3535
: Attr(A), Form(F) {
3636
assert(!isImplicitConst());
37-
this->ByteSize.HasByteSize = ByteSize.hasValue();
37+
this->ByteSize.HasByteSize = ByteSize.has_value();
3838
if (this->ByteSize.HasByteSize)
3939
this->ByteSize.ByteSize = *ByteSize;
4040
}

llvm/lib/Analysis/ScalarEvolution.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8858,7 +8858,7 @@ ScalarEvolution::ExitLimit ScalarEvolution::computeShiftCompareExitLimit(
88588858

88598859
// and the kind of shift should be match the kind of shift we peeled
88608860
// off, if any.
8861-
(!PostShiftOpCode.hasValue() || *PostShiftOpCode == OpCodeOut);
8861+
(!PostShiftOpCode || *PostShiftOpCode == OpCodeOut);
88628862
};
88638863

88648864
PHINode *PN;

0 commit comments

Comments
 (0)