Commit 7bf59432 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Format src/core/ again

I don't quite remember this but I think the goal was to ignore core/from_llvm, not all of core/
parent b701479b
......@@ -141,16 +141,14 @@ namespace AST_TYPE {
/* These aren't real AST types, but since we use AST types to represent binexp types */ \
/* and divmod+truediv are essentially types of binops, we add them here (at least for now): */ \
X(DivMod, 250) \
X(TrueDiv, 251) \
X(TrueDiv, 251)
#define GENERATE_ENUM(ENUM, N) ENUM = N,
#define GENERATE_STRING(STRING, N) m[N] = #STRING;
enum AST_TYPE {
FOREACH_TYPE(GENERATE_ENUM)
};
enum AST_TYPE { FOREACH_TYPE(GENERATE_ENUM) };
static const char *stringify(int n) {
static const char* stringify(int n) {
static std::map<int, const char*> m;
FOREACH_TYPE(GENERATE_STRING)
return m[n];
......@@ -159,7 +157,6 @@ static const char *stringify(int n) {
#undef FOREACH_TYPE
#undef GENERATE_ENUM
#undef GENERATE_STRING
};
class ASTVisitor;
......@@ -1360,9 +1357,7 @@ private:
public:
PrintVisitor(int indent = 0, llvm::raw_ostream& stream = llvm::outs()) : stream(stream), indent(indent) {}
virtual ~PrintVisitor() {}
void flush() {
stream.flush();
}
void flush() { stream.flush(); }
virtual bool visit_alias(AST_alias* node);
virtual bool visit_arguments(AST_arguments* node);
......
......@@ -271,7 +271,8 @@ private:
}
}
raiseSyntaxError("'continue' not properly in loop", value->lineno, value->col_offset, source->getFn()->s(), "", true);
raiseSyntaxError("'continue' not properly in loop", value->lineno, value->col_offset, source->getFn()->s(), "",
true);
}
void doBreak(AST* value) {
......@@ -2527,7 +2528,8 @@ public:
llvm::DenseMap<InternedString, int> sym_vreg_map;
ScopeInfo* scope_info;
AssignVRegsVisitor(ScopeInfo* scope_info, bool only_user_visible) : only_user_visible(only_user_visible), scope_info(scope_info) {}
AssignVRegsVisitor(ScopeInfo* scope_info, bool only_user_visible)
: only_user_visible(only_user_visible), scope_info(scope_info) {}
bool visit_arguments(AST_arguments* node) override {
for (AST_expr* d : node->defaults)
......@@ -2586,8 +2588,9 @@ void CFG::assignVRegs(const ParamNames& param_names, ScopeInfo* scope_info) {
AssignVRegsVisitor visitor(scope_info, true);
// we need todo two passes: first we assign the user visible vars a vreg and then the compiler created get there value.
for (int i=0; i<2; ++i) {
// we need todo two passes: first we assign the user visible vars a vreg and then the compiler created get there
// value.
for (int i = 0; i < 2; ++i) {
for (CFGBlock* b : blocks) {
for (AST_stmt* stmt : b->body) {
stmt->accept(&visitor);
......
......@@ -67,9 +67,7 @@ public:
void push_back(AST_stmt* node) { body.push_back(node); }
void print(llvm::raw_ostream& stream = llvm::outs());
void _print() {
print();
}
void _print() { print(); }
};
// Control Flow Graph
......
......@@ -84,8 +84,7 @@ template <typename T1, typename T2, typename T3> struct hash<tuple<T1, T2, T3>>
}
namespace pyston {
template <typename T>
constexpr bool fitsInto(int64_t x) {
template <typename T> constexpr bool fitsInto(int64_t x) {
return std::numeric_limits<T>::min() <= x && x <= std::numeric_limits<T>::max();
}
}
......
......@@ -42,5 +42,4 @@ bool InternedString::isCompilerCreatedName() const {
char c = _str->s()[0];
return c == '!' || c == '#';
}
}
......@@ -460,7 +460,6 @@ extern "C" void PyEval_ReInitThreads() noexcept {
else
Py_DECREF(result);
Py_DECREF(threading);
}
void acquireGLWrite() {
......@@ -599,7 +598,7 @@ extern "C" void PyThread_delete_key_value(int key) noexcept {
}
extern "C" PyObject *_PyThread_CurrentFrames(void) noexcept {
extern "C" PyObject* _PyThread_CurrentFrames(void) noexcept {
assert(0 && "check refcounting");
try {
LOCK_REGION(&threading_lock);
......
......@@ -314,7 +314,8 @@ class JitCodeBlock;
extern std::vector<Box*> constants;
extern std::vector<Box*> late_constants; // constants that should be freed after normal constants
// A specific compilation of a FunctionMetadata. Usually these will be created by the LLVM JIT, which will take a FunctionMetadata
// A specific compilation of a FunctionMetadata. Usually these will be created by the LLVM JIT, which will take a
// FunctionMetadata
// and some compilation settings, and produce a CompiledFunction
// CompiledFunctions can also be created from raw function pointers, using FunctionMetadata::create.
// A single FunctionMetadata can have multiple CompiledFunctions associated with it, if they have different settings.
......
#!/usr/bin/env bash
set -eu
failed=0
for fn in $(find . -path ./core -prune -o -name '*.cpp' -print -o -name '*.h' -print); do
for fn in $(find . -path ./core/from_llvm -prune -o -name '*.cpp' -print -o -name '*.h' -print); do
diff -u $fn <($1 -style=file $fn) || failed=1
done
......
#!/usr/bin/env bash
set -eu
for fn in $(find . -path ./core -prune -o -name '*.cpp' -print -o -name '*.h' -print); do
for fn in $(find . -path ./core/from_llvm -prune -o -name '*.cpp' -print -o -name '*.h' -print); do
$1 -i --style=file $fn
done
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment