Skip to content

Commit

Permalink
VM: Re-format to use at most one newline between functions
Browse files Browse the repository at this point in the history
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2974233002 .
  • Loading branch information
zanderso committed Jul 13, 2017
1 parent 6dbcd67 commit 6cd8a79
Show file tree
Hide file tree
Showing 665 changed files with 517 additions and 19,089 deletions.
3 changes: 0 additions & 3 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
# http://clang.llvm.org/docs/ClangFormatStyleOptions.html
BasedOnStyle: Chromium

# Keep up to 2 blank lines. More blank lines are removed.
MaxEmptyLinesToKeep: 2

# clang-format doesn't seem to do a good job of this for longer comments.
ReflowComments: 'false'

Expand Down
7 changes: 0 additions & 7 deletions runtime/bin/builtin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ static void LoadPatchFiles(Dart_Handle library,
}
}


Dart_Handle Builtin::Source(BuiltinLibraryId id) {
ASSERT(static_cast<int>(id) >= 0);
ASSERT(static_cast<int>(id) < num_libs_);
Expand All @@ -74,7 +73,6 @@ Dart_Handle Builtin::Source(BuiltinLibraryId id) {
return GetSource(source_paths, uri);
}


Dart_Handle Builtin::PartSource(BuiltinLibraryId id, const char* part_uri) {
ASSERT(static_cast<int>(id) >= 0);
ASSERT(static_cast<int>(id) < num_libs_);
Expand All @@ -84,7 +82,6 @@ Dart_Handle Builtin::PartSource(BuiltinLibraryId id, const char* part_uri) {
return GetSource(source_paths, part_uri);
}


Dart_Handle Builtin::GetSource(const char** source_paths, const char* uri) {
if (source_paths == NULL) {
return Dart_Null(); // No path mapping information exists for library.
Expand All @@ -100,7 +97,6 @@ Dart_Handle Builtin::GetSource(const char** source_paths, const char* uri) {
return Dart_Null(); // Uri does not exist in path mapping information.
}


void Builtin::SetNativeResolver(BuiltinLibraryId id) {
ASSERT(static_cast<int>(id) >= 0);
ASSERT(static_cast<int>(id) < num_libs_);
Expand All @@ -115,7 +111,6 @@ void Builtin::SetNativeResolver(BuiltinLibraryId id) {
}
}


Dart_Handle Builtin::LoadLibrary(Dart_Handle url, BuiltinLibraryId id) {
ASSERT(static_cast<int>(id) >= 0);
ASSERT(static_cast<int>(id) < num_libs_);
Expand All @@ -134,7 +129,6 @@ Dart_Handle Builtin::LoadLibrary(Dart_Handle url, BuiltinLibraryId id) {
return library;
}


Builtin::BuiltinLibraryId Builtin::FindId(const char* url_string) {
int id = 0;
while (true) {
Expand All @@ -148,7 +142,6 @@ Builtin::BuiltinLibraryId Builtin::FindId(const char* url_string) {
}
}


Dart_Handle Builtin::LoadAndCheckLibrary(BuiltinLibraryId id) {
ASSERT(static_cast<int>(id) >= 0);
ASSERT(static_cast<int>(id) < num_libs_);
Expand Down
1 change: 0 additions & 1 deletion runtime/bin/builtin.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ namespace bin {
#define DECLARE_FUNCTION(name, count) \
extern void FUNCTION_NAME(name)(Dart_NativeArguments args);


class Builtin {
public:
// Note: Changes to this enum should be accompanied with changes to
Expand Down
5 changes: 1 addition & 4 deletions runtime/bin/builtin_gen_snapshot.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "include/dart_api.h"
Expand All @@ -25,7 +25,6 @@ static struct NativeEntries {
int argument_count_;
} BuiltinEntries[] = {BUILTIN_NATIVE_LIST(REGISTER_FUNCTION)};


Dart_NativeFunction Builtin::NativeLookup(Dart_Handle name,
int argument_count,
bool* auto_setup_scope) {
Expand All @@ -46,7 +45,6 @@ Dart_NativeFunction Builtin::NativeLookup(Dart_Handle name,
return IONativeLookup(name, argument_count, auto_setup_scope);
}


const uint8_t* Builtin::NativeSymbol(Dart_NativeFunction nf) {
int num_entries = sizeof(BuiltinEntries) / sizeof(struct NativeEntries);
for (int i = 0; i < num_entries; i++) {
Expand All @@ -58,7 +56,6 @@ const uint8_t* Builtin::NativeSymbol(Dart_NativeFunction nf) {
return IONativeSymbol(nf);
}


// Implementation of native functions which are used for some
// test/debug functionality in standalone dart mode.
void FUNCTION_NAME(Builtin_PrintString)(Dart_NativeArguments args) {
Expand Down
7 changes: 1 addition & 6 deletions runtime/bin/builtin_natives.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "include/dart_api.h"
Expand All @@ -29,7 +29,6 @@ namespace bin {
V(Builtin_PrintString, 1) \
V(Builtin_GetCurrentDirectory, 0)


BUILTIN_NATIVE_LIST(DECLARE_FUNCTION);

static struct NativeEntries {
Expand All @@ -38,12 +37,10 @@ static struct NativeEntries {
int argument_count_;
} BuiltinEntries[] = {BUILTIN_NATIVE_LIST(REGISTER_FUNCTION)};


void Builtin_DummyNative(Dart_NativeArguments args) {
UNREACHABLE();
}


/**
* Looks up native functions in both libdart_builtin and libdart_io.
*/
Expand Down Expand Up @@ -72,7 +69,6 @@ Dart_NativeFunction Builtin::NativeLookup(Dart_Handle name,
return result;
}


const uint8_t* Builtin::NativeSymbol(Dart_NativeFunction nf) {
int num_entries = sizeof(BuiltinEntries) / sizeof(struct NativeEntries);
for (int i = 0; i < num_entries; i++) {
Expand All @@ -84,7 +80,6 @@ const uint8_t* Builtin::NativeSymbol(Dart_NativeFunction nf) {
return IONativeSymbol(nf);
}


// Implementation of native functions which are used for some
// test/debug functionality in standalone dart mode.
void FUNCTION_NAME(Builtin_PrintString)(Dart_NativeArguments args) {
Expand Down
7 changes: 0 additions & 7 deletions runtime/bin/builtin_nolib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,20 @@ Dart_Port Builtin::load_port_ = ILLEGAL_PORT;
const int Builtin::num_libs_ =
sizeof(Builtin::builtin_libraries_) / sizeof(Builtin::builtin_lib_props);


Dart_Handle Builtin::Source(BuiltinLibraryId id) {
return DartUtils::NewError("Unreachable code in Builtin::Source (%d).", id);
}


Dart_Handle Builtin::PartSource(BuiltinLibraryId id, const char* uri) {
return DartUtils::NewError("Unreachable code in Builtin::PartSource (%d).",
id);
}


Dart_Handle Builtin::GetSource(const char** source_paths, const char* uri) {
return DartUtils::NewError("Unreachable code in Builtin::GetSource (%s).",
uri);
}


void Builtin::SetNativeResolver(BuiltinLibraryId id) {
ASSERT(static_cast<int>(id) >= 0);
ASSERT(static_cast<int>(id) < num_libs_);
Expand All @@ -57,18 +53,15 @@ void Builtin::SetNativeResolver(BuiltinLibraryId id) {
}
}


Dart_Handle Builtin::LoadLibrary(Dart_Handle url, BuiltinLibraryId id) {
return DartUtils::NewError("Unreachable code in Builtin::LoadLibrary (%d).",
id);
}


Builtin::BuiltinLibraryId Builtin::FindId(const char* url_string) {
return kInvalidLibrary;
}


Dart_Handle Builtin::LoadAndCheckLibrary(BuiltinLibraryId id) {
ASSERT(static_cast<int>(id) >= 0);
ASSERT(static_cast<int>(id) < num_libs_);
Expand Down
Loading

0 comments on commit 6cd8a79

Please sign in to comment.