Skip to content

Commit c6fd6d4

Browse files
committed
[llvm][cas] Fix hasValue/getValue warnings
1 parent 29204de commit c6fd6d4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

llvm/include/llvm/CASObjectFormats/CASObjectReader.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ struct CASBlock {
6565
Content(Content), SectionRef(SectionRef),
6666
BlockContentID(BlockContentID) {}
6767

68-
bool isZeroFill() const { return !Content.hasValue(); }
68+
bool isZeroFill() const { return !Content.has_value(); }
6969
};
7070

7171
struct CASBlockFixup {
@@ -86,7 +86,7 @@ struct CASSymbol {
8686
bool IsAutoHide;
8787
Optional<CASBlockRef> BlockRef;
8888

89-
bool isDefined() const { return BlockRef.hasValue(); }
89+
bool isDefined() const { return BlockRef.has_value(); }
9090
};
9191

9292
/// Provides information about the symbols/blocks/sections that a CAS schema

llvm/lib/CASObjectFormats/NestedV1.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1882,7 +1882,7 @@ Expected<CASSymbolRef> NestedV1ObjectReader::getOrCreateCASSymbolRef(
18821882
Expected<Optional<NameRef>> NameRef = Symbol->getName();
18831883
if (!NameRef)
18841884
return NameRef.takeError();
1885-
if (NameRef->hasValue())
1885+
if (NameRef->has_value())
18861886
SymbolsByName[(*NameRef)->getName()] = CASSymbolRef{uint64_t(Ref.get())};
18871887
}
18881888
return CASSymbolRef{uint64_t(Ref.get())};
@@ -2085,7 +2085,7 @@ Error BlockNodeRef::materializeFixups(
20852085

20862086
// Check for an abstract backedge.
20872087
if (TI->Index == Targets->size()) {
2088-
assert(KeptAliveBySymbol.hasValue());
2088+
assert(KeptAliveBySymbol.has_value());
20892089
CASBlockFixup CASFixup{F->Offset, F->Kind, TI->Addend,
20902090
*KeptAliveBySymbol};
20912091
if (Error E = Callback(CASFixup))
@@ -2112,7 +2112,7 @@ Error BlockNodeRef::materializeFixups(
21122112
if (!ExpectedName)
21132113
return ExpectedName.takeError();
21142114
StringRef Name = *ExpectedName;
2115-
TargetRef = Reader.getCASSymbolRefByName(Name).getValue();
2115+
TargetRef = *Reader.getCASSymbolRefByName(Name);
21162116
}
21172117

21182118
// Pass in this block's KeptAliveByBlock for edges.

0 commit comments

Comments
 (0)