Skip to content

Commit bc17496

Browse files
rmacnak-googleCommit Queue
authored andcommitted
[vm] Fix Google3 ClangTidy warnings.
TEST=presubmit Change-Id: Ifa4e77cc4548729526a90683ee163c68517e87ef Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/433001 Reviewed-by: Alexander Aprelev <[email protected]> Commit-Queue: Ryan Macnak <[email protected]>
1 parent 0404c6c commit bc17496

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+144
-145
lines changed

runtime/.clang-tidy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Checks: -*,readability-implicit-bool-conversion
1+
Checks: -*,readability-implicit-bool-conversion,bugprone-argument-comment

runtime/bin/elf_loader.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ DART_EXPORT Dart_LoadedElf* Dart_LoadELF_Memory(
487487
return nullptr;
488488
}
489489
std::unique_ptr<LoadedElf> elf(
490-
new LoadedElf(std::move(mappable), /*file_offset=*/0));
490+
new LoadedElf(std::move(mappable), /*elf_data_offset=*/0));
491491

492492
if (!elf->Load() ||
493493
!elf->ResolveSymbols(vm_snapshot_data, vm_snapshot_instrs,

runtime/bin/main_impl.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ static bool OnIsolateInitialize(void** child_callback_data, char** error) {
220220
const bool isolate_run_app_snapshot =
221221
isolate_group_data->RunFromAppSnapshot();
222222
Dart_Handle result = SetupCoreLibraries(isolate, isolate_data,
223-
/*group_start=*/false,
223+
/*is_isolate_group_start=*/false,
224224
/*is_kernel_isolate=*/false,
225225
/*resolved_packages_config=*/nullptr);
226226
if (Dart_IsError(result)) goto failed;

runtime/bin/run_vm_tests.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ static Dart_Isolate CreateAndSetupServiceIsolate(const char* script_uri,
149149

150150
// Load embedder specific bits and return.
151151
if (!bin::VmService::Setup("127.0.0.1", 0,
152-
/*dev_mode=*/false, /*auth_disabled=*/true,
152+
/*dev_mode_server=*/false,
153+
/*auth_codes_disabled=*/true,
153154
/*write_service_info_filename=*/"",
154155
/*trace_loading=*/false, /*deterministic=*/true,
155156
/*enable_service_port_fallback=*/false,

runtime/bin/secure_socket_filter.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,13 @@ void FUNCTION_NAME(SecureSocket_NewX509CertificateWrapper)(
162162
Dart_NativeArguments args) {
163163
// This is to be used only in conjunction with certificate trust evaluator
164164
// running asynchronously, which is only used on mac/ios at the moment.
165-
#if !defined(DART_HOST_OS_MACOS)
166-
FATAL("This is to be used only on mac/ios platforms");
167-
#endif
165+
#if defined(DART_HOST_OS_MACOS)
168166
intptr_t x509_pointer = DartUtils::GetNativeIntptrArgument(args, 0);
169167
X509* x509 = reinterpret_cast<X509*>(x509_pointer);
170168
Dart_SetReturnValue(args, X509Helper::WrappedX509Certificate(x509));
169+
#else
170+
FATAL("This is to be used only on mac/ios platforms");
171+
#endif
171172
}
172173

173174
void FUNCTION_NAME(SecureSocket_GetSelectedProtocol)(

runtime/bin/snapshot_utils.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,7 @@ void Snapshot::GenerateAppAOTAsAssembly(const char* snapshot_filename) {
945945
snapshot_filename);
946946
}
947947
Dart_Handle result = Dart_CreateAppAOTSnapshotAsAssembly(
948-
StreamingWriteCallback, file, /*strip=*/false,
948+
StreamingWriteCallback, file, /*stripped=*/false,
949949
/*debug_callback_data=*/nullptr);
950950
if (Dart_IsError(result)) {
951951
ErrorExit(kErrorExitCode, "%s\n", Dart_GetError(result));

runtime/lib/regexp.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ static ObjectPtr ExecuteMatch(Zone* zone,
167167
}
168168
#endif
169169
return BytecodeRegExpMacroAssembler::Interpret(regexp, subject, start_index,
170-
/*sticky=*/sticky, zone);
170+
/*is_sticky=*/sticky, zone);
171171
}
172172

173173
DEFINE_NATIVE_ENTRY(RegExp_ExecuteMatch, 0, 3) {

runtime/platform/utils.cc

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -359,27 +359,23 @@ void* Utils::LoadDynamicLibrary(const char* library_path,
359359
void* Utils::ResolveSymbolInDynamicLibrary(void* library_handle,
360360
const char* symbol,
361361
char** error) {
362-
void* result = nullptr;
363-
364362
#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_MACOS) || \
365363
defined(DART_HOST_OS_ANDROID) || defined(DART_HOST_OS_FUCHSIA)
366364
dlerror(); // Clear any errors.
367-
result = dlsym(library_handle, symbol);
365+
void* result = dlsym(library_handle, symbol);
368366
// Note: nullptr might be a valid return from dlsym. Must call dlerror
369367
// to differentiate.
370368
GetLastErrorAsString(error);
371369
return result;
372370
#elif defined(DART_HOST_OS_WINDOWS)
373371
SetLastError(0);
374-
result = reinterpret_cast<void*>(
372+
void* result = reinterpret_cast<void*>(
375373
GetProcAddress(reinterpret_cast<HMODULE>(library_handle), symbol));
376-
#endif
377-
378374
if (result == nullptr) {
379375
GetLastErrorAsString(error);
380376
}
381-
382377
return result;
378+
#endif
383379
}
384380

385381
void Utils::UnloadDynamicLibrary(void* library_handle, char** error) {

runtime/vm/app_snapshot.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3624,8 +3624,6 @@ class RODataSerializationCluster
36243624
is_canonical,
36253625
is_canonical && IsStringClassId(cid),
36263626
ImageWriter::TagObjectTypeAsReadOnly(zone, type)),
3627-
zone_(zone),
3628-
cid_(cid),
36293627
type_(type) {}
36303628
~RODataSerializationCluster() {}
36313629

@@ -3675,8 +3673,6 @@ class RODataSerializationCluster
36753673
}
36763674

36773675
private:
3678-
Zone* zone_;
3679-
const intptr_t cid_;
36803676
const char* const type_;
36813677
};
36823678
#endif // !DART_PRECOMPILED_RUNTIME && !DART_COMPRESSED_POINTERS

runtime/vm/code_descriptors.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ struct InstructionSource {
182182
// Treat an instruction source without inlining id information as unset.
183183
InstructionSource() : InstructionSource(TokenPosition::kNoSource) {}
184184
explicit InstructionSource(TokenPosition pos) : InstructionSource(pos, -1) {}
185-
InstructionSource(TokenPosition pos, intptr_t id)
186-
: token_pos(pos), inlining_id(id) {}
185+
InstructionSource(TokenPosition pos, intptr_t inlining_id)
186+
: token_pos(pos), inlining_id(inlining_id) {}
187187

188188
const TokenPosition token_pos;
189189
const intptr_t inlining_id;

0 commit comments

Comments
 (0)