Commit 302118d3 authored by Kevin Modzelewski's avatar Kevin Modzelewski

clang-format changed again; these changes look better

parent f6167379
...@@ -132,9 +132,7 @@ public: ...@@ -132,9 +132,7 @@ public:
} }
}; };
template <class V> class ValuedCompilerType : public _ValuedCompilerType<V> { template <class V> class ValuedCompilerType : public _ValuedCompilerType<V> { public: };
public:
};
template <> class ValuedCompilerType<llvm::Value*> : public _ValuedCompilerType<llvm::Value*> { template <> class ValuedCompilerType<llvm::Value*> : public _ValuedCompilerType<llvm::Value*> {
public: public:
......
...@@ -80,14 +80,14 @@ static llvm::Module* loadStdlib() { ...@@ -80,14 +80,14 @@ static llvm::Module* loadStdlib() {
// Make sure the stdlib got linked in correctly; check the magic number at the beginning: // Make sure the stdlib got linked in correctly; check the magic number at the beginning:
assert(STDLIB_BC_START[0] == 'B'); assert(STDLIB_BC_START[0] == 'B');
assert(STDLIB_BC_START[1] == 'C'); assert(STDLIB_BC_START[1] == 'C');
intptr_t size = (intptr_t) & STDLIB_BC_SIZE; intptr_t size = (intptr_t)&STDLIB_BC_SIZE;
assert(size > 0 && size < 1 << 30); // make sure the size is being loaded correctly assert(size > 0 && size < 1 << 30); // make sure the size is being loaded correctly
data = llvm::StringRef(STDLIB_BC_START, size); data = llvm::StringRef(STDLIB_BC_START, size);
} else { } else {
// Make sure the stdlib got linked in correctly; check the magic number at the beginning: // Make sure the stdlib got linked in correctly; check the magic number at the beginning:
assert(STRIPPED_STDLIB_BC_START[0] == 'B'); assert(STRIPPED_STDLIB_BC_START[0] == 'B');
assert(STRIPPED_STDLIB_BC_START[1] == 'C'); assert(STRIPPED_STDLIB_BC_START[1] == 'C');
intptr_t size = (intptr_t) & STRIPPED_STDLIB_BC_SIZE; intptr_t size = (intptr_t)&STRIPPED_STDLIB_BC_SIZE;
assert(size > 0 && size < 1 << 30); // make sure the size is being loaded correctly assert(size > 0 && size < 1 << 30); // make sure the size is being loaded correctly
data = llvm::StringRef(STRIPPED_STDLIB_BC_START, size); data = llvm::StringRef(STRIPPED_STDLIB_BC_START, size);
} }
......
...@@ -182,7 +182,7 @@ Val fetch(llvm::Value* v, const llvm::DataLayout& dl, const SymMap& symbols) { ...@@ -182,7 +182,7 @@ Val fetch(llvm::Value* v, const llvm::DataLayout& dl, const SymMap& symbols) {
// Typically this happens if we need to propagate the 'value' of an // Typically this happens if we need to propagate the 'value' of an
// maybe-defined Python variable; we won't actually read from it if // maybe-defined Python variable; we won't actually read from it if
// it's undef, since it should be guarded by an !is_defined variable. // it's undef, since it should be guarded by an !is_defined variable.
return (int64_t) - 1337; return (int64_t)-1337;
case llvm::Value::ConstantPointerNullVal: case llvm::Value::ConstantPointerNullVal:
return (int64_t)0; return (int64_t)0;
default: default:
...@@ -328,7 +328,7 @@ Box* interpretFunction(llvm::Function* f, int nargs, Box* arg1, Box* arg2, Box* ...@@ -328,7 +328,7 @@ Box* interpretFunction(llvm::Function* f, int nargs, Box* arg1, Box* arg2, Box*
#define SET(v) set(symbols, inst, (v)) #define SET(v) set(symbols, inst, (v))
if (llvm::LandingPadInst* lpad = llvm::dyn_cast<llvm::LandingPadInst>(inst)) { if (llvm::LandingPadInst* lpad = llvm::dyn_cast<llvm::LandingPadInst>(inst)) {
SET((intptr_t) & landingpad_value); SET((intptr_t)&landingpad_value);
continue; continue;
} else if (llvm::ExtractValueInst* ev = llvm::dyn_cast<llvm::ExtractValueInst>(inst)) { } else if (llvm::ExtractValueInst* ev = llvm::dyn_cast<llvm::ExtractValueInst>(inst)) {
Val r = fetch(ev->getAggregateOperand(), dl, symbols); Val r = fetch(ev->getAggregateOperand(), dl, symbols);
...@@ -660,8 +660,7 @@ Box* interpretFunction(llvm::Function* f, int nargs, Box* arg1, Box* arg2, Box* ...@@ -660,8 +660,7 @@ Box* interpretFunction(llvm::Function* f, int nargs, Box* arg1, Box* arg2, Box*
prevblock = curblock; prevblock = curblock;
curblock = invoke->getNormalDest(); curblock = invoke->getNormalDest();
} }
} } catch (Box* e) {
catch (Box* e) {
if (VERBOSITY("interpreter") >= 2) { if (VERBOSITY("interpreter") >= 2) {
printf("Caught exception: %p\n", e); printf("Caught exception: %p\n", e);
} }
......
...@@ -111,7 +111,7 @@ void collectStackRoots(TraceStack* stack) { ...@@ -111,7 +111,7 @@ void collectStackRoots(TraceStack* stack) {
unw_proc_info_t pip; unw_proc_info_t pip;
unw_get_proc_info(&cursor, &pip); unw_get_proc_info(&cursor, &pip);
if (pip.start_ip == (uintptr_t) & __libc_start_main) { if (pip.start_ip == (uintptr_t)&__libc_start_main) {
break; break;
} }
......
...@@ -143,8 +143,7 @@ int main(int argc, char** argv) { ...@@ -143,8 +143,7 @@ int main(int argc, char** argv) {
try { try {
compileAndRunModule(m, main); compileAndRunModule(m, main);
} } catch (Box* b) {
catch (Box* b) {
std::string msg = formatException(b); std::string msg = formatException(b);
printLastTraceback(); printLastTraceback();
fprintf(stderr, "%s\n", msg.c_str()); fprintf(stderr, "%s\n", msg.c_str());
...@@ -228,8 +227,7 @@ int main(int argc, char** argv) { ...@@ -228,8 +227,7 @@ int main(int argc, char** argv) {
try { try {
compileAndRunModule(m, main); compileAndRunModule(m, main);
} } catch (Box* b) {
catch (Box* b) {
std::string msg = formatException(b); std::string msg = formatException(b);
printLastTraceback(); printLastTraceback();
fprintf(stderr, "%s\n", msg.c_str()); fprintf(stderr, "%s\n", msg.c_str());
......
...@@ -1059,8 +1059,7 @@ extern "C" BoxedString* reprOrNull(Box* obj) { ...@@ -1059,8 +1059,7 @@ extern "C" BoxedString* reprOrNull(Box* obj) {
Box* r = repr(obj); Box* r = repr(obj);
assert(r->cls == str_cls); // this should be checked by repr() assert(r->cls == str_cls); // this should be checked by repr()
return static_cast<BoxedString*>(r); return static_cast<BoxedString*>(r);
} } catch (Box* b) {
catch (Box* b) {
return nullptr; return nullptr;
} }
} }
...@@ -1069,8 +1068,7 @@ extern "C" BoxedString* strOrNull(Box* obj) { ...@@ -1069,8 +1068,7 @@ extern "C" BoxedString* strOrNull(Box* obj) {
try { try {
BoxedString* r = str(obj); BoxedString* r = str(obj);
return static_cast<BoxedString*>(r); return static_cast<BoxedString*>(r);
} } catch (Box* b) {
catch (Box* b) {
return nullptr; return nullptr;
} }
} }
......
...@@ -129,16 +129,14 @@ public: ...@@ -129,16 +129,14 @@ public:
StlCompatAllocator() {} StlCompatAllocator() {}
template <class U> StlCompatAllocator(const StlCompatAllocator<U>& other) {} template <class U> StlCompatAllocator(const StlCompatAllocator<U>& other) {}
template <class U> struct rebind { template <class U> struct rebind { typedef StlCompatAllocator<U> other; };
typedef StlCompatAllocator<U> other;
};
pointer allocate(size_t n) { pointer allocate(size_t n) {
size_t to_allocate = n * sizeof(value_type); size_t to_allocate = n * sizeof(value_type);
// assert(to_allocate < (1<<16)); // assert(to_allocate < (1<<16));
ConservativeWrapper* rtn = new (to_allocate) ConservativeWrapper(to_allocate); ConservativeWrapper* rtn = new (to_allocate) ConservativeWrapper(to_allocate);
return (pointer) & rtn->data[0]; return (pointer)&rtn->data[0];
} }
void deallocate(pointer p, size_t n) { void deallocate(pointer p, size_t n) {
......
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