Switch the handful of std::endl users over to the predominant "\n".
(cherry picked from commit f6ee3605a88dec1114c60963a626aeec29d47220)
Change-Id: I8124de153cb34657d22fb8bbca37864ff2f7abe0
diff --git a/src/logging_linux.cc b/src/logging_linux.cc
index 84a6843..b90ec36 100644
--- a/src/logging_linux.cc
+++ b/src/logging_linux.cc
@@ -37,7 +37,7 @@
std::ostream& os(std::cerr);
os << "VDIWEFF"[data_->severity] << ' '
<< StringPrintf("%5d %5d", getpid(), ::art::GetTid()) << ' '
- << data_->file << ':' << data_->line_number << "] " << message << std::endl;
+ << data_->file << ':' << data_->line_number << "] " << message << "\n" << std::flush;
}
} // namespace art
diff --git a/src/oatdump.cc b/src/oatdump.cc
index 5d94ab6..de6285b 100644
--- a/src/oatdump.cc
+++ b/src/oatdump.cc
@@ -410,7 +410,7 @@
first = false;
}
}
- os << std::endl;
+ os << "\n";
}
void DumpGcMap(std::ostream& os, const uint8_t* gc_map_raw) {
@@ -435,7 +435,7 @@
}
}
}
- os << std::endl;
+ os << "\n";
}
}
@@ -458,7 +458,7 @@
os << ", ";
}
}
- os << "}" << std::endl << std::flush;
+ os << "}\n" << std::flush;
}
#if !defined(ART_USE_LLVM_COMPILER)
@@ -992,12 +992,11 @@
}
} else {
if (first) {
- os << "\nBig methods (size > " << i << " standard deviations the norm):"
- << std::endl;
+ os << "\nBig methods (size > " << i << " standard deviations the norm):\n";
first = false;
}
os << "\t" << PrettyMethod(method_outlier[j]) << " requires storage of "
- << PrettySize(cur_size) << std::endl;
+ << PrettySize(cur_size) << "\n";
method_outlier_size[j] = 0; // don't consider this method again
dumped_values++;
}
@@ -1007,9 +1006,9 @@
}
if (skipped_values > 0) {
os << "\t... skipped " << skipped_values
- << " methods with size > 1 standard deviation from the norm" << std::endl;
+ << " methods with size > 1 standard deviation from the norm\n";
}
- os << std::endl << std::flush;
+ os << std::flush;
// Dump methods whose expansion is a certain number of standard deviations from the mean
dumped_values = 0;
@@ -1033,11 +1032,11 @@
} else {
if (first) {
os << "\nLarge expansion methods (size > " << i
- << " standard deviations the norm):" << std::endl;
+ << " standard deviations the norm):\n";
first = false;
}
os << "\t" << PrettyMethod(method_outlier[j]) << " expanded code by "
- << cur_expansion << std::endl;
+ << cur_expansion << "\n";
method_outlier_expansion[j] = 0.0; // don't consider this method again
dumped_values++;
}
@@ -1047,21 +1046,21 @@
}
if (skipped_values > 0) {
os << "\t... skipped " << skipped_values
- << " methods with expansion > 1 standard deviation from the norm" << std::endl;
+ << " methods with expansion > 1 standard deviation from the norm\n";
}
- os << std::endl << std::flush;
+ os << "\n" << std::flush;
}
void Dump(std::ostream& os) {
- os << "\tart_file_bytes = " << PrettySize(file_bytes) << std::endl << std::endl
- << "\tart_file_bytes = header_bytes + object_bytes + alignment_bytes" << std::endl
+ os << "\tart_file_bytes = " << PrettySize(file_bytes) << "\n\n"
+ << "\tart_file_bytes = header_bytes + object_bytes + alignment_bytes\n"
<< StringPrintf("\theader_bytes = %8zd (%2.0f%% of art file bytes)\n"
"\tobject_bytes = %8zd (%2.0f%% of art file bytes)\n"
- "\talignment_bytes = %8zd (%2.0f%% of art file bytes)\n",
+ "\talignment_bytes = %8zd (%2.0f%% of art file bytes)\n\n",
header_bytes, PercentOfFileBytes(header_bytes),
object_bytes, PercentOfFileBytes(object_bytes),
alignment_bytes, PercentOfFileBytes(alignment_bytes))
- << std::endl << std::flush;
+ << std::flush;
CHECK_EQ(file_bytes, header_bytes + object_bytes + alignment_bytes);
@@ -1078,7 +1077,7 @@
average, percent);
object_bytes_total += it->second.bytes;
}
- os << std::endl << std::flush;
+ os << "\n" << std::flush;
CHECK_EQ(object_bytes, object_bytes_total);
os << StringPrintf("\tmanaged_code_bytes = %8zd (%2.0f%% of oat file bytes)\n"
@@ -1086,29 +1085,29 @@
"\tnative_to_managed_code_bytes = %8zd (%2.0f%% of oat file bytes)\n\n"
"\tclass_initializer_code_bytes = %8zd (%2.0f%% of oat file bytes)\n"
"\tlarge_initializer_code_bytes = %8zd (%2.0f%% of oat file bytes)\n"
- "\tlarge_method_code_bytes = %8zd (%2.0f%% of oat file bytes)\n",
+ "\tlarge_method_code_bytes = %8zd (%2.0f%% of oat file bytes)\n\n",
managed_code_bytes, PercentOfOatBytes(managed_code_bytes),
managed_to_native_code_bytes, PercentOfOatBytes(managed_to_native_code_bytes),
native_to_managed_code_bytes, PercentOfOatBytes(native_to_managed_code_bytes),
class_initializer_code_bytes, PercentOfOatBytes(class_initializer_code_bytes),
large_initializer_code_bytes, PercentOfOatBytes(large_initializer_code_bytes),
large_method_code_bytes, PercentOfOatBytes(large_method_code_bytes))
- << std::endl << std::flush;
+ << std::flush;
os << StringPrintf("\tgc_map_bytes = %7zd (%2.0f%% of oat file_bytes)\n"
"\tpc_mapping_table_bytes = %7zd (%2.0f%% of oat file_bytes)\n"
- "\tvmap_table_bytes = %7zd (%2.0f%% of oat file_bytes)\n",
+ "\tvmap_table_bytes = %7zd (%2.0f%% of oat file_bytes)\n\n",
gc_map_bytes, PercentOfOatBytes(gc_map_bytes),
pc_mapping_table_bytes, PercentOfOatBytes(pc_mapping_table_bytes),
vmap_table_bytes, PercentOfOatBytes(vmap_table_bytes))
- << std::endl << std::flush;
+ << std::flush;
os << StringPrintf("\tdex_instruction_bytes = %zd\n", dex_instruction_bytes);
- os << StringPrintf("\tmanaged_code_bytes expansion = %.2f (ignoring deduplication %.2f)\n",
- static_cast<double>(managed_code_bytes) / static_cast<double>(dex_instruction_bytes),
- static_cast<double>(managed_code_bytes_ignoring_deduplication) /
- static_cast<double>(dex_instruction_bytes));
- os << std::endl << std::flush;
+ << StringPrintf("\tmanaged_code_bytes expansion = %.2f (ignoring deduplication %.2f)\n\n",
+ static_cast<double>(managed_code_bytes) / static_cast<double>(dex_instruction_bytes),
+ static_cast<double>(managed_code_bytes_ignoring_deduplication) /
+ static_cast<double>(dex_instruction_bytes));
+ << std::flush;
DumpOutliers(os);
}
diff --git a/src/thread.cc b/src/thread.cc
index fe38c8e..01e0771 100644
--- a/src/thread.cc
+++ b/src/thread.cc
@@ -1788,7 +1788,7 @@
String* msg = exception->GetDetailMessage();
std::string str_msg(msg != NULL ? msg->ToModifiedUtf8() : "");
DumpStack(LOG(INFO) << "Delivering exception: " << PrettyTypeOf(exception)
- << ": " << str_msg << std::endl);
+ << ": " << str_msg << "\n");
}
Context* long_jump_context = GetLongJumpContext();
diff --git a/src/verifier/method_verifier.cc b/src/verifier/method_verifier.cc
index b79026d..bf6d600 100644
--- a/src/verifier/method_verifier.cc
+++ b/src/verifier/method_verifier.cc
@@ -267,7 +267,7 @@
// to hard fail.
if (verifier.failures_.size() != 0) {
verifier.DumpFailures(LOG(INFO) << "Soft verification failures in "
- << PrettyMethod(method_idx, *dex_file) << std::endl);
+ << PrettyMethod(method_idx, *dex_file) << "\n");
success = false;
}
} else {
@@ -275,9 +275,9 @@
CHECK_NE(verifier.failures_.size(), 0U);
CHECK(verifier.have_pending_hard_failure_);
verifier.DumpFailures(LOG(INFO) << "Verification error in "
- << PrettyMethod(method_idx, *dex_file) << std::endl);
+ << PrettyMethod(method_idx, *dex_file) << "\n");
if (gDebugVerify) {
- std::cout << std::endl << verifier.info_messages_.str();
+ std::cout << "\n" << verifier.info_messages_.str();
verifier.Dump(std::cout);
}
}
@@ -291,7 +291,7 @@
mh.GetClassDefIndex(), mh.GetCodeItem(), method->GetDexMethodIndex(),
method, method->GetAccessFlags());
verifier.Verify();
- verifier.DumpFailures(LOG(INFO) << "Dump of method " << PrettyMethod(method) << std::endl)
+ verifier.DumpFailures(LOG(INFO) << "Dump of method " << PrettyMethod(method) << "\n")
<< verifier.info_messages_.str() << Dumpable<MethodVerifier>(verifier);
}
@@ -973,7 +973,7 @@
std::ostream& MethodVerifier::DumpFailures(std::ostream& os) {
DCHECK_EQ(failures_.size(), failure_messages_.size());
for (size_t i = 0; i < failures_.size(); ++i) {
- os << failure_messages_[i]->str() << std::endl;
+ os << failure_messages_[i]->str() << "\n";
}
return os;
}
@@ -984,7 +984,7 @@
void MethodVerifier::Dump(std::ostream& os) {
if (code_item_ == NULL) {
- os << "Native method" << std::endl;
+ os << "Native method\n";
return;
}
DCHECK(code_item_ != NULL);
@@ -992,10 +992,10 @@
for (size_t dex_pc = 0; dex_pc < code_item_->insns_size_in_code_units_;
dex_pc += insn_flags_[dex_pc].GetLengthInCodeUnits()) {
os << StringPrintf("0x%04zx", dex_pc) << ": " << insn_flags_[dex_pc].Dump()
- << " " << inst->DumpHex(5) << " " << inst->DumpString(dex_file_) << std::endl;
+ << " " << inst->DumpHex(5) << " " << inst->DumpString(dex_file_) << "\n";
RegisterLine* reg_line = reg_table_.GetLine(dex_pc);
if (reg_line != NULL) {
- os << reg_line->Dump() << std::endl;
+ os << reg_line->Dump() << "\n";
}
inst = inst->Next();
}
@@ -1183,8 +1183,8 @@
Dump(std::cout);
std::cout << info_messages_.str();
LOG(FATAL) << "work_line diverged in " << PrettyMethod(method_idx_, *dex_file_)
- << "@" << reinterpret_cast<void*>(work_insn_idx_) << std::endl
- << " work_line=" << *work_line_ << std::endl
+ << "@" << reinterpret_cast<void*>(work_insn_idx_) << "\n"
+ << " work_line=" << *work_line_ << "\n"
<< " expected=" << *register_line;
}
}
@@ -1278,8 +1278,8 @@
bool just_set_result = false;
if (gDebugVerify) {
// Generate processing back trace to debug verifier
- LogVerifyInfo() << "Processing " << inst->DumpString(dex_file_) << std::endl
- << *work_line_.get() << std::endl;
+ LogVerifyInfo() << "Processing " << inst->DumpString(dex_file_) << "\n"
+ << *work_line_.get() << "\n";
}
/*
@@ -3091,7 +3091,7 @@
<< PrettyMethod(method_idx_, *dex_file_) << " "
<< failure_message->str();
if (gDebugVerify) {
- std::cout << std::endl << info_messages_.str();
+ std::cout << "\n" << info_messages_.str();
Dump(std::cout);
}
}
@@ -3117,10 +3117,10 @@
}
if (gDebugVerify && changed) {
LogVerifyInfo() << "Merging at [" << reinterpret_cast<void*>(work_insn_idx_) << "]"
- << " to [" << reinterpret_cast<void*>(next_insn) << "]: " << std::endl
- << *copy.get() << " MERGE" << std::endl
- << *merge_line << " ==" << std::endl
- << *target_line << std::endl;
+ << " to [" << reinterpret_cast<void*>(next_insn) << "]: " << "\n"
+ << *copy.get() << " MERGE\n"
+ << *merge_line << " ==\n"
+ << *target_line << "\n";
}
}
if (changed) {