ART: Refactor for bugprone-argument-comment
Handles smaller subdirectories.
Bug: 116054210
Test: WITH_TIDY=1 mmma art
Change-Id: I81c8f3396b9922684b68e9f3d8fccefe364f1279
diff --git a/adbconnection/adbconnection.cc b/adbconnection/adbconnection.cc
index ad94148..c716d92 100644
--- a/adbconnection/adbconnection.cc
+++ b/adbconnection/adbconnection.cc
@@ -164,8 +164,8 @@
art::WellKnownClasses::java_lang_Thread_init,
thr_group.get(),
thr_name.get(),
- /*Priority*/ 0,
- /*Daemon*/ true);
+ /*Priority=*/ 0,
+ /*Daemon=*/ true);
}
struct CallbackData {
@@ -289,7 +289,7 @@
// If the agent isn't loaded we might need to tell ddms code the connection is closed.
if (!agent_loaded_ && notified_ddm_active_) {
- NotifyDdms(/*active*/false);
+ NotifyDdms(/*active=*/false);
}
}
@@ -605,7 +605,7 @@
if (memcmp(kListenStartMessage, buf, sizeof(kListenStartMessage)) == 0) {
agent_listening_ = true;
if (adb_connection_socket_ != -1) {
- SendAgentFds(/*require_handshake*/ !performed_handshake_);
+ SendAgentFds(/*require_handshake=*/ !performed_handshake_);
}
} else if (memcmp(kListenEndMessage, buf, sizeof(kListenEndMessage)) == 0) {
agent_listening_ = false;
@@ -647,7 +647,7 @@
VLOG(jdwp) << "Sending fds as soon as we received them.";
// The agent was already loaded so this must be after a disconnection. Therefore have the
// transport perform the handshake.
- SendAgentFds(/*require_handshake*/ true);
+ SendAgentFds(/*require_handshake=*/ true);
}
} else if (FlagsSet(control_sock_poll.revents, POLLRDHUP)) {
// The other end of the adb connection just dropped it.
@@ -663,7 +663,7 @@
} else if (agent_listening_ && !sent_agent_fds_) {
VLOG(jdwp) << "Sending agent fds again on data.";
// Agent was already loaded so it can deal with the handshake.
- SendAgentFds(/*require_handshake*/ true);
+ SendAgentFds(/*require_handshake=*/ true);
}
} else if (FlagsSet(adb_socket_poll.revents, POLLRDHUP)) {
DCHECK(!agent_has_socket_);
@@ -763,7 +763,7 @@
}
if (!notified_ddm_active_) {
- NotifyDdms(/*active*/ true);
+ NotifyDdms(/*active=*/ true);
}
uint32_t reply_type;
std::vector<uint8_t> reply;
@@ -826,9 +826,9 @@
void AdbConnectionState::AttachJdwpAgent(art::Thread* self) {
art::Runtime* runtime = art::Runtime::Current();
self->AssertNoPendingException();
- runtime->AttachAgent(/* JNIEnv */ nullptr,
+ runtime->AttachAgent(/* env= */ nullptr,
MakeAgentArg(),
- /* classloader */ nullptr);
+ /* class_loader= */ nullptr);
if (self->IsExceptionPending()) {
LOG(ERROR) << "Failed to load agent " << agent_name_;
art::ScopedObjectAccess soa(self);
diff --git a/dexlayout/compact_dex_writer.cc b/dexlayout/compact_dex_writer.cc
index 00fb0af..a04cfb6 100644
--- a/dexlayout/compact_dex_writer.cc
+++ b/dexlayout/compact_dex_writer.cc
@@ -26,7 +26,7 @@
namespace art {
CompactDexWriter::CompactDexWriter(DexLayout* dex_layout)
- : DexWriter(dex_layout, /*compute_offsets*/ true) {
+ : DexWriter(dex_layout, /*compute_offsets=*/ true) {
CHECK(GetCompactDexLevel() != CompactDexLevel::kCompactDexLevelNone);
}
@@ -36,7 +36,7 @@
CompactDexWriter::Container::Container(bool dedupe_code_items)
: code_item_dedupe_(dedupe_code_items, &data_section_),
- data_item_dedupe_(/*dedupe*/ true, &data_section_) {}
+ data_item_dedupe_(/*enabled=*/ true, &data_section_) {}
uint32_t CompactDexWriter::WriteDebugInfoOffsetTable(Stream* stream) {
const uint32_t start_offset = stream->Tell();
@@ -211,7 +211,7 @@
CompactDexWriter::Deduper::Deduper(bool enabled, DexContainer::Section* section)
: enabled_(enabled),
- dedupe_map_(/*bucket_count*/ 32,
+ dedupe_map_(/*__n=*/ 32,
HashedMemoryRange::HashEqual(section),
HashedMemoryRange::HashEqual(section)) {}
@@ -406,16 +406,16 @@
// Based on: https://source.android.com/devices/tech/dalvik/dex-format
// Since the offsets may not be calculated already, the writing must be done in the correct order.
const uint32_t string_ids_offset = main_stream->Tell();
- WriteStringIds(main_stream, /*reserve_only*/ true);
+ WriteStringIds(main_stream, /*reserve_only=*/ true);
WriteTypeIds(main_stream);
const uint32_t proto_ids_offset = main_stream->Tell();
- WriteProtoIds(main_stream, /*reserve_only*/ true);
+ WriteProtoIds(main_stream, /*reserve_only=*/ true);
WriteFieldIds(main_stream);
WriteMethodIds(main_stream);
const uint32_t class_defs_offset = main_stream->Tell();
- WriteClassDefs(main_stream, /*reserve_only*/ true);
+ WriteClassDefs(main_stream, /*reserve_only=*/ true);
const uint32_t call_site_ids_offset = main_stream->Tell();
- WriteCallSiteIds(main_stream, /*reserve_only*/ true);
+ WriteCallSiteIds(main_stream, /*reserve_only=*/ true);
WriteMethodHandles(main_stream);
if (compute_offsets_) {
@@ -426,7 +426,7 @@
// Write code item first to minimize the space required for encoded methods.
// For cdex, the code items don't depend on the debug info.
- WriteCodeItems(data_stream, /*reserve_only*/ false);
+ WriteCodeItems(data_stream, /*reserve_only=*/ false);
// Sort the debug infos by method index order, this reduces size by ~0.1% by reducing the size of
// the debug info offset table.
@@ -445,19 +445,19 @@
// Write delayed id sections that depend on data sections.
{
Stream::ScopedSeek seek(main_stream, string_ids_offset);
- WriteStringIds(main_stream, /*reserve_only*/ false);
+ WriteStringIds(main_stream, /*reserve_only=*/ false);
}
{
Stream::ScopedSeek seek(main_stream, proto_ids_offset);
- WriteProtoIds(main_stream, /*reserve_only*/ false);
+ WriteProtoIds(main_stream, /*reserve_only=*/ false);
}
{
Stream::ScopedSeek seek(main_stream, class_defs_offset);
- WriteClassDefs(main_stream, /*reserve_only*/ false);
+ WriteClassDefs(main_stream, /*reserve_only=*/ false);
}
{
Stream::ScopedSeek seek(main_stream, call_site_ids_offset);
- WriteCallSiteIds(main_stream, /*reserve_only*/ false);
+ WriteCallSiteIds(main_stream, /*reserve_only=*/ false);
}
// Write the map list.
diff --git a/dexlayout/dex_writer.cc b/dexlayout/dex_writer.cc
index a4c5cda..365171b 100644
--- a/dexlayout/dex_writer.cc
+++ b/dexlayout/dex_writer.cc
@@ -790,16 +790,16 @@
// Based on: https://source.android.com/devices/tech/dalvik/dex-format
// Since the offsets may not be calculated already, the writing must be done in the correct order.
const uint32_t string_ids_offset = stream->Tell();
- WriteStringIds(stream, /*reserve_only*/ true);
+ WriteStringIds(stream, /*reserve_only=*/ true);
WriteTypeIds(stream);
const uint32_t proto_ids_offset = stream->Tell();
- WriteProtoIds(stream, /*reserve_only*/ true);
+ WriteProtoIds(stream, /*reserve_only=*/ true);
WriteFieldIds(stream);
WriteMethodIds(stream);
const uint32_t class_defs_offset = stream->Tell();
- WriteClassDefs(stream, /*reserve_only*/ true);
+ WriteClassDefs(stream, /*reserve_only=*/ true);
const uint32_t call_site_ids_offset = stream->Tell();
- WriteCallSiteIds(stream, /*reserve_only*/ true);
+ WriteCallSiteIds(stream, /*reserve_only=*/ true);
WriteMethodHandles(stream);
uint32_t data_offset_ = 0u;
@@ -812,13 +812,13 @@
// Write code item first to minimize the space required for encoded methods.
// Reserve code item space since we need the debug offsets to actually write them.
const uint32_t code_items_offset = stream->Tell();
- WriteCodeItems(stream, /*reserve_only*/ true);
+ WriteCodeItems(stream, /*reserve_only=*/ true);
// Write debug info section.
WriteDebugInfoItems(stream);
{
// Actually write code items since debug info offsets are calculated now.
Stream::ScopedSeek seek(stream, code_items_offset);
- WriteCodeItems(stream, /*reserve_only*/ false);
+ WriteCodeItems(stream, /*reserve_only=*/ false);
}
WriteEncodedArrays(stream);
@@ -833,19 +833,19 @@
// Write delayed id sections that depend on data sections.
{
Stream::ScopedSeek seek(stream, string_ids_offset);
- WriteStringIds(stream, /*reserve_only*/ false);
+ WriteStringIds(stream, /*reserve_only=*/ false);
}
{
Stream::ScopedSeek seek(stream, proto_ids_offset);
- WriteProtoIds(stream, /*reserve_only*/ false);
+ WriteProtoIds(stream, /*reserve_only=*/ false);
}
{
Stream::ScopedSeek seek(stream, class_defs_offset);
- WriteClassDefs(stream, /*reserve_only*/ false);
+ WriteClassDefs(stream, /*reserve_only=*/ false);
}
{
Stream::ScopedSeek seek(stream, call_site_ids_offset);
- WriteCallSiteIds(stream, /*reserve_only*/ false);
+ WriteCallSiteIds(stream, /*reserve_only=*/ false);
}
// Write the map list.
diff --git a/dexlayout/dexdiag.cc b/dexlayout/dexdiag.cc
index 493a8a2..7a849f2 100644
--- a/dexlayout/dexdiag.cc
+++ b/dexlayout/dexdiag.cc
@@ -294,7 +294,7 @@
{
Options options;
std::unique_ptr<dex_ir::Header> header(dex_ir::DexIrBuilder(*dex_file,
- /*eagerly_assign_offsets*/ true,
+ /*eagerly_assign_offsets=*/ true,
options));
sections = dex_ir::GetSortedDexFileSections(header.get(),
dex_ir::SortDirection::kSortDescending);
@@ -321,9 +321,9 @@
// Extract all the dex files from the vdex file.
std::string error_msg;
std::unique_ptr<VdexFile> vdex(VdexFile::Open(vdex_name,
- false /*writeable*/,
- false /*low_4gb*/,
- false /*unquicken */,
+ /*writable=*/ false,
+ /*low_4gb=*/ false,
+ /*unquicken= */ false,
&error_msg /*out*/));
if (vdex == nullptr) {
std::cerr << "Could not open vdex file "
diff --git a/dexlayout/dexdiag_test.cc b/dexlayout/dexdiag_test.cc
index f936ff9..d3bfd14 100644
--- a/dexlayout/dexdiag_test.cc
+++ b/dexlayout/dexdiag_test.cc
@@ -68,14 +68,14 @@
EXPECT_TRUE(!oat_location.empty());
std::cout << "==" << oat_location << std::endl;
std::string error_msg;
- std::unique_ptr<OatFile> oat(OatFile::Open(/* zip_fd */ -1,
+ std::unique_ptr<OatFile> oat(OatFile::Open(/* zip_fd= */ -1,
oat_location.c_str(),
oat_location.c_str(),
- /* requested_base */ nullptr,
- /* executable */ false,
- /* low_4gb */ false,
- /* abs_dex_location */ nullptr,
- /* reservation */ nullptr,
+ /* requested_base= */ nullptr,
+ /* executable= */ false,
+ /* low_4gb= */ false,
+ /* abs_dex_location= */ nullptr,
+ /* reservation= */ nullptr,
&error_msg));
EXPECT_TRUE(oat != nullptr) << error_msg;
return oat;
diff --git a/dexlayout/dexlayout.cc b/dexlayout/dexlayout.cc
index 1b8412d..db6945f 100644
--- a/dexlayout/dexlayout.cc
+++ b/dexlayout/dexlayout.cc
@@ -1914,10 +1914,10 @@
data_section->Begin(),
data_section->Size(),
location,
- /* checksum */ 0,
- /*oat_dex_file*/ nullptr,
+ /* location_checksum= */ 0,
+ /*oat_dex_file=*/ nullptr,
verify,
- /*verify_checksum*/ false,
+ /*verify_checksum=*/ false,
error_msg));
CHECK(output_dex_file != nullptr) << "Failed to re-open output file:" << *error_msg;
@@ -1928,11 +1928,11 @@
// Regenerate output IR to catch any bugs that might happen during writing.
std::unique_ptr<dex_ir::Header> output_header(
dex_ir::DexIrBuilder(*output_dex_file,
- /*eagerly_assign_offsets*/ true,
+ /*eagerly_assign_offsets=*/ true,
GetOptions()));
std::unique_ptr<dex_ir::Header> orig_header(
dex_ir::DexIrBuilder(*dex_file,
- /*eagerly_assign_offsets*/ true,
+ /*eagerly_assign_offsets=*/ true,
GetOptions()));
CHECK(VerifyOutputDexFile(output_header.get(), orig_header.get(), error_msg)) << *error_msg;
}
@@ -1955,7 +1955,7 @@
const ArtDexFileLoader dex_file_loader;
std::vector<std::unique_ptr<const DexFile>> dex_files;
if (!dex_file_loader.Open(
- file_name, file_name, /* verify */ true, verify_checksum, &error_msg, &dex_files)) {
+ file_name, file_name, /* verify= */ true, verify_checksum, &error_msg, &dex_files)) {
// Display returned error message to user. Note that this error behavior
// differs from the error messages shown by the original Dalvik dexdump.
LOG(ERROR) << error_msg;
@@ -1972,7 +1972,7 @@
if (!ProcessDexFile(file_name,
dex_files[i].get(),
i,
- /*dex_container*/ nullptr,
+ /*dex_container=*/ nullptr,
&error_msg)) {
LOG(WARNING) << "Failed to run dex file " << i << " in " << file_name << " : " << error_msg;
}
diff --git a/dexlayout/dexlayout_main.cc b/dexlayout/dexlayout_main.cc
index 78a8dd6..d212e71 100644
--- a/dexlayout/dexlayout_main.cc
+++ b/dexlayout/dexlayout_main.cc
@@ -203,7 +203,7 @@
}
// Create DexLayout instance.
- DexLayout dex_layout(options, profile_info.get(), out_file, /*header*/ nullptr);
+ DexLayout dex_layout(options, profile_info.get(), out_file, /*header=*/ nullptr);
// Process all files supplied on command line.
int result = 0;
diff --git a/dexlayout/dexlayout_test.cc b/dexlayout/dexlayout_test.cc
index 187c687..54157d9 100644
--- a/dexlayout/dexlayout_test.cc
+++ b/dexlayout/dexlayout_test.cc
@@ -298,7 +298,7 @@
for (const std::string& dex_file : GetLibCoreDexFileNames()) {
std::vector<std::string> dexlayout_args =
{ "-w", tmp_dir, "-o", tmp_name, dex_file };
- if (!DexLayoutExec(dexlayout_args, error_msg, /*pass_default_cdex_option*/ false)) {
+ if (!DexLayoutExec(dexlayout_args, error_msg, /*pass_default_cdex_option=*/ false)) {
return false;
}
std::string dex_file_name = "classes.dex";
@@ -333,8 +333,8 @@
const ArtDexFileLoader dex_file_loader;
bool result = dex_file_loader.Open(input_dex.c_str(),
input_dex,
- /*verify*/ true,
- /*verify_checksum*/ false,
+ /*verify=*/ true,
+ /*verify_checksum=*/ false,
&error_msg,
&dex_files);
@@ -359,7 +359,7 @@
pfi.AddMethodIndex(static_cast<ProfileCompilationInfo::MethodHotness::Flag>(flags),
dex_location,
dex_file->GetLocationChecksum(),
- /*dex_method_idx*/i,
+ /*method_idx=*/i,
dex_file->NumMethodIds());
}
DexCacheResolvedClasses cur_classes(dex_location,
@@ -447,7 +447,7 @@
// -v makes sure that the layout did not corrupt the dex file.
std::vector<std::string> dexlayout_args =
{ "-i", "-v", "-w", tmp_dir, "-o", tmp_name, "-p", profile_file, dex_file };
- if (!DexLayoutExec(dexlayout_args, error_msg, /*pass_default_cdex_option*/ false)) {
+ if (!DexLayoutExec(dexlayout_args, error_msg, /*pass_default_cdex_option=*/ false)) {
return false;
}
@@ -459,7 +459,7 @@
// -i since the checksum won't match from the first layout.
std::vector<std::string> second_dexlayout_args =
{ "-i", "-v", "-w", tmp_dir, "-o", tmp_name, "-p", profile_file, output_dex };
- if (!DexLayoutExec(second_dexlayout_args, error_msg, /*pass_default_cdex_option*/ false)) {
+ if (!DexLayoutExec(second_dexlayout_args, error_msg, /*pass_default_cdex_option=*/ false)) {
return false;
}
@@ -493,7 +493,7 @@
std::string output_dex = tmp_dir + "classes.dex.new";
std::vector<std::string> dexlayout_args = { "-w", tmp_dir, "-o", "/dev/null", input_dex };
- if (!DexLayoutExec(dexlayout_args, error_msg, /*pass_default_cdex_option*/ false)) {
+ if (!DexLayoutExec(dexlayout_args, error_msg, /*pass_default_cdex_option=*/ false)) {
return false;
}
@@ -615,7 +615,7 @@
{ "-a", "-i", "-o", "/dev/null", temp_dex.GetFilename() };
ASSERT_TRUE(DexLayoutExec(&temp_dex,
kDexFileDuplicateOffset,
- nullptr /* profile_file */,
+ /* profile_file= */ nullptr,
dexlayout_args));
}
@@ -624,7 +624,7 @@
std::vector<std::string> dexlayout_args = { "-o", "/dev/null", temp_dex.GetFilename() };
ASSERT_TRUE(DexLayoutExec(&temp_dex,
kNullSetRefListElementInputDex,
- nullptr /* profile_file */,
+ /* profile_file= */ nullptr,
dexlayout_args));
}
@@ -666,7 +666,7 @@
std::vector<std::string> dexlayout_args = { "-o", "/dev/null", temp_dex.GetFilename() };
ASSERT_TRUE(DexLayoutExec(&temp_dex,
kUnknownTypeDebugInfoInputDex,
- nullptr /* profile_file */,
+ /* profile_file= */ nullptr,
dexlayout_args));
}
@@ -675,7 +675,7 @@
std::vector<std::string> dexlayout_args = { "-o", "/dev/null", temp_dex.GetFilename() };
ASSERT_TRUE(DexLayoutExec(&temp_dex,
kDuplicateCodeItemInputDex,
- nullptr /* profile_file */,
+ /* profile_file= */ nullptr,
dexlayout_args));
}
@@ -734,7 +734,7 @@
};
// -v makes sure that the layout did not corrupt the dex file.
ASSERT_TRUE(DexLayoutExec(&temp_dex,
- /*dex_filename*/ nullptr,
+ /*dex_filename=*/ nullptr,
&profile_file,
dexlayout_args));
ASSERT_TRUE(UnlinkFile(temp_dex.GetFilename() + ".new"));
@@ -772,7 +772,7 @@
};
// -v makes sure that the layout did not corrupt the dex file.
ASSERT_TRUE(DexLayoutExec(&temp_dex,
- /*dex_filename*/ nullptr,
+ /*dex_filename=*/ nullptr,
&profile_file,
dexlayout_args));
ASSERT_TRUE(UnlinkFile(temp_dex.GetFilename() + ".new"));
@@ -785,8 +785,8 @@
const std::string input_jar = GetTestDexFileName("ManyMethods");
CHECK(dex_file_loader.Open(input_jar.c_str(),
input_jar.c_str(),
- /*verify*/ true,
- /*verify_checksum*/ true,
+ /*verify=*/ true,
+ /*verify_checksum=*/ true,
&error_msg,
&dex_files)) << error_msg;
ASSERT_EQ(dex_files.size(), 1u);
@@ -800,14 +800,14 @@
// Filter out all the classes other than the one below based on class descriptor.
options.class_filter_.insert("LManyMethods$Strings;");
DexLayout dexlayout(options,
- /*info*/ nullptr,
- /*out_file*/ nullptr,
- /*header*/ nullptr);
+ /*info=*/ nullptr,
+ /*out_file=*/ nullptr,
+ /*header=*/ nullptr);
std::unique_ptr<DexContainer> out;
bool result = dexlayout.ProcessDexFile(
dex_file->GetLocation().c_str(),
dex_file.get(),
- /*dex_file_index*/ 0,
+ /*dex_file_index=*/ 0,
&out,
&error_msg);
ASSERT_TRUE(result) << "Failed to run dexlayout " << error_msg;
@@ -818,10 +818,10 @@
out->GetDataSection()->Begin(),
out->GetDataSection()->Size(),
dex_file->GetLocation().c_str(),
- /* checksum */ 0,
- /*oat_dex_file*/ nullptr,
- /* verify */ true,
- /*verify_checksum*/ false,
+ /* location_checksum= */ 0,
+ /*oat_dex_file=*/ nullptr,
+ /* verify= */ true,
+ /*verify_checksum=*/ false,
&error_msg));
ASSERT_TRUE(output_dex_file != nullptr);
diff --git a/dexlist/dexlist.cc b/dexlist/dexlist.cc
index 067daa7..adb6a54 100644
--- a/dexlist/dexlist.cc
+++ b/dexlist/dexlist.cc
@@ -172,7 +172,7 @@
if (!dex_file_loader.OpenAll(reinterpret_cast<const uint8_t*>(content.data()),
content.size(),
fileName,
- /*verify*/ true,
+ /*verify=*/ true,
kVerifyChecksum,
&error_code,
&error_msg,
diff --git a/dexoptanalyzer/dexoptanalyzer.cc b/dexoptanalyzer/dexoptanalyzer.cc
index 10bb673..21cdcf1 100644
--- a/dexoptanalyzer/dexoptanalyzer.cc
+++ b/dexoptanalyzer/dexoptanalyzer.cc
@@ -251,8 +251,8 @@
std::unique_ptr<OatFileAssistant> oat_file_assistant;
oat_file_assistant = std::make_unique<OatFileAssistant>(dex_file_.c_str(),
isa_,
- false /*load_executable*/,
- false /*only_load_system_executable*/,
+ /*load_executable=*/ false,
+ /*only_load_system_executable=*/ false,
vdex_fd_,
oat_fd_,
zip_fd_);
diff --git a/dexoptanalyzer/dexoptanalyzer_test.cc b/dexoptanalyzer/dexoptanalyzer_test.cc
index 93ebf2b..fe29fa1 100644
--- a/dexoptanalyzer/dexoptanalyzer_test.cc
+++ b/dexoptanalyzer/dexoptanalyzer_test.cc
@@ -73,7 +73,7 @@
bool downgrade = false) {
int dexoptanalyzerResult = Analyze(dex_file, compiler_filter, assume_profile_changed);
dexoptanalyzerResult = DexoptanalyzerToOatFileAssistant(dexoptanalyzerResult);
- OatFileAssistant oat_file_assistant(dex_file.c_str(), kRuntimeISA, /*load_executable*/ false);
+ OatFileAssistant oat_file_assistant(dex_file.c_str(), kRuntimeISA, /*load_executable=*/ false);
int assistantResult = oat_file_assistant.GetDexOptNeeded(
compiler_filter, assume_profile_changed, downgrade);
EXPECT_EQ(assistantResult, dexoptanalyzerResult);
@@ -175,7 +175,7 @@
Copy(GetDexSrc1(), dex_location);
GenerateOatForTest(dex_location.c_str(),
CompilerFilter::kSpeed,
- /*with_alternate_image*/true);
+ /*with_alternate_image=*/true);
Verify(dex_location, CompilerFilter::kExtract);
Verify(dex_location, CompilerFilter::kQuicken);
@@ -192,7 +192,7 @@
Copy(GetDexSrc1(), dex_location);
GenerateOatForTest(dex_location.c_str(),
CompilerFilter::kExtract,
- /*with_alternate_image*/true);
+ /*with_alternate_image=*/true);
Verify(dex_location, CompilerFilter::kExtract);
Verify(dex_location, CompilerFilter::kQuicken);
diff --git a/disassembler/disassembler.cc b/disassembler/disassembler.cc
index 2ed41c8..262e815 100644
--- a/disassembler/disassembler.cc
+++ b/disassembler/disassembler.cc
@@ -41,9 +41,9 @@
} else if (instruction_set == InstructionSet::kArm64) {
return new arm64::DisassemblerArm64(options);
} else if (instruction_set == InstructionSet::kMips) {
- return new mips::DisassemblerMips(options, /* is_o32_abi */ true);
+ return new mips::DisassemblerMips(options, /* is_o32_abi= */ true);
} else if (instruction_set == InstructionSet::kMips64) {
- return new mips::DisassemblerMips(options, /* is_o32_abi */ false);
+ return new mips::DisassemblerMips(options, /* is_o32_abi= */ false);
} else if (instruction_set == InstructionSet::kX86) {
return new x86::DisassemblerX86(options, false);
} else if (instruction_set == InstructionSet::kX86_64) {
diff --git a/imgdiag/imgdiag.cc b/imgdiag/imgdiag.cc
index 245a15b..a1edd00 100644
--- a/imgdiag/imgdiag.cc
+++ b/imgdiag/imgdiag.cc
@@ -1007,7 +1007,7 @@
begin_image_ptr,
RegionCommon<T>::remote_contents_,
base_ptr,
- /*log_dirty_objects*/true);
+ /*log_dirty_objects=*/true);
// Print shared dirty after since it's less important.
if (RegionCommon<T>::GetZygoteDirtyEntryCount() != 0) {
// We only reach this point if both pids were specified. Furthermore,
@@ -1019,7 +1019,7 @@
begin_image_ptr,
RegionCommon<T>::zygote_contents_,
begin_image_ptr,
- /*log_dirty_objects*/false);
+ /*log_dirty_objects=*/false);
}
RegionSpecializedBase<T>::DumpDirtyObjects();
RegionSpecializedBase<T>::DumpDirtyEntries();
diff --git a/libartbase/base/unix_file/fd_file.h b/libartbase/base/unix_file/fd_file.h
index 54a16a2..f5aa2a5 100644
--- a/libartbase/base/unix_file/fd_file.h
+++ b/libartbase/base/unix_file/fd_file.h
@@ -37,13 +37,13 @@
FdFile() = default;
// Creates an FdFile using the given file descriptor.
// Takes ownership of the file descriptor.
- FdFile(int fd, bool checkUsage);
- FdFile(int fd, const std::string& path, bool checkUsage);
- FdFile(int fd, const std::string& path, bool checkUsage, bool read_only_mode);
+ FdFile(int fd, bool check_usage);
+ FdFile(int fd, const std::string& path, bool check_usage);
+ FdFile(int fd, const std::string& path, bool check_usage, bool read_only_mode);
- FdFile(const std::string& path, int flags, bool checkUsage)
- : FdFile(path, flags, 0640, checkUsage) {}
- FdFile(const std::string& path, int flags, mode_t mode, bool checkUsage);
+ FdFile(const std::string& path, int flags, bool check_usage)
+ : FdFile(path, flags, 0640, check_usage) {}
+ FdFile(const std::string& path, int flags, mode_t mode, bool check_usage);
// Move constructor.
FdFile(FdFile&& other) noexcept;
diff --git a/libdexfile/dex/type_reference.h b/libdexfile/dex/type_reference.h
index 9e7b880..3207e32 100644
--- a/libdexfile/dex/type_reference.h
+++ b/libdexfile/dex/type_reference.h
@@ -31,8 +31,8 @@
// A type is located by its DexFile and the string_ids_ table index into that DexFile.
class TypeReference : public DexFileReference {
public:
- TypeReference(const DexFile* file, dex::TypeIndex index)
- : DexFileReference(file, index.index_) {}
+ TypeReference(const DexFile* dex_file, dex::TypeIndex index)
+ : DexFileReference(dex_file, index.index_) {}
dex::TypeIndex TypeIndex() const {
return dex::TypeIndex(index);
diff --git a/oatdump/oatdump.cc b/oatdump/oatdump.cc
index d30ec31..6f70efc 100644
--- a/oatdump/oatdump.cc
+++ b/oatdump/oatdump.cc
@@ -224,7 +224,7 @@
debug::WriteDebugInfo(builder_.get(),
debug_info,
dwarf::DW_DEBUG_FRAME_FORMAT,
- true /* write_oat_patches */);
+ /* write_oat_patches= */ true);
builder_->End();
@@ -401,7 +401,7 @@
options_.absolute_addresses_,
oat_file.Begin(),
oat_file.End(),
- true /* can_read_literals_ */,
+ /* can_read_literals_= */ true,
Is64BitInstructionSet(instruction_set_)
? &Thread::DumpThreadOffset<PointerSize::k64>
: &Thread::DumpThreadOffset<PointerSize::k32>))) {
@@ -640,7 +640,7 @@
Options options;
options.compact_dex_level_ = CompactDexLevel::kCompactDexLevelNone;
options.update_checksum_ = true;
- DexLayout dex_layout(options, /*info*/ nullptr, /*out_file*/ nullptr, /*header*/ nullptr);
+ DexLayout dex_layout(options, /*info=*/ nullptr, /*out_file=*/ nullptr, /*header=*/ nullptr);
std::unique_ptr<art::DexContainer> dex_container;
bool result = dex_layout.ProcessDexFile(vdex_dex_file->GetLocation().c_str(),
vdex_dex_file.get(),
@@ -661,9 +661,9 @@
main_section->Size(),
vdex_dex_file->GetLocation(),
vdex_file->GetLocationChecksum(i),
- nullptr /*oat_dex_file*/,
- false /*verify*/,
- true /*verify_checksum*/,
+ /*oat_dex_file=*/ nullptr,
+ /*verify=*/ false,
+ /*verify_checksum=*/ true,
&error_msg));
if (dex == nullptr) {
os << "Failed to load DexFile from layout container: " + error_msg;
@@ -676,12 +676,12 @@
break;
}
- if (!ExportDexFile(os, *oat_dex_file, dex.get(), true /*used_dexlayout*/)) {
+ if (!ExportDexFile(os, *oat_dex_file, dex.get(), /*used_dexlayout=*/ true)) {
success = false;
break;
}
} else {
- if (!ExportDexFile(os, *oat_dex_file, vdex_dex_file.get(), false /*used_dexlayout*/)) {
+ if (!ExportDexFile(os, *oat_dex_file, vdex_dex_file.get(), /*used_dexlayout=*/ false)) {
success = false;
break;
}
@@ -764,8 +764,8 @@
PROT_READ | PROT_WRITE,
MAP_PRIVATE,
file->Fd(),
- /* start offset */ 0,
- /* low_4gb */ false,
+ /* start offset= */ 0,
+ /* low_4gb= */ false,
vdex_filename.c_str(),
error_msg);
if (!mmap.IsValid()) {
@@ -786,7 +786,7 @@
}
vdex_file->Unquicken(MakeNonOwningPointerVector(tmp_dex_files),
- /* decompile_return_instruction */ true);
+ /* decompile_return_instruction= */ true);
*dex_files = std::move(tmp_dex_files);
return vdex_file;
@@ -1514,7 +1514,7 @@
}
return verifier::MethodVerifier::VerifyMethodAndDump(
soa.Self(), vios, dex_method_idx, dex_file, dex_cache, *options_.class_loader_,
- class_def, code_item, method, method_access_flags, /* api_level */ 0);
+ class_def, code_item, method, method_access_flags, /* api_level= */ 0);
}
return nullptr;
@@ -1862,14 +1862,14 @@
oat_file = runtime->GetOatFileManager().FindOpenedOatFileFromOatLocation(oat_location);
}
if (oat_file == nullptr) {
- oat_file = OatFile::Open(/* zip_fd */ -1,
+ oat_file = OatFile::Open(/* zip_fd= */ -1,
oat_location,
oat_location,
- /* requested_base */ nullptr,
- /* executable */ false,
- /* low_4gb */ false,
- /* abs_dex_location */ nullptr,
- /* reservation */ nullptr,
+ /* requested_base= */ nullptr,
+ /* executable= */ false,
+ /* low_4gb= */ false,
+ /* abs_dex_location= */ nullptr,
+ /* reservation= */ nullptr,
&error_msg);
}
if (oat_file == nullptr) {
@@ -2760,14 +2760,14 @@
// We need to map the oat file in the low 4gb or else the fixup wont be able to fit oat file
// pointers into 32 bit pointer sized ArtMethods.
std::string error_msg;
- std::unique_ptr<OatFile> oat_file(OatFile::Open(/* zip_fd */ -1,
+ std::unique_ptr<OatFile> oat_file(OatFile::Open(/* zip_fd= */ -1,
options->app_oat_,
options->app_oat_,
- /* requested_base */ nullptr,
- /* executable */ false,
- /* low_4gb */ true,
- /* abs_dex_location */ nullptr,
- /* reservation */ nullptr,
+ /* requested_base= */ nullptr,
+ /* executable= */ false,
+ /* low_4gb= */ true,
+ /* abs_dex_location= */ nullptr,
+ /* reservation= */ nullptr,
&error_msg));
if (oat_file == nullptr) {
LOG(ERROR) << "Failed to open oat file " << options->app_oat_ << " with error " << error_msg;
@@ -2884,14 +2884,14 @@
<< "oatdump might fail if the oat file does not contain the dex code.";
}
std::string error_msg;
- std::unique_ptr<OatFile> oat_file(OatFile::Open(/* zip_fd */ -1,
+ std::unique_ptr<OatFile> oat_file(OatFile::Open(/* zip_fd= */ -1,
oat_filename,
oat_filename,
- /* requested_base */ nullptr,
- /* executable */ false,
- /* low_4gb */ false,
+ /* requested_base= */ nullptr,
+ /* executable= */ false,
+ /* low_4gb= */ false,
dex_filename,
- /* reservation */ nullptr,
+ /* reservation= */ nullptr,
&error_msg));
if (oat_file == nullptr) {
LOG(ERROR) << "Failed to open oat file from '" << oat_filename << "': " << error_msg;
@@ -2910,14 +2910,14 @@
std::string& output_name,
bool no_bits) {
std::string error_msg;
- std::unique_ptr<OatFile> oat_file(OatFile::Open(/* zip_fd */ -1,
+ std::unique_ptr<OatFile> oat_file(OatFile::Open(/* zip_fd= */ -1,
oat_filename,
oat_filename,
- /* requested_base */ nullptr,
- /* executable */ false,
- /* low_4gb */ false,
+ /* requested_base= */ nullptr,
+ /* executable= */ false,
+ /* low_4gb= */ false,
dex_filename,
- /* reservation */ nullptr,
+ /* reservation= */ nullptr,
&error_msg));
if (oat_file == nullptr) {
LOG(ERROR) << "Failed to open oat file from '" << oat_filename << "': " << error_msg;
@@ -2958,14 +2958,14 @@
if (oat_filename != nullptr) {
std::string error_msg;
- std::unique_ptr<OatFile> oat_file(OatFile::Open(/* zip_fd */ -1,
+ std::unique_ptr<OatFile> oat_file(OatFile::Open(/* zip_fd= */ -1,
oat_filename,
oat_filename,
- /* requested_base */ nullptr,
- /* executable */ false,
- /*low_4gb*/false,
+ /* requested_base= */ nullptr,
+ /* executable= */ false,
+ /*low_4gb=*/false,
dex_filename,
- /* reservation */ nullptr,
+ /* reservation= */ nullptr,
&error_msg));
if (oat_file == nullptr) {
LOG(ERROR) << "Failed to open oat file from '" << oat_filename << "': " << error_msg;
diff --git a/oatdump/oatdump_test.cc b/oatdump/oatdump_test.cc
index bcba182..e6936f6 100644
--- a/oatdump/oatdump_test.cc
+++ b/oatdump/oatdump_test.cc
@@ -93,8 +93,8 @@
ASSERT_TRUE(Exec(kDynamic, kModeOat, {"--export-dex-to=" + tmp_dir_}, kListOnly));
const std::string dex_location = tmp_dir_+ "/core-oj-hostdex.jar_export.dex";
const std::string dexdump2 = GetExecutableFilePath("dexdump2",
- /*is_debug*/false,
- /*is_static*/false);
+ /*is_debug=*/false,
+ /*is_static=*/false);
std::string output;
auto post_fork_fn = []() { return true; };
ForkAndExecResult res = ForkAndExec({dexdump2, "-d", dex_location}, post_fork_fn, &output);
diff --git a/profman/boot_image_profile.cc b/profman/boot_image_profile.cc
index 6715680..4d8eef9 100644
--- a/profman/boot_image_profile.cc
+++ b/profman/boot_image_profile.cc
@@ -38,7 +38,7 @@
// Avoid merging classes since we may want to only add classes that fit a certain criteria.
// If we merged the classes, every single class in each profile would be in the out_profile,
// but we want to only included classes that are in at least a few profiles.
- out_profile->MergeWith(*profile, /*merge_classes*/ false);
+ out_profile->MergeWith(*profile, /*merge_classes=*/ false);
}
// Image classes that were added because they are commonly used.
@@ -96,7 +96,7 @@
is_clean = false;
}
},
- /*instance_fields*/ VoidFunctor(),
+ /*instance_field_visitor=*/ VoidFunctor(),
method_visitor,
method_visitor);
diff --git a/profman/profile_assistant.cc b/profman/profile_assistant.cc
index b509fb4..4dc5262 100644
--- a/profman/profile_assistant.cc
+++ b/profman/profile_assistant.cc
@@ -37,7 +37,7 @@
ProfileCompilationInfo info;
// Load the reference profile.
- if (!info.Load(reference_profile_file->Fd(), /*merge_classes*/ true, filter_fn)) {
+ if (!info.Load(reference_profile_file->Fd(), /*merge_classes=*/ true, filter_fn)) {
LOG(WARNING) << "Could not load reference profile file";
return kErrorBadProfiles;
}
@@ -49,7 +49,7 @@
// Merge all current profiles.
for (size_t i = 0; i < profile_files.size(); i++) {
ProfileCompilationInfo cur_info;
- if (!cur_info.Load(profile_files[i]->Fd(), /*merge_classes*/ true, filter_fn)) {
+ if (!cur_info.Load(profile_files[i]->Fd(), /*merge_classes=*/ true, filter_fn)) {
LOG(WARNING) << "Could not load profile file at index " << i;
return kErrorBadProfiles;
}
@@ -92,7 +92,7 @@
// Will block until all the locks are acquired.
bool Init(const std::vector<std::string>& filenames, /* out */ std::string* error) {
for (size_t i = 0; i < filenames.size(); i++) {
- flocks_[i] = LockedFile::Open(filenames[i].c_str(), O_RDWR, /* block */ true, error);
+ flocks_[i] = LockedFile::Open(filenames[i].c_str(), O_RDWR, /* block= */ true, error);
if (flocks_[i].get() == nullptr) {
*error += " (index=" + std::to_string(i) + ")";
return false;
@@ -106,7 +106,7 @@
for (size_t i = 0; i < fds.size(); i++) {
DCHECK_GE(fds[i], 0);
flocks_[i] = LockedFile::DupOf(fds[i], "profile-file",
- true /* read_only_mode */, error);
+ /* read_only_mode= */ true, error);
if (flocks_[i].get() == nullptr) {
*error += " (index=" + std::to_string(i) + ")";
return false;
@@ -138,7 +138,7 @@
// cleared after processing.
ScopedFlock reference_profile_file = LockedFile::DupOf(reference_profile_file_fd,
"reference-profile",
- false /* read_only_mode */,
+ /* read_only_mode= */ false,
&error);
if (reference_profile_file.get() == nullptr) {
LOG(WARNING) << "Could not lock reference profiled files: " << error;
@@ -163,7 +163,7 @@
}
ScopedFlock locked_reference_profile_file = LockedFile::Open(
- reference_profile_file.c_str(), O_RDWR, /* block */ true, &error);
+ reference_profile_file.c_str(), O_RDWR, /* block= */ true, &error);
if (locked_reference_profile_file.get() == nullptr) {
LOG(WARNING) << "Could not lock reference profile files: " << error;
return kErrorCannotLock;
diff --git a/profman/profile_assistant_test.cc b/profman/profile_assistant_test.cc
index f9707d3..31dfbc0 100644
--- a/profman/profile_assistant_test.cc
+++ b/profman/profile_assistant_test.cc
@@ -720,7 +720,7 @@
ASSERT_TRUE(info.Load(GetFd(profile_file)));
// Verify that the profile has matching methods.
ScopedObjectAccess soa(Thread::Current());
- ObjPtr<mirror::Class> klass = GetClass(soa, /* class_loader */ nullptr, "Ljava/lang/Math;");
+ ObjPtr<mirror::Class> klass = GetClass(soa, /* class_loader= */ nullptr, "Ljava/lang/Math;");
ASSERT_TRUE(klass != nullptr);
size_t method_count = 0;
for (ArtMethod& method : klass->GetMethods(kRuntimePointerSize)) {
@@ -932,8 +932,8 @@
AssertInlineCaches(inline_monomorphic,
expected_monomorphic,
info,
- /*megamorphic*/false,
- /*missing_types*/false);
+ /*is_megamorphic=*/false,
+ /*is_missing_types=*/false);
}
{
@@ -949,8 +949,8 @@
AssertInlineCaches(inline_polymorhic,
expected_polymorphic,
info,
- /*megamorphic*/false,
- /*missing_types*/false);
+ /*is_megamorphic=*/false,
+ /*is_missing_types=*/false);
}
{
@@ -963,8 +963,8 @@
AssertInlineCaches(inline_megamorphic,
expected_megamorphic,
info,
- /*megamorphic*/true,
- /*missing_types*/false);
+ /*is_megamorphic=*/true,
+ /*is_missing_types=*/false);
}
{
@@ -977,8 +977,8 @@
AssertInlineCaches(inline_missing_types,
expected_missing_Types,
info,
- /*megamorphic*/false,
- /*missing_types*/true);
+ /*is_megamorphic=*/false,
+ /*is_missing_types=*/true);
}
{
@@ -1005,7 +1005,7 @@
const uint16_t kNumberOfMethodsToEnableCompilation = 100;
ProfileCompilationInfo info1;
SetupProfile("p1", 1, kNumberOfMethodsToEnableCompilation, 0, profile1, &info1,
- /*start_method_index*/0, /*reverse_dex_write_order*/false);
+ /*start_method_index=*/0, /*reverse_dex_write_order=*/false);
// The reference profile info will contain the methods with indices 50-150.
// When setting up the profile reverse the order in which the dex files
@@ -1014,7 +1014,7 @@
const uint16_t kNumberOfMethodsAlreadyCompiled = 100;
ProfileCompilationInfo reference_info;
SetupProfile("p1", 1, kNumberOfMethodsAlreadyCompiled, 0, reference_profile,
- &reference_info, kNumberOfMethodsToEnableCompilation / 2, /*reverse_dex_write_order*/true);
+ &reference_info, kNumberOfMethodsToEnableCompilation / 2, /*reverse_dex_write_order=*/true);
// We should advise compilation.
ASSERT_EQ(ProfileAssistant::kCompile,
@@ -1233,9 +1233,9 @@
ProfileCompilationInfo info2_filter;
ProfileCompilationInfo expected;
- info2_filter.Load(profile1.GetFd(), /*merge_classes*/ true, filter_fn);
- info2_filter.Load(profile2.GetFd(), /*merge_classes*/ true, filter_fn);
- expected.Load(reference_profile.GetFd(), /*merge_classes*/ true, filter_fn);
+ info2_filter.Load(profile1.GetFd(), /*merge_classes=*/ true, filter_fn);
+ info2_filter.Load(profile2.GetFd(), /*merge_classes=*/ true, filter_fn);
+ expected.Load(reference_profile.GetFd(), /*merge_classes=*/ true, filter_fn);
ASSERT_TRUE(expected.MergeWith(info1_filter));
ASSERT_TRUE(expected.MergeWith(info2_filter));
@@ -1260,13 +1260,13 @@
"fake-location2",
d2.GetLocationChecksum(),
num_methods_to_add,
- /*num_classes*/ 0,
+ /*number_of_classes=*/ 0,
profile1,
&info1,
- /*start_method_index*/ 0,
- /*reverse_dex_write_order*/ false,
- /*number_of_methods1*/ d1.NumMethodIds(),
- /*number_of_methods2*/ d2.NumMethodIds());
+ /*start_method_index=*/ 0,
+ /*reverse_dex_write_order=*/ false,
+ /*number_of_methods1=*/ d1.NumMethodIds(),
+ /*number_of_methods2=*/ d2.NumMethodIds());
// Run profman and pass the dex file with --apk-fd.
android::base::unique_fd apk_fd(
diff --git a/profman/profman.cc b/profman/profman.cc
index 2b5bf48..d989c8c 100644
--- a/profman/profman.cc
+++ b/profman/profman.cc
@@ -427,7 +427,7 @@
if (use_apk_fd_list) {
if (dex_file_loader.OpenZip(apks_fd_[i],
dex_locations_[i],
- /* verify */ false,
+ /* verify= */ false,
kVerifyChecksum,
&error_msg,
&dex_files_for_location)) {
@@ -438,7 +438,7 @@
} else {
if (dex_file_loader.Open(apk_files_[i].c_str(),
dex_locations_[i],
- /* verify */ false,
+ /* verify= */ false,
kVerifyChecksum,
&error_msg,
&dex_files_for_location)) {
@@ -574,7 +574,7 @@
if (!FdIsValid(dump_output_to_fd_)) {
std::cout << dump;
} else {
- unix_file::FdFile out_fd(dump_output_to_fd_, false /*check_usage*/);
+ unix_file::FdFile out_fd(dump_output_to_fd_, /*check_usage=*/ false);
if (!out_fd.WriteFully(dump.c_str(), dump.length())) {
return -1;
}
@@ -700,7 +700,7 @@
if (!FdIsValid(dump_output_to_fd_)) {
std::cout << dump;
} else {
- unix_file::FdFile out_fd(dump_output_to_fd_, false /*check_usage*/);
+ unix_file::FdFile out_fd(dump_output_to_fd_, /*check_usage=*/ false);
if (!out_fd.WriteFully(dump.c_str(), dump.length())) {
return -1;
}
@@ -924,7 +924,7 @@
flags |= ProfileCompilationInfo::MethodHotness::kFlagPostStartup;
}
- TypeReference class_ref(/* dex_file */ nullptr, dex::TypeIndex());
+ TypeReference class_ref(/* dex_file= */ nullptr, dex::TypeIndex());
if (!FindClass(dex_files, klass, &class_ref)) {
LOG(WARNING) << "Could not find class: " << klass;
return false;
@@ -993,7 +993,7 @@
return false;
}
std::vector<TypeReference> classes(inline_cache_elems.size(),
- TypeReference(/* dex_file */ nullptr, dex::TypeIndex()));
+ TypeReference(/* dex_file= */ nullptr, dex::TypeIndex()));
size_t class_it = 0;
for (const std::string& ic_class : inline_cache_elems) {
if (!FindClass(dex_files, ic_class, &(classes[class_it++]))) {
@@ -1213,7 +1213,7 @@
// Do not clear if invalid. The input might be an archive.
bool load_ok = use_fds
? profile.Load(profile_files_fd_[0])
- : profile.Load(profile_files_[0], /*clear_if_invalid*/ false);
+ : profile.Load(profile_files_[0], /*clear_if_invalid=*/ false);
if (load_ok) {
// Open the dex files to look up classes and methods.
std::vector<std::unique_ptr<const DexFile>> dex_files;
@@ -1223,7 +1223,7 @@
}
bool result = use_fds
? profile.Save(reference_profile_file_fd_)
- : profile.Save(reference_profile_file_, /*bytes_written*/ nullptr);
+ : profile.Save(reference_profile_file_, /*bytes_written=*/ nullptr);
return result ? 0 : kErrorFailedToSaveProfile;
} else {
return kErrorFailedToLoadProfile;
diff --git a/tools/art_verifier/art_verifier.cc b/tools/art_verifier/art_verifier.cc
index 45c1a33..0ef6c06 100644
--- a/tools/art_verifier/art_verifier.cc
+++ b/tools/art_verifier/art_verifier.cc
@@ -46,8 +46,8 @@
std::string error_msg;
if (!dex_file_loader.Open(dex_filename.c_str(),
dex_filename.c_str(),
- /* verify */ true,
- /* verify_checksum */ true,
+ /* verify= */ true,
+ /* verify_checksum= */ true,
&error_msg,
dex_files)) {
LOG(ERROR) << error_msg;
diff --git a/tools/dexanalyze/dexanalyze_bytecode.cc b/tools/dexanalyze/dexanalyze_bytecode.cc
index 659a940..88db672 100644
--- a/tools/dexanalyze/dexanalyze_bytecode.cc
+++ b/tools/dexanalyze/dexanalyze_bytecode.cc
@@ -118,7 +118,7 @@
ProcessCodeItem(*dex_file,
method.GetInstructionsAndData(),
accessor.GetClassIdx(),
- /*count_types*/ true,
+ /*count_types=*/ true,
types);
}
}
@@ -143,7 +143,7 @@
ProcessCodeItem(*dex_file,
data,
accessor.GetClassIdx(),
- /*count_types*/ false,
+ /*count_types=*/ false,
types);
std::vector<uint8_t> buffer = std::move(buffer_);
buffer_.clear();
diff --git a/tools/dexanalyze/dexanalyze_test.cc b/tools/dexanalyze/dexanalyze_test.cc
index 96be3f9..c6648c0 100644
--- a/tools/dexanalyze/dexanalyze_test.cc
+++ b/tools/dexanalyze/dexanalyze_test.cc
@@ -37,23 +37,23 @@
};
TEST_F(DexAnalyzeTest, NoInputFileGiven) {
- DexAnalyzeExec({ "-a" }, /*expect_success*/ false);
+ DexAnalyzeExec({ "-a" }, /*expect_success=*/ false);
}
TEST_F(DexAnalyzeTest, CantOpenInput) {
- DexAnalyzeExec({ "-a", "/non/existent/path" }, /*expect_success*/ false);
+ DexAnalyzeExec({ "-a", "/non/existent/path" }, /*expect_success=*/ false);
}
TEST_F(DexAnalyzeTest, TestAnalyzeMultidex) {
- DexAnalyzeExec({ "-a", GetTestDexFileName("MultiDex") }, /*expect_success*/ true);
+ DexAnalyzeExec({ "-a", GetTestDexFileName("MultiDex") }, /*expect_success=*/ true);
}
TEST_F(DexAnalyzeTest, TestAnalizeCoreDex) {
- DexAnalyzeExec({ "-a", GetLibCoreDexFileNames()[0] }, /*expect_success*/ true);
+ DexAnalyzeExec({ "-a", GetLibCoreDexFileNames()[0] }, /*expect_success=*/ true);
}
TEST_F(DexAnalyzeTest, TestInvalidArg) {
- DexAnalyzeExec({ "-invalid-option" }, /*expect_success*/ false);
+ DexAnalyzeExec({ "-invalid-option" }, /*expect_success=*/ false);
}
} // namespace art
diff --git a/tools/field-null-percent/fieldnull.cc b/tools/field-null-percent/fieldnull.cc
index 1bd122a..8f5b389 100644
--- a/tools/field-null-percent/fieldnull.cc
+++ b/tools/field-null-percent/fieldnull.cc
@@ -167,7 +167,7 @@
}
static jint AgentStart(JavaVM* vm, char* options, bool is_onload) {
- android::base::InitLogging(/* argv */nullptr);
+ android::base::InitLogging(/* argv= */nullptr);
java_vm = vm;
jvmtiEnv* jvmti = nullptr;
if (SetupJvmtiEnv(vm, &jvmti) != JNI_OK) {
@@ -204,14 +204,14 @@
extern "C" JNIEXPORT jint JNICALL Agent_OnAttach(JavaVM *vm,
char* options,
void* reserved ATTRIBUTE_UNUSED) {
- return AgentStart(vm, options, /*is_onload*/false);
+ return AgentStart(vm, options, /*is_onload=*/false);
}
// Early attachment
extern "C" JNIEXPORT jint JNICALL Agent_OnLoad(JavaVM* jvm,
char* options,
void* reserved ATTRIBUTE_UNUSED) {
- return AgentStart(jvm, options, /*is_onload*/true);
+ return AgentStart(jvm, options, /*is_onload=*/true);
}
} // namespace fieldnull
diff --git a/tools/hiddenapi/hiddenapi.cc b/tools/hiddenapi/hiddenapi.cc
index 6d9b6fb..68211a1 100644
--- a/tools/hiddenapi/hiddenapi.cc
+++ b/tools/hiddenapi/hiddenapi.cc
@@ -278,7 +278,7 @@
if (open_writable) {
for (const std::string& filename : dex_paths) {
- File fd(filename.c_str(), O_RDWR, /* check_usage */ false);
+ File fd(filename.c_str(), O_RDWR, /* check_usage= */ false);
CHECK_NE(fd.Fd(), -1) << "Unable to open file '" << filename << "': " << strerror(errno);
// Memory-map the dex file with MAP_SHARED flag so that changes in memory
@@ -288,10 +288,10 @@
// We do those checks here and skip them when loading the processed file
// into boot class path.
std::unique_ptr<const DexFile> dex_file(dex_loader.OpenDex(fd.Release(),
- /* location */ filename,
- /* verify */ true,
- /* verify_checksum */ true,
- /* mmap_shared */ true,
+ /* location= */ filename,
+ /* verify= */ true,
+ /* verify_checksum= */ true,
+ /* mmap_shared= */ true,
&error_msg));
CHECK(dex_file.get() != nullptr) << "Open failed for '" << filename << "' " << error_msg;
CHECK(dex_file->IsStandardDexFile()) << "Expected a standard dex file '" << filename << "'";
@@ -302,9 +302,9 @@
} else {
for (const std::string& filename : dex_paths) {
bool success = dex_loader.Open(filename.c_str(),
- /* location */ filename,
- /* verify */ true,
- /* verify_checksum */ true,
+ /* location= */ filename,
+ /* verify= */ true,
+ /* verify_checksum= */ true,
&error_msg,
&dex_files_);
CHECK(success) << "Open failed for '" << filename << "' " << error_msg;
@@ -640,7 +640,7 @@
OpenApiFile(blacklist_path_, api_list, HiddenApiAccessFlags::kBlacklist);
// Open all dex files.
- ClassPath boot_classpath(boot_dex_paths_, /* open_writable */ true);
+ ClassPath boot_classpath(boot_dex_paths_, /* open_writable= */ true);
// Set access flags of all members.
boot_classpath.ForEachDexMember([&api_list](const DexMember& boot_member) {
@@ -688,7 +688,7 @@
std::set<std::string> unresolved;
// Open all dex files.
- ClassPath boot_classpath(boot_dex_paths_, /* open_writable */ false);
+ ClassPath boot_classpath(boot_dex_paths_, /* open_writable= */ false);
Hierarchy boot_hierarchy(boot_classpath);
// Mark all boot dex members private.
@@ -698,7 +698,7 @@
// Resolve each SDK dex member against the framework and mark it white.
for (const std::vector<std::string>& stub_classpath_dex : stub_classpaths_) {
- ClassPath stub_classpath(stub_classpath_dex, /* open_writable */ false);
+ ClassPath stub_classpath(stub_classpath_dex, /* open_writable= */ false);
Hierarchy stub_hierarchy(stub_classpath);
stub_classpath.ForEachDexMember(
[&stub_hierarchy, &boot_hierarchy, &boot_members, &unresolved](
diff --git a/tools/hiddenapi/hiddenapi_test.cc b/tools/hiddenapi/hiddenapi_test.cc
index b50f684..799546e 100644
--- a/tools/hiddenapi/hiddenapi_test.cc
+++ b/tools/hiddenapi/hiddenapi_test.cc
@@ -85,15 +85,15 @@
ArtDexFileLoader dex_loader;
std::string error_msg;
- File fd(file.GetFilename(), O_RDONLY, /* check_usage */ false);
+ File fd(file.GetFilename(), O_RDONLY, /* check_usage= */ false);
if (fd.Fd() == -1) {
LOG(FATAL) << "Unable to open file '" << file.GetFilename() << "': " << strerror(errno);
UNREACHABLE();
}
std::unique_ptr<const DexFile> dex_file(dex_loader.OpenDex(
- fd.Release(), /* location */ file.GetFilename(), /* verify */ false,
- /* verify_checksum */ true, /* mmap_shared */ false, &error_msg));
+ fd.Release(), /* location= */ file.GetFilename(), /* verify= */ false,
+ /* verify_checksum= */ true, /* mmap_shared= */ false, &error_msg));
if (dex_file.get() == nullptr) {
LOG(FATAL) << "Open failed for '" << file.GetFilename() << "' " << error_msg;
UNREACHABLE();
@@ -179,22 +179,31 @@
HiddenApiAccessFlags::ApiList GetIMethodHiddenFlags(const DexFile& dex_file) {
return GetMethodHiddenFlags(
- "imethod", 0, /* native */ false, FindClass("LMain;", dex_file), dex_file);
+ "imethod", 0, /* expected_native= */ false, FindClass("LMain;", dex_file), dex_file);
}
HiddenApiAccessFlags::ApiList GetSMethodHiddenFlags(const DexFile& dex_file) {
- return GetMethodHiddenFlags(
- "smethod", kAccPublic, /* native */ false, FindClass("LMain;", dex_file), dex_file);
+ return GetMethodHiddenFlags("smethod",
+ kAccPublic,
+ /* expected_native= */ false,
+ FindClass("LMain;", dex_file),
+ dex_file);
}
HiddenApiAccessFlags::ApiList GetINMethodHiddenFlags(const DexFile& dex_file) {
- return GetMethodHiddenFlags(
- "inmethod", kAccPublic, /* native */ true, FindClass("LMain;", dex_file), dex_file);
+ return GetMethodHiddenFlags("inmethod",
+ kAccPublic,
+ /* expected_native= */ true,
+ FindClass("LMain;", dex_file),
+ dex_file);
}
HiddenApiAccessFlags::ApiList GetSNMethodHiddenFlags(const DexFile& dex_file) {
- return GetMethodHiddenFlags(
- "snmethod", kAccProtected, /* native */ true, FindClass("LMain;", dex_file), dex_file);
+ return GetMethodHiddenFlags("snmethod",
+ kAccProtected,
+ /* expected_native= */ true,
+ FindClass("LMain;", dex_file),
+ dex_file);
}
};
diff --git a/tools/jit-load/jitload.cc b/tools/jit-load/jitload.cc
index d67eef0..7e715de 100644
--- a/tools/jit-load/jitload.cc
+++ b/tools/jit-load/jitload.cc
@@ -90,7 +90,7 @@
}
static jvmtiEnv* SetupJvmti(JavaVM* vm, const char* options) {
- android::base::InitLogging(/* argv */nullptr);
+ android::base::InitLogging(/* argv= */nullptr);
jvmtiEnv* jvmti = nullptr;
if (vm->GetEnv(reinterpret_cast<void**>(&jvmti), JVMTI_VERSION_1_0) != JNI_OK &&
diff --git a/tools/ti-fast/tifast.cc b/tools/ti-fast/tifast.cc
index 85c433b..00ef656 100644
--- a/tools/ti-fast/tifast.cc
+++ b/tools/ti-fast/tifast.cc
@@ -528,7 +528,7 @@
template<typename ...Args>
void LogPrinter::PrintRest(jvmtiEnv* jvmti, JNIEnv* jni, jclass klass, Args... args) {
ScopedClassInfo sci(jvmti, klass);
- if (sci.Init(/*get_generic*/event_ != JVMTI_EVENT_VM_OBJECT_ALLOC)) {
+ if (sci.Init(/*get_generic=*/event_ != JVMTI_EVENT_VM_OBJECT_ALLOC)) {
stream << ", jclass[" << sci << "]";
} else {
stream << ", jclass[TYPE UNKNOWN]";
diff --git a/tools/titrace/titrace.cc b/tools/titrace/titrace.cc
index ca568d7..1e49c0b 100644
--- a/tools/titrace/titrace.cc
+++ b/tools/titrace/titrace.cc
@@ -237,7 +237,7 @@
void* /* reserved */) {
using namespace titrace; // NOLINT [build/namespaces] [5]
- android::base::InitLogging(/* argv */nullptr);
+ android::base::InitLogging(/* argv= */nullptr);
jvmtiEnv* jvmti = nullptr;
{
diff --git a/tools/veridex/flow_analysis.cc b/tools/veridex/flow_analysis.cc
index 69f7def..e925e1d 100644
--- a/tools/veridex/flow_analysis.cc
+++ b/tools/veridex/flow_analysis.cc
@@ -318,7 +318,7 @@
case Instruction::INVOKE_STATIC:
case Instruction::INVOKE_SUPER:
case Instruction::INVOKE_VIRTUAL: {
- last_result_ = AnalyzeInvoke(instruction, /* is_range */ false);
+ last_result_ = AnalyzeInvoke(instruction, /* is_range= */ false);
break;
}
@@ -327,7 +327,7 @@
case Instruction::INVOKE_STATIC_RANGE:
case Instruction::INVOKE_SUPER_RANGE:
case Instruction::INVOKE_VIRTUAL_RANGE: {
- last_result_ = AnalyzeInvoke(instruction, /* is_range */ true);
+ last_result_ = AnalyzeInvoke(instruction, /* is_range= */ true);
break;
}
@@ -702,14 +702,14 @@
// second parameter for the field name.
RegisterValue cls = GetRegister(GetParameterAt(instruction, is_range, args, 0));
RegisterValue name = GetRegister(GetParameterAt(instruction, is_range, args, 1));
- uses_.push_back(ReflectAccessInfo(cls, name, /* is_method */ false));
+ uses_.push_back(ReflectAccessInfo(cls, name, /* is_method= */ false));
return GetReturnType(id);
} else if (IsGetMethod(method)) {
// Class.getMethod or Class.getDeclaredMethod. Fetch the first parameter for the class, and the
// second parameter for the field name.
RegisterValue cls = GetRegister(GetParameterAt(instruction, is_range, args, 0));
RegisterValue name = GetRegister(GetParameterAt(instruction, is_range, args, 1));
- uses_.push_back(ReflectAccessInfo(cls, name, /* is_method */ true));
+ uses_.push_back(ReflectAccessInfo(cls, name, /* is_method= */ true));
return GetReturnType(id);
} else if (method == VeriClass::getClass_) {
// Get the type of the first parameter.
diff --git a/tools/veridex/flow_analysis.h b/tools/veridex/flow_analysis.h
index 865b9df..2151a41 100644
--- a/tools/veridex/flow_analysis.h
+++ b/tools/veridex/flow_analysis.h
@@ -174,7 +174,8 @@
RegisterValue name;
bool is_method;
- ReflectAccessInfo(RegisterValue c, RegisterValue n, bool m) : cls(c), name(n), is_method(m) {}
+ ReflectAccessInfo(RegisterValue c, RegisterValue n, bool is_method)
+ : cls(c), name(n), is_method(is_method) {}
bool IsConcrete() const {
// We capture RegisterSource::kString for the class, for example in Class.forName.