aboutsummaryrefslogtreecommitdiff
path: root/disassembler_dex.cc
diff options
context:
space:
mode:
authorAnton Bikineev <bikineev@chromium.org>2021-05-15 22:35:36 +0000
committerCopybara-Service <copybara-worker@google.com>2021-07-25 21:14:18 -0700
commit1a96551a279242efef41468357e38d3091e884bc (patch)
tree04fb6730d8927a839d99d24492555b877077317d /disassembler_dex.cc
parent147f86be24a5ceb5447a9376fdc8c65044bb2977 (diff)
downloadzucchini-1a96551a279242efef41468357e38d3091e884bc.tar.gz
components: Replace base::Optional and friends with absl counterparts
This replaces: - base::Optional -> absl::optional - include "base/optional.h" -> include "third_party/abseil-cpp/absl/types/optional.h" - base::nullopt -> absl::nullopt - base::make_optional -> absl::make_optional Bug: 1202909 Change-Id: If697b7bf69b199c1796f873eedca3359cdb48c64 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2897151 Commit-Queue: Anton Bikineev <bikineev@chromium.org> Owners-Override: Anton Bikineev <bikineev@chromium.org> Reviewed-by: Peter Kasting <pkasting@chromium.org> Cr-Commit-Position: refs/heads/master@{#883296} NOKEYCHECK=True GitOrigin-RevId: 1156b5f891de178171e71b9221a96bef1ced3d3b
Diffstat (limited to 'disassembler_dex.cc')
-rw-r--r--disassembler_dex.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/disassembler_dex.cc b/disassembler_dex.cc
index 373d645..256ccde 100644
--- a/disassembler_dex.cc
+++ b/disassembler_dex.cc
@@ -18,11 +18,11 @@
#include "base/callback.h"
#include "base/logging.h"
#include "base/numerics/safe_conversions.h"
-#include "base/optional.h"
#include "base/strings/stringprintf.h"
#include "components/zucchini/buffer_source.h"
#include "components/zucchini/buffer_view.h"
#include "components/zucchini/io_utils.h"
+#include "third_party/abseil-cpp/absl/types/optional.h"
namespace zucchini {
@@ -363,13 +363,13 @@ class InstructionReferenceReader : public ReferenceReader {
}
// ReferenceReader:
- base::Optional<Reference> GetNext() override {
+ absl::optional<Reference> GetNext() override {
while (true) {
while (parser_.ReadNext()) {
const auto& v = parser_.value();
DCHECK_NE(v.instr, nullptr);
if (v.instr_offset >= hi_)
- return base::nullopt;
+ return absl::nullopt;
const offset_t location = filter_.Run(v);
if (location == kInvalidOffset || location < lo_)
continue;
@@ -377,7 +377,7 @@ class InstructionReferenceReader : public ReferenceReader {
// assumption |hi_| and |lo_| do not straddle the body of a Reference.
// So |reference_width| is unneeded.
if (location >= hi_)
- return base::nullopt;
+ return absl::nullopt;
offset_t target = mapper_.Run(location);
if (target != kInvalidOffset)
return Reference{location, target};
@@ -386,7 +386,7 @@ class InstructionReferenceReader : public ReferenceReader {
}
++cur_it_;
if (cur_it_ == end_it_)
- return base::nullopt;
+ return absl::nullopt;
parser_ = InstructionParser(image_, *cur_it_);
}
}
@@ -447,7 +447,7 @@ class ItemReferenceReader : public ReferenceReader {
}
// ReferenceReader:
- base::Optional<Reference> GetNext() override {
+ absl::optional<Reference> GetNext() override {
while (cur_idx_ < num_items_) {
const offset_t item_offset = OffsetOfIndex(cur_idx_);
const offset_t location = item_offset + rel_location_;
@@ -478,7 +478,7 @@ class ItemReferenceReader : public ReferenceReader {
++cur_idx_;
return Reference{location, target};
}
- return base::nullopt;
+ return absl::nullopt;
}
private:
@@ -631,7 +631,7 @@ class CachedItemListReferenceReader : public ReferenceReader {
}
// ReferenceReader:
- base::Optional<Reference> GetNext() override {
+ absl::optional<Reference> GetNext() override {
while (cur_it_ < end_it_) {
const offset_t location = *cur_it_ + rel_location_;
if (location >= hi_) // Check is simplified by atomicity assumption.
@@ -649,7 +649,7 @@ class CachedItemListReferenceReader : public ReferenceReader {
continue;
return Reference{location, target};
}
- return base::nullopt;
+ return absl::nullopt;
}
private: