diff --git a/.clang-format b/.clang-format index ec0cc3c3d84..d7c8202cdc3 100644 --- a/.clang-format +++ b/.clang-format @@ -63,7 +63,7 @@ IndentWidth: 4 IndentWrappedFunctionNames: false JavaScriptQuotes: Leave JavaScriptWrapImports: true -KeepEmptyLinesAtTheStartOfBlocks: true +KeepEmptyLinesAtTheStartOfBlocks: false MacroBlockBegin: '' MacroBlockEnd: '' MaxEmptyLinesToKeep: 1 diff --git a/ast/Context.cc b/ast/Context.cc index f5202f8811e..22406dc15b0 100644 --- a/ast/Context.cc +++ b/ast/Context.cc @@ -484,7 +484,6 @@ NameRef GlobalState::enterNameUTF8(UTF8Desc nm) { swap(*(strings.end() - 1), *(strings.end() - 2)); } } else { - if (strings_last_page_used + nm.to > GlobalState::STRINGS_PAGE_SIZE) { strings.push_back(make_unique>(GlobalState::STRINGS_PAGE_SIZE)); // printf("Wasted %i space\n", STRINGS_PAGE_SIZE - strings_last_page_used); diff --git a/ast/TreeMap.h b/ast/TreeMap.h index 8feb3a4cf0a..2a176375ac7 100644 --- a/ast/TreeMap.h +++ b/ast/TreeMap.h @@ -297,7 +297,6 @@ template class TreeMap { if (what == nullptr || dynamic_cast(what) != nullptr || dynamic_cast(what) != nullptr) return what; if (ClassDef *v = dynamic_cast(what)) { - if (HAS_MEMBER_preTransformClassDef::value) { v = PostPonePreTransform_ClassDef::value>::call(ctx, v, func); diff --git a/ast/Trees.cc b/ast/Trees.cc index 180d5e9ed6b..c7cd9faa313 100644 --- a/ast/Trees.cc +++ b/ast/Trees.cc @@ -152,7 +152,6 @@ void printArgs(GlobalState &gs, stringstream &buf, vector } string ConstDef::toString(GlobalState &gs, int tabs) { - return "constdef " + this->symbol.info(gs, true).name.name(gs).toString(gs) + " = " + this->rhs->toString(gs, tabs + 1); } diff --git a/ast/Trees.h b/ast/Trees.h index 01e7d65748d..05c6b54aa5e 100644 --- a/ast/Trees.h +++ b/ast/Trees.h @@ -420,7 +420,6 @@ class InsSeq : public Expression { }; class EmptyTree : public Expression { - virtual std::string toString(GlobalState &gs, int tabs = 0); virtual std::string showRaw(GlobalState &gs, int tabs = 0); virtual std::string nodeName(); diff --git a/ast/Types.cc b/ast/Types.cc index 86a7d423f0c..1ec6c6f8e27 100644 --- a/ast/Types.cc +++ b/ast/Types.cc @@ -206,7 +206,6 @@ shared_ptr ruby_typer::ast::Types::glb(ast::Context ctx, } bool isSubTypeGround(ast::Context ctx, shared_ptr &t1, shared_ptr &t2) { - auto *g1 = dynamic_cast(t1.get()); auto *g2 = dynamic_cast(t2.get()); @@ -407,7 +406,6 @@ shared_ptr OrType::getCallArgumentType(ast::Context ctx, ast::NameRef name shared_ptr AndType::dispatchCall(ast::Context ctx, ast::NameRef name, ast::Loc callLoc, vector &args, shared_ptr fullType) { - Error::notImplemented(); } diff --git a/common/os/linux.cc b/common/os/linux.cc index 87b77905ef1..78a1cc091e4 100644 --- a/common/os/linux.cc +++ b/common/os/linux.cc @@ -12,7 +12,6 @@ using namespace std; string exec(string cmd); string addr2line(const string program_name, void const *const *addr, int count) { - auto addr2line_cmd = strprintf("atos -o %.256s", program_name.c_str()); for (int i = 3; i < count; ++i) { addr2line_cmd = strprintf("%s %p", addr2line_cmd.c_str(), addr[i]); diff --git a/common/os/mac.cc b/common/os/mac.cc index 7eaed643bac..fc7a8ed0c67 100644 --- a/common/os/mac.cc +++ b/common/os/mac.cc @@ -9,7 +9,6 @@ using namespace std; string exec(string cmd); string addr2line(const string program_name, void const *const *addr, int count) { - auto addr2line_cmd = strprintf("atos -o %.256s", program_name.c_str()); for (int i = 3; i < count; ++i) { addr2line_cmd = strprintf("%s %p", addr2line_cmd.c_str(), addr[i]); diff --git a/common/typecase.h b/common/typecase.h index 7aea3b03b58..56263e332a3 100644 --- a/common/typecase.h +++ b/common/typecase.h @@ -45,7 +45,6 @@ template void typecase(Base *b) { template void typecase(Base *base, FirstSubclass &&first, RestOfSubclasses &&... rest) { - using Signature = get_signature; using Function = std::function; diff --git a/main/realmain.cc b/main/realmain.cc index 2edaa114297..49c3bb0beac 100644 --- a/main/realmain.cc +++ b/main/realmain.cc @@ -224,7 +224,6 @@ int realmain(int argc, char **argv) { st.bytes += src.size(); parse_and_print(gs, options, "-e", src, prints); } else { - for (auto &fileName : files) { console->debug("Parsing {}...", fileName); string src; diff --git a/test/test_corpus.cc b/test/test_corpus.cc index 0cce487a699..8544b0f22c0 100644 --- a/test/test_corpus.cc +++ b/test/test_corpus.cc @@ -318,7 +318,6 @@ vector listDir(const char *name) { } while ((entry = readdir(dir)) != NULL) { - if (entry->d_type == DT_DIR) { if (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0) continue;