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:
}
};
template <class V> class ValuedCompilerType : public _ValuedCompilerType<V> {
public:
};
template <class V> class ValuedCompilerType : public _ValuedCompilerType<V> { public: };
template <> class ValuedCompilerType<llvm::Value*> : public _ValuedCompilerType<llvm::Value*> {
public:
......
......@@ -80,14 +80,14 @@ static llvm::Module* loadStdlib() {
// 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[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
data = llvm::StringRef(STDLIB_BC_START, size);
} else {
// 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[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
data = llvm::StringRef(STRIPPED_STDLIB_BC_START, size);
}
......
......@@ -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
// 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.
return (int64_t) - 1337;
return (int64_t)-1337;
case llvm::Value::ConstantPointerNullVal:
return (int64_t)0;
default:
......@@ -328,7 +328,7 @@ Box* interpretFunction(llvm::Function* f, int nargs, Box* arg1, Box* arg2, Box*
#define SET(v) set(symbols, inst, (v))
if (llvm::LandingPadInst* lpad = llvm::dyn_cast<llvm::LandingPadInst>(inst)) {
SET((intptr_t) & landingpad_value);
SET((intptr_t)&landingpad_value);
continue;
} else if (llvm::ExtractValueInst* ev = llvm::dyn_cast<llvm::ExtractValueInst>(inst)) {
Val r = fetch(ev->getAggregateOperand(), dl, symbols);
......@@ -660,8 +660,7 @@ Box* interpretFunction(llvm::Function* f, int nargs, Box* arg1, Box* arg2, Box*
prevblock = curblock;
curblock = invoke->getNormalDest();
}
}
catch (Box* e) {
} catch (Box* e) {
if (VERBOSITY("interpreter") >= 2) {
printf("Caught exception: %p\n", e);
}
......
......@@ -111,7 +111,7 @@ void collectStackRoots(TraceStack* stack) {
unw_proc_info_t 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;
}
......
......@@ -143,8 +143,7 @@ int main(int argc, char** argv) {
try {
compileAndRunModule(m, main);
}
catch (Box* b) {
} catch (Box* b) {
std::string msg = formatException(b);
printLastTraceback();
fprintf(stderr, "%s\n", msg.c_str());
......@@ -228,8 +227,7 @@ int main(int argc, char** argv) {
try {
compileAndRunModule(m, main);
}
catch (Box* b) {
} catch (Box* b) {
std::string msg = formatException(b);
printLastTraceback();
fprintf(stderr, "%s\n", msg.c_str());
......
......@@ -1059,8 +1059,7 @@ extern "C" BoxedString* reprOrNull(Box* obj) {
Box* r = repr(obj);
assert(r->cls == str_cls); // this should be checked by repr()
return static_cast<BoxedString*>(r);
}
catch (Box* b) {
} catch (Box* b) {
return nullptr;
}
}
......@@ -1069,8 +1068,7 @@ extern "C" BoxedString* strOrNull(Box* obj) {
try {
BoxedString* r = str(obj);
return static_cast<BoxedString*>(r);
}
catch (Box* b) {
} catch (Box* b) {
return nullptr;
}
}
......
......@@ -129,16 +129,14 @@ public:
StlCompatAllocator() {}
template <class U> StlCompatAllocator(const StlCompatAllocator<U>& other) {}
template <class U> struct rebind {
typedef StlCompatAllocator<U> other;
};
template <class U> struct rebind { typedef StlCompatAllocator<U> other; };
pointer allocate(size_t n) {
size_t to_allocate = n * sizeof(value_type);
// assert(to_allocate < (1<<16));
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) {
......
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