mirror of
https://github.com/intel/llvm.git
synced 2026-01-16 05:32:28 +08:00
[Sanitizer][NFC] Replaces a few InternalScopedString::AppendF with InternalScopedString::Append (#80574)
This commit is contained in:
@@ -245,11 +245,11 @@ static void PrintAccessAndVarIntersection(const StackVarDescr &var, uptr addr,
|
||||
InternalScopedString str;
|
||||
str.AppendF(" [%zd, %zd)", var.beg, var_end);
|
||||
// Render variable name.
|
||||
str.AppendF(" '");
|
||||
str.Append(" '");
|
||||
for (uptr i = 0; i < var.name_len; ++i) {
|
||||
str.AppendF("%c", var.name_pos[i]);
|
||||
}
|
||||
str.AppendF("'");
|
||||
str.Append("'");
|
||||
if (var.line > 0) {
|
||||
str.AppendF(" (line %zd)", var.line);
|
||||
}
|
||||
@@ -260,7 +260,7 @@ static void PrintAccessAndVarIntersection(const StackVarDescr &var, uptr addr,
|
||||
str.AppendF("%s <== Memory access at offset %zd %s this variable%s\n",
|
||||
d.Location(), addr, pos_descr, d.Default());
|
||||
} else {
|
||||
str.AppendF("\n");
|
||||
str.Append("\n");
|
||||
}
|
||||
Printf("%s", str.data());
|
||||
}
|
||||
|
||||
@@ -388,7 +388,7 @@ static void PrintTagInfoAroundAddr(uptr addr, uptr num_rows,
|
||||
print_tag(s, row + i);
|
||||
s.Append(row + i == addr ? "]" : " ");
|
||||
}
|
||||
s.AppendF("\n");
|
||||
s.Append("\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -418,10 +418,10 @@ static void PrintTagsAroundAddr(uptr addr, GetTag get_tag,
|
||||
tag_t short_tag = get_short_tag(tag_addr);
|
||||
s.AppendF("%02x", short_tag);
|
||||
} else {
|
||||
s.AppendF("..");
|
||||
s.Append("..");
|
||||
}
|
||||
});
|
||||
s.AppendF(
|
||||
s.Append(
|
||||
"See "
|
||||
"https://clang.llvm.org/docs/"
|
||||
"HardwareAssistedAddressSanitizerDesign.html#short-granules for a "
|
||||
@@ -947,16 +947,16 @@ TailOverwrittenReport::~TailOverwrittenReport() {
|
||||
|
||||
InternalScopedString s;
|
||||
u8 *tail = tail_copy;
|
||||
s.AppendF("Tail contains: ");
|
||||
for (uptr i = 0; i < kShadowAlignment - tail_size; i++) s.AppendF(".. ");
|
||||
s.Append("Tail contains: ");
|
||||
for (uptr i = 0; i < kShadowAlignment - tail_size; i++) s.Append(".. ");
|
||||
for (uptr i = 0; i < tail_size; i++) s.AppendF("%02x ", tail[i]);
|
||||
s.AppendF("\n");
|
||||
s.AppendF("Expected: ");
|
||||
for (uptr i = 0; i < kShadowAlignment - tail_size; i++) s.AppendF(".. ");
|
||||
s.Append("\n");
|
||||
s.Append("Expected: ");
|
||||
for (uptr i = 0; i < kShadowAlignment - tail_size; i++) s.Append(".. ");
|
||||
for (uptr i = 0; i < tail_size; i++) s.AppendF("%02x ", actual_expected[i]);
|
||||
s.AppendF("\n");
|
||||
s.AppendF(" ");
|
||||
for (uptr i = 0; i < kShadowAlignment - tail_size; i++) s.AppendF(" ");
|
||||
s.Append("\n");
|
||||
s.Append(" ");
|
||||
for (uptr i = 0; i < kShadowAlignment - tail_size; i++) s.Append(" ");
|
||||
for (uptr i = 0; i < tail_size; i++)
|
||||
s.AppendF("%s ", actual_expected[i] != tail[i] ? "^^" : " ");
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ void DescribeThread(MemprofThreadContext *context) {
|
||||
InternalScopedString str;
|
||||
str.AppendF("Thread %s", MemprofThreadIdAndName(context).c_str());
|
||||
if (context->parent_tid == kInvalidTid) {
|
||||
str.AppendF(" created by unknown thread\n");
|
||||
str.Append(" created by unknown thread\n");
|
||||
Printf("%s", str.data());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ class StackTraceTextPrinter {
|
||||
|
||||
if (dedup_frames_-- > 0) {
|
||||
if (dedup_token_->length())
|
||||
dedup_token_->AppendF("--");
|
||||
dedup_token_->Append("--");
|
||||
if (stack->info.function)
|
||||
dedup_token_->Append(stack->info.function);
|
||||
}
|
||||
@@ -99,7 +99,7 @@ void StackTrace::PrintTo(InternalScopedString *output) const {
|
||||
output, &dedup_token);
|
||||
|
||||
if (trace == nullptr || size == 0) {
|
||||
output->AppendF(" <empty stack>\n\n");
|
||||
output->Append(" <empty stack>\n\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ void StackTrace::PrintTo(InternalScopedString *output) const {
|
||||
}
|
||||
|
||||
// Always add a trailing empty line after stack trace.
|
||||
output->AppendF("\n");
|
||||
output->Append("\n");
|
||||
|
||||
// Append deduplication token, if non-empty.
|
||||
if (dedup_token.length())
|
||||
@@ -198,7 +198,7 @@ void __sanitizer_symbolize_pc(uptr pc, const char *fmt, char *out_buf,
|
||||
StackTraceTextPrinter printer(fmt, '\0', &output, nullptr);
|
||||
if (!printer.ProcessAddressFrames(pc)) {
|
||||
output.clear();
|
||||
output.AppendF("<can't symbolize>");
|
||||
output.Append("<can't symbolize>");
|
||||
}
|
||||
CopyStringToBuffer(output, out_buf, out_buf_size);
|
||||
}
|
||||
|
||||
@@ -152,12 +152,12 @@ static void MaybeBuildIdToBuffer(const AddressInfo &info, bool PrefixSpace,
|
||||
InternalScopedString *buffer) {
|
||||
if (info.uuid_size) {
|
||||
if (PrefixSpace)
|
||||
buffer->AppendF(" ");
|
||||
buffer->AppendF("(BuildId: ");
|
||||
buffer->Append(" ");
|
||||
buffer->Append("(BuildId: ");
|
||||
for (uptr i = 0; i < info.uuid_size; ++i) {
|
||||
buffer->AppendF("%02x", info.uuid[i]);
|
||||
}
|
||||
buffer->AppendF(")");
|
||||
buffer->Append(")");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -249,7 +249,7 @@ void FormattedStackTracePrinter::RenderFrame(InternalScopedString *buffer,
|
||||
MaybeBuildIdToBuffer(*info, /*PrefixSpace=*/true, buffer);
|
||||
#endif
|
||||
} else {
|
||||
buffer->AppendF("(<unknown module>)");
|
||||
buffer->Append("(<unknown module>)");
|
||||
}
|
||||
break;
|
||||
case 'M':
|
||||
@@ -339,7 +339,7 @@ void StackTracePrinter::RenderSourceLocation(InternalScopedString *buffer,
|
||||
buffer->AppendF("%s(%d", StripPathPrefix(file, strip_path_prefix), line);
|
||||
if (column > 0)
|
||||
buffer->AppendF(",%d", column);
|
||||
buffer->AppendF(")");
|
||||
buffer->Append(")");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user