[bolt] Replace Optional::getValue with value or operator*. NFC
authorFangrui Song <i@maskray.me>
Fri, 29 Jul 2022 08:15:23 +0000 (01:15 -0700)
committerFangrui Song <i@maskray.me>
Fri, 29 Jul 2022 08:15:24 +0000 (01:15 -0700)
bolt/lib/Rewrite/DWARFRewriter.cpp

index da97790..3466f5c 100644 (file)
@@ -516,8 +516,8 @@ void DWARFRewriter::updateUnitDebugInfo(
         if (Value.isFormClass(DWARFFormValue::FC_Constant) ||
             Value.isFormClass(DWARFFormValue::FC_SectionOffset)) {
           uint64_t Offset = Value.isFormClass(DWARFFormValue::FC_Constant)
-                                ? Value.getAsUnsignedConstant().getValue()
-                                : Value.getAsSectionOffset().getValue();
+                                ? Value.getAsUnsignedConstant().value()
+                                : Value.getAsSectionOffset().value();
           DebugLocationsVector InputLL;
 
           Optional<object::SectionedAddress> SectionAddress =
@@ -674,7 +674,7 @@ void DWARFRewriter::updateUnitDebugInfo(
         Value = AttrVal->V;
         const Optional<uint64_t> Result = Value.getAsAddress();
         if (Result.hasValue()) {
-          const uint64_t Address = Result.getValue();
+          const uint64_t Address = *Result;
           uint64_t NewAddress = 0;
           if (const BinaryFunction *Function =
                   BC.getBinaryFunctionContainingAddress(Address)) {