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:
}
}
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();
}
}
......
......@@ -50,7 +50,7 @@ bool ENABLE_TRACEBACKS = true;
bool FORCE_LLVM_CAPI_CALLS = 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 OSR_THRESHOLD_BASELINE = 2500;
int REOPT_THRESHOLD_BASELINE = 1500;
......
......@@ -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);
......@@ -611,9 +610,9 @@ extern "C" PyObject *_PyThread_CurrentFrames(void) noexcept {
result->d[boxInt(pair.first)] = frame;
}
return result;
} catch (ExcInfo) {
} catch (ExcInfo) {
RELEASE_ASSERT(0, "not implemented");
}
}
}
......
......@@ -78,10 +78,10 @@ enum Rewritable {
enum class RefType {
UNKNOWN
#ifndef NDEBUG
// Set this to non-zero to make it possible for the debugger to
= 1
// Set this to non-zero to make it possible for the debugger to
= 1
#endif
,
,
OWNED,
BORROWED,
};
......@@ -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.
......@@ -655,10 +656,10 @@ public:
int traverse(visitproc visit, void* arg) noexcept;
void _clearRaw() noexcept; // Raw clear -- clears out and decrefs all the attrs.
// Meant for implementing other clear-like functions
void clearForDealloc() noexcept; // meant for normal object deallocation. converts the attrwrapper
void moduleClear() noexcept; // Meant for _PyModule_Clear. doesn't clear all attributes.
void _clearRaw() noexcept; // Raw clear -- clears out and decrefs all the attrs.
// Meant for implementing other clear-like functions
void clearForDealloc() noexcept; // meant for normal object deallocation. converts the attrwrapper
void moduleClear() noexcept; // Meant for _PyModule_Clear. doesn't clear all attributes.
};
static_assert(sizeof(HCAttrs) == sizeof(struct _hcattrs), "");
......@@ -694,7 +695,7 @@ public:
_PyObject_HEAD_EXTRA
Py_ssize_t ob_refcnt;
Py_ssize_t ob_refcnt;
// Note: cls gets initialized in the new() function.
BoxedClass* cls;
......@@ -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"))) { \
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_basicsize == size); \
assert(default_cls->is_pyston_class); \
assert(default_cls->attrs_offset == 0); \
\
void* mem = PyObject_MALLOC(size + nitems * itemsize); \
void* mem = PyObject_MALLOC(size + nitems * itemsize); \
assert(mem); \
\
BoxVar* rtn = static_cast<BoxVar*>(mem); \
......
#!/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