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
This diff is collapsed.
...@@ -271,7 +271,8 @@ private: ...@@ -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) { void doBreak(AST* value) {
...@@ -2527,7 +2528,8 @@ public: ...@@ -2527,7 +2528,8 @@ public:
llvm::DenseMap<InternedString, int> sym_vreg_map; llvm::DenseMap<InternedString, int> sym_vreg_map;
ScopeInfo* scope_info; 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 { bool visit_arguments(AST_arguments* node) override {
for (AST_expr* d : node->defaults) for (AST_expr* d : node->defaults)
...@@ -2586,8 +2588,9 @@ void CFG::assignVRegs(const ParamNames& param_names, ScopeInfo* scope_info) { ...@@ -2586,8 +2588,9 @@ void CFG::assignVRegs(const ParamNames& param_names, ScopeInfo* scope_info) {
AssignVRegsVisitor visitor(scope_info, true); 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. // we need todo two passes: first we assign the user visible vars a vreg and then the compiler created get there
for (int i=0; i<2; ++i) { // value.
for (int i = 0; i < 2; ++i) {
for (CFGBlock* b : blocks) { for (CFGBlock* b : blocks) {
for (AST_stmt* stmt : b->body) { for (AST_stmt* stmt : b->body) {
stmt->accept(&visitor); stmt->accept(&visitor);
......
...@@ -67,9 +67,7 @@ public: ...@@ -67,9 +67,7 @@ public:
void push_back(AST_stmt* node) { body.push_back(node); } void push_back(AST_stmt* node) { body.push_back(node); }
void print(llvm::raw_ostream& stream = llvm::outs()); void print(llvm::raw_ostream& stream = llvm::outs());
void _print() { void _print() { print(); }
print();
}
}; };
// Control Flow Graph // Control Flow Graph
......
...@@ -84,8 +84,7 @@ template <typename T1, typename T2, typename T3> struct hash<tuple<T1, T2, T3>> ...@@ -84,8 +84,7 @@ template <typename T1, typename T2, typename T3> struct hash<tuple<T1, T2, T3>>
} }
namespace pyston { namespace pyston {
template <typename T> template <typename T> constexpr bool fitsInto(int64_t x) {
constexpr bool fitsInto(int64_t x) {
return std::numeric_limits<T>::min() <= x && x <= std::numeric_limits<T>::max(); return std::numeric_limits<T>::min() <= x && x <= std::numeric_limits<T>::max();
} }
} }
......
...@@ -50,7 +50,7 @@ bool ENABLE_TRACEBACKS = true; ...@@ -50,7 +50,7 @@ bool ENABLE_TRACEBACKS = true;
bool FORCE_LLVM_CAPI_CALLS = false; bool FORCE_LLVM_CAPI_CALLS = false;
bool FORCE_LLVM_CAPI_THROWS = false; bool FORCE_LLVM_CAPI_THROWS = false;
int OSR_THRESHOLD_INTERPRETER = 5; // XXX int OSR_THRESHOLD_INTERPRETER = 5; // XXX
int REOPT_THRESHOLD_INTERPRETER = 1; // XXX int REOPT_THRESHOLD_INTERPRETER = 1; // XXX
int OSR_THRESHOLD_BASELINE = 2500; int OSR_THRESHOLD_BASELINE = 2500;
int REOPT_THRESHOLD_BASELINE = 1500; int REOPT_THRESHOLD_BASELINE = 1500;
......
...@@ -42,5 +42,4 @@ bool InternedString::isCompilerCreatedName() const { ...@@ -42,5 +42,4 @@ bool InternedString::isCompilerCreatedName() const {
char c = _str->s()[0]; char c = _str->s()[0];
return c == '!' || c == '#'; return c == '!' || c == '#';
} }
} }
...@@ -460,7 +460,6 @@ extern "C" void PyEval_ReInitThreads() noexcept { ...@@ -460,7 +460,6 @@ extern "C" void PyEval_ReInitThreads() noexcept {
else else
Py_DECREF(result); Py_DECREF(result);
Py_DECREF(threading); Py_DECREF(threading);
} }
void acquireGLWrite() { void acquireGLWrite() {
...@@ -599,7 +598,7 @@ extern "C" void PyThread_delete_key_value(int key) noexcept { ...@@ -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"); assert(0 && "check refcounting");
try { try {
LOCK_REGION(&threading_lock); LOCK_REGION(&threading_lock);
...@@ -611,9 +610,9 @@ extern "C" PyObject *_PyThread_CurrentFrames(void) noexcept { ...@@ -611,9 +610,9 @@ extern "C" PyObject *_PyThread_CurrentFrames(void) noexcept {
result->d[boxInt(pair.first)] = frame; result->d[boxInt(pair.first)] = frame;
} }
return result; return result;
} catch (ExcInfo) { } catch (ExcInfo) {
RELEASE_ASSERT(0, "not implemented"); RELEASE_ASSERT(0, "not implemented");
} }
} }
......
...@@ -78,10 +78,10 @@ enum Rewritable { ...@@ -78,10 +78,10 @@ enum Rewritable {
enum class RefType { enum class RefType {
UNKNOWN UNKNOWN
#ifndef NDEBUG #ifndef NDEBUG
// Set this to non-zero to make it possible for the debugger to // Set this to non-zero to make it possible for the debugger to
= 1 = 1
#endif #endif
, ,
OWNED, OWNED,
BORROWED, BORROWED,
}; };
...@@ -314,7 +314,8 @@ class JitCodeBlock; ...@@ -314,7 +314,8 @@ class JitCodeBlock;
extern std::vector<Box*> constants; extern std::vector<Box*> constants;
extern std::vector<Box*> late_constants; // constants that should be freed after normal 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 // and some compilation settings, and produce a CompiledFunction
// CompiledFunctions can also be created from raw function pointers, using FunctionMetadata::create. // 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. // A single FunctionMetadata can have multiple CompiledFunctions associated with it, if they have different settings.
...@@ -655,10 +656,10 @@ public: ...@@ -655,10 +656,10 @@ public:
int traverse(visitproc visit, void* arg) noexcept; int traverse(visitproc visit, void* arg) noexcept;
void _clearRaw() noexcept; // Raw clear -- clears out and decrefs all the attrs. void _clearRaw() noexcept; // Raw clear -- clears out and decrefs all the attrs.
// Meant for implementing other clear-like functions // Meant for implementing other clear-like functions
void clearForDealloc() noexcept; // meant for normal object deallocation. converts the attrwrapper void clearForDealloc() noexcept; // meant for normal object deallocation. converts the attrwrapper
void moduleClear() noexcept; // Meant for _PyModule_Clear. doesn't clear all attributes. void moduleClear() noexcept; // Meant for _PyModule_Clear. doesn't clear all attributes.
}; };
static_assert(sizeof(HCAttrs) == sizeof(struct _hcattrs), ""); static_assert(sizeof(HCAttrs) == sizeof(struct _hcattrs), "");
...@@ -694,7 +695,7 @@ public: ...@@ -694,7 +695,7 @@ public:
_PyObject_HEAD_EXTRA _PyObject_HEAD_EXTRA
Py_ssize_t ob_refcnt; Py_ssize_t ob_refcnt;
// Note: cls gets initialized in the new() function. // Note: cls gets initialized in the new() function.
BoxedClass* cls; BoxedClass* cls;
...@@ -898,13 +899,13 @@ static_assert(offsetof(BoxVar, ob_size) == offsetof(struct _varobject, ob_size), ...@@ -898,13 +899,13 @@ static_assert(offsetof(BoxVar, ob_size) == offsetof(struct _varobject, ob_size),
} \ } \
void* operator new(size_t size, size_t nitems) __attribute__((visibility("default"))) { \ void* operator new(size_t size, size_t nitems) __attribute__((visibility("default"))) { \
ALLOC_STATS_VAR(default_cls) \ ALLOC_STATS_VAR(default_cls) \
assert(default_cls->tp_alloc == PyType_GenericAlloc); \ assert(default_cls->tp_alloc == PyType_GenericAlloc); \
assert(default_cls->tp_itemsize == itemsize); \ assert(default_cls->tp_itemsize == itemsize); \
assert(default_cls->tp_basicsize == size); \ assert(default_cls->tp_basicsize == size); \
assert(default_cls->is_pyston_class); \ assert(default_cls->is_pyston_class); \
assert(default_cls->attrs_offset == 0); \ assert(default_cls->attrs_offset == 0); \
\ \
void* mem = PyObject_MALLOC(size + nitems * itemsize); \ void* mem = PyObject_MALLOC(size + nitems * itemsize); \
assert(mem); \ assert(mem); \
\ \
BoxVar* rtn = static_cast<BoxVar*>(mem); \ BoxVar* rtn = static_cast<BoxVar*>(mem); \
......
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu set -eu
failed=0 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 diff -u $fn <($1 -style=file $fn) || failed=1
done done
......
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu 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 $1 -i --style=file $fn
done 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