Skip to content

Commit 0ad4135

Browse files
committed
---
yaml --- r: 15258 b: refs/heads/try c: e783968 h: refs/heads/master v: v3
1 parent 7495f5f commit 0ad4135

23 files changed

+135
-105
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: de47fcfdf9404d53940099f5e7810bdb2bf37af3
5+
refs/heads/try: e78396850d8e27138dd06e723de5ad3de0e65950
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/mk/tests.mk

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,34 @@ check-full: tidy all check-stage1 check-stage2 check-stage3 \
7474
ifdef CFG_NOTIDY
7575
tidy:
7676
else
77+
78+
ALL_CS := $(wildcard $(S)src/rt/*.cpp \
79+
$(S)src/rt/*/*.cpp \
80+
$(S)src/rt/*/*/*.cpp \
81+
$(S)srcrustllvm/*.cpp)
82+
ALL_CS := $(filter-out $(S)src/rt/bigint/bigint_ext.cpp \
83+
$(S)src/rt/bigint/bigint_int.cpp \
84+
,$(ALL_CS))
85+
ALL_HS := $(wildcard $(S)src/rt/*.h \
86+
$(S)src/rt/*/*.h \
87+
$(S)src/rt/*/*/*.h \
88+
$(S)srcrustllvm/*.h)
89+
ALL_HS := $(filter-out $(S)src/rt/vg/valgrind.h \
90+
$(S)src/rt/vg/memcheck.h \
91+
$(S)src/rt/uthash/uthash.h \
92+
$(S)src/rt/uthash/utlist.h \
93+
$(S)src/rt/msvc/typeof.h \
94+
$(S)src/rt/msvc/stdint.h \
95+
$(S)src/rt/msvc/inttypes.h \
96+
$(S)src/rt/bigint/bigint.h \
97+
,$(ALL_HS))
98+
7799
tidy:
78100
@$(call E, check: formatting)
79101
$(Q)echo \
80-
$(addprefix $(S)src/, $(RUSTLLVM_LIB_CS) $(RUSTLLVM_OBJS_CS) \
81-
$(RUSTLLVM_HDR) \
82-
$(RUNTIME_CS) $(RUNTIME_HDR) $(RUNTIME_S)) \
83102
$(wildcard $(S)src/etc/*.py) \
103+
$(ALL_CS) \
104+
$(ALL_HS) \
84105
$(COMPILER_CRATE) \
85106
$(COMPILER_INPUTS) \
86107
$(CORELIB_CRATE) \

branches/try/src/rt/arch/x86_64/context.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ struct registers_t {
3131
class context {
3232
public:
3333
registers_t regs;
34-
34+
3535
context();
36-
36+
3737
context *next;
38-
38+
3939
void swap(context &out);
4040
void call(void *f, void *arg, void *sp);
4141
};

branches/try/src/rt/memory_region.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ class memory_region {
4141

4242
inline alloc_header *get_header(void *mem);
4343
inline void *get_data(alloc_header *);
44-
4544

4645
rust_srv *_srv;
4746
memory_region *_parent;

branches/try/src/rt/rust_box_annihilator.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ class annihilator : public shape::data<annihilator,shape::ptr> {
5858
}
5959

6060
void walk_tag2(shape::tag_info &tinfo, uint32_t tag_variant) {
61-
shape::data<annihilator,shape::ptr>::walk_variant1(tinfo, tag_variant);
61+
shape::data<annihilator,shape::ptr>
62+
::walk_variant1(tinfo, tag_variant);
6263
}
6364

6465
void walk_uniq2() {
@@ -83,7 +84,7 @@ class annihilator : public shape::data<annihilator,shape::ptr> {
8384
if (pair.env) {
8485
// free closed over data:
8586
shape::data<annihilator,shape::ptr>::walk_fn_contents1();
86-
87+
8788
// now free the ptr:
8889
task->kernel->free(pair.env);
8990
}

branches/try/src/rt/rust_cc.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,11 @@ irc::compute_ircs(rust_task *task, irc_map &ircs) {
210210
type_desc *tydesc = box->td;
211211
uint8_t *body = (uint8_t*) box_body(box);
212212

213-
LOG(task, gc,
213+
LOG(task, gc,
214214
"determining internal ref counts: "
215215
"box=%p tydesc=%p body=%p",
216216
box, tydesc, body);
217-
217+
218218
shape::arena arena;
219219
shape::type_param *params =
220220
shape::type_param::from_tydesc_and_data(tydesc, body, arena);
@@ -425,7 +425,7 @@ void
425425
mark::do_mark(rust_task *task,
426426
const std::vector<rust_opaque_box *> &roots,
427427
std::set<rust_opaque_box *> &marked) {
428-
std::vector<rust_opaque_box *>::const_iterator
428+
std::vector<rust_opaque_box *>::const_iterator
429429
begin(roots.begin()),
430430
end(roots.end());
431431
while (begin != end) {

branches/try/src/rt/rust_env.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ static size_t
8484
get_max_stk_size() {
8585
char *maxsz = getenv(RUST_MAX_STACK);
8686
if (maxsz) {
87-
return strtol(maxsz, NULL, 0);
87+
return strtol(maxsz, NULL, 0);
8888
}
8989
else {
90-
return 1024*1024*8;
90+
return 1024*1024*8;
9191
}
9292
}
9393

branches/try/src/rt/rust_kernel.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ rust_kernel::create_scheduler(size_t num_threads) {
7171
sched = new (this, "rust_scheduler")
7272
rust_scheduler(this, srv, num_threads, id);
7373
bool is_new = sched_table
74-
.insert(std::pair<rust_sched_id, rust_scheduler*>(id, sched)).second;
74+
.insert(std::pair<rust_sched_id,
75+
rust_scheduler*>(id, sched)).second;
7576
A(this, is_new, "Reusing a sched id?");
7677
if (start_reaper) {
7778
sched_reaper.start();

branches/try/src/rt/rust_port_selector.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ rust_port_selector::select(rust_task *task, rust_port **dptr,
5050
task->rendezvous_ptr = (uintptr_t*)dptr;
5151
task->block(this, "waiting for select rendezvous");
5252

53-
// Blocking the task might fail if the task has already been
54-
// killed, but in the event of both failure and success the
55-
// task needs to yield. On success, it yields and waits to be
56-
// unblocked. On failure it yields and is then fails the task.
53+
// Blocking the task might fail if the task has already been
54+
// killed, but in the event of both failure and success the
55+
// task needs to yield. On success, it yields and waits to be
56+
// unblocked. On failure it yields and is then fails the task.
5757

5858
*yield = true;
5959
}

branches/try/src/rt/rust_port_selector.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ class rust_port_selector : public rust_cond {
1616
rust_port_selector();
1717

1818
void select(rust_task *task,
19-
rust_port **dptr,
20-
rust_port **ports,
21-
size_t n_ports,
22-
uintptr_t *yield);
19+
rust_port **dptr,
20+
rust_port **ports,
21+
size_t n_ports,
22+
uintptr_t *yield);
2323

2424
void msg_sent_on(rust_port *port);
2525
};

branches/try/src/rt/rust_sched_launcher.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ rust_sched_launcher::rust_sched_launcher(rust_scheduler *sched,
1111
}
1212

1313
rust_thread_sched_launcher::rust_thread_sched_launcher(rust_scheduler *sched,
14-
rust_srv *srv, int id)
14+
rust_srv *srv, int id)
1515
: rust_sched_launcher(sched, srv, id),
1616
rust_thread(SCHED_STACK_SIZE) {
1717
}

branches/try/src/rt/rust_sched_loop.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ rust_sched_loop::log_state() {
179179
if (!blocked_tasks.is_empty()) {
180180
log(NULL, log_debug, "blocked tasks:");
181181
for (size_t i = 0; i < blocked_tasks.length(); i++) {
182-
log(NULL, log_debug, "\t task: %s @0x%" PRIxPTR ", blocked on: 0x%"
183-
PRIxPTR " '%s'",
182+
log(NULL, log_debug, "\t task: %s @0x%" PRIxPTR
183+
", blocked on: 0x%" PRIxPTR " '%s'",
184184
blocked_tasks[i]->name, blocked_tasks[i],
185185
blocked_tasks[i]->get_cond(),
186186
blocked_tasks[i]->get_cond_name());
@@ -317,7 +317,7 @@ rust_sched_loop::state_name(rust_task_state state) {
317317
}
318318
}
319319

320-
void
320+
void
321321
rust_sched_loop::transition(rust_task *task,
322322
rust_task_state src, rust_task_state dst,
323323
rust_cond *cond, const char* cond_name) {

branches/try/src/rt/rust_scheduler.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
#include "rust_sched_launcher.h"
44

55
rust_scheduler::rust_scheduler(rust_kernel *kernel,
6-
rust_srv *srv,
7-
size_t num_threads,
8-
rust_sched_id id) :
6+
rust_srv *srv,
7+
size_t num_threads,
8+
rust_sched_id id) :
99
kernel(kernel),
1010
srv(srv),
1111
env(srv->env),
@@ -26,8 +26,8 @@ rust_sched_launcher *
2626
rust_scheduler::create_task_thread(int id) {
2727
rust_srv *srv = this->srv->clone();
2828
rust_sched_launcher *thread =
29-
new (kernel, "rust_thread_sched_launcher")
30-
rust_thread_sched_launcher(this, srv, id);
29+
new (kernel, "rust_thread_sched_launcher")
30+
rust_thread_sched_launcher(this, srv, id);
3131
KLOG(kernel, kern, "created task thread: " PTR ", id: %d",
3232
thread, id);
3333
return thread;
@@ -108,8 +108,8 @@ rust_scheduler::release_task() {
108108
}
109109
}
110110
if (need_exit) {
111-
// There are no more tasks on this scheduler. Time to leave
112-
exit();
111+
// There are no more tasks on this scheduler. Time to leave
112+
exit();
113113
}
114114
}
115115

branches/try/src/rt/rust_scheduler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class rust_scheduler : public kernel_owned<rust_scheduler> {
3535

3636
public:
3737
rust_scheduler(rust_kernel *kernel, rust_srv *srv, size_t num_threads,
38-
rust_sched_id id);
38+
rust_sched_id id);
3939
~rust_scheduler();
4040

4141
void start_task_threads();

branches/try/src/rt/rust_shape.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,8 @@ class cmp : public data<cmp,ptr_pair> {
362362
void walk_fn2(char) { return cmp_two_pointers(); }
363363
void walk_obj2() { return cmp_two_pointers(); }
364364

365-
void walk_tag2(tag_info &tinfo, const data_pair<tag_variant_t> &tag_variants);
365+
void walk_tag2(tag_info &tinfo,
366+
const data_pair<tag_variant_t> &tag_variants);
366367
void walk_struct2(const uint8_t *end_sp);
367368
void walk_res2(const rust_fn *dtor, uint16_t n_ty_params,
368369
const type_param *ty_params_sp, const uint8_t *end_sp,
@@ -400,7 +401,8 @@ cmp::walk_vec2(bool is_pod, const std::pair<ptr_pair,ptr_pair> &data_range) {
400401
}
401402

402403
void
403-
cmp::walk_tag2(tag_info &tinfo, const data_pair<tag_variant_t> &tag_variants) {
404+
cmp::walk_tag2(tag_info &tinfo,
405+
const data_pair<tag_variant_t> &tag_variants) {
404406
cmp_number(tag_variants);
405407
if (result != 0)
406408
return;
@@ -548,8 +550,8 @@ log::walk_res2(const rust_fn *dtor, unsigned n_params,
548550

549551
extern "C" void
550552
shape_cmp_type(int8_t *result, const type_desc *tydesc,
551-
const type_desc **subtydescs, uint8_t *data_0,
552-
uint8_t *data_1, uint8_t cmp_type) {
553+
const type_desc **subtydescs, uint8_t *data_0,
554+
uint8_t *data_1, uint8_t cmp_type) {
553555
rust_task *task = rust_sched_loop::get_task();
554556
shape::arena arena;
555557

branches/try/src/rt/rust_shape.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ ctxt<T>::get_variant_sp(tag_info &tinfo, tag_variant_t variant_id) {
395395
const uint8_t *variant_ptr = tables->tags + variant_offset;
396396
uint16_t variant_len = get_u16_bump(variant_ptr);
397397
const uint8_t *variant_end = variant_ptr + variant_len;
398-
398+
399399
return std::make_pair(variant_ptr, variant_end);
400400
}
401401

@@ -936,7 +936,7 @@ class data : public ctxt< data<T,U> > {
936936
}
937937

938938
template<typename WN>
939-
void walk_number1() {
939+
void walk_number1() {
940940
//DATA_SIMPLE(W, walk_number2<W>());
941941
ALIGN_TO(rust_alignof<WN>());
942942
U end_dp = dp + sizeof(WN);
@@ -1158,7 +1158,8 @@ class log : public data<log,ptr> {
11581158
variant_ptr_and_end);
11591159
void walk_string2(const std::pair<ptr,ptr> &data);
11601160
void walk_res2(const rust_fn *dtor, unsigned n_params,
1161-
const type_param *params, const uint8_t *end_sp, bool live);
1161+
const type_param *params, const uint8_t *end_sp,
1162+
bool live);
11621163

11631164
template<typename T>
11641165
inline void walk_number2() {

branches/try/src/rt/rust_stack.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ reuse_valgrind_stack(stk_seg *stk, uint8_t *sp) {
2222
// old stack segments, since the act of popping the stack previously
2323
// caused valgrind to consider the whole thing inaccessible.
2424
assert(sp >= stk->data && sp <= (uint8_t*) stk->end
25-
&& "Stack pointer must be inside stack segment");
25+
&& "Stack pointer must be inside stack segment");
2626
size_t sz = stk->end - (uintptr_t)sp;
2727
(void) VALGRIND_MAKE_MEM_UNDEFINED(sp, sz);
2828
(void) sz;

branches/try/src/rt/rust_task.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ void task_start_wrapper(spawn_args *a)
137137

138138
bool threw_exception = false;
139139
try {
140-
// The first argument is the return pointer; as the task fn
140+
// The first argument is the return pointer; as the task fn
141141
// must have void return type, we can safely pass 0.
142142
a->f(0, a->envptr, a->argptr);
143143
} catch (rust_task *ex) {
@@ -402,7 +402,8 @@ rust_task::wakeup(rust_cond *from) {
402402
A(sched_loop, cond != NULL, "Cannot wake up unblocked task.");
403403
LOG(this, task, "Blocked on 0x%" PRIxPTR " woken up on 0x%" PRIxPTR,
404404
(uintptr_t) cond, (uintptr_t) from);
405-
A(sched_loop, cond == from, "Cannot wake up blocked task on wrong condition.");
405+
A(sched_loop, cond == from,
406+
"Cannot wake up blocked task on wrong condition.");
406407

407408
transition(task_state_blocked, task_state_running, NULL, "none");
408409
}

branches/try/src/rt/rust_task.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ rust_task : public kernel_owned<rust_task>, rust_cond
252252
void prev_stack();
253253
void record_stack_limit();
254254
void reset_stack_limit();
255-
255+
256256
bool on_rust_stack();
257257
void check_stack_canary();
258258
void delete_all_stacks();

branches/try/src/rt/rust_upcall.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ extern "C" CDECL void
118118
upcall_s_fail(s_fail_args *args) {
119119
rust_task *task = rust_sched_loop::get_task();
120120
LOG_UPCALL_ENTRY(task);
121-
LOG_ERR(task, upcall, "upcall fail '%s', %s:%" PRIdPTR,
121+
LOG_ERR(task, upcall, "upcall fail '%s', %s:%" PRIdPTR,
122122
args->expr, args->file, args->line);
123123
task->fail();
124124
}
@@ -416,7 +416,8 @@ extern "C" void
416416
upcall_cmp_type(int8_t *result, const type_desc *tydesc,
417417
const type_desc **subtydescs, uint8_t *data_0,
418418
uint8_t *data_1, uint8_t cmp_type) {
419-
s_cmp_type_args args = {result, tydesc, subtydescs, data_0, data_1, cmp_type};
419+
s_cmp_type_args args = {result, tydesc, subtydescs,
420+
data_0, data_1, cmp_type};
420421
UPCALL_SWITCH_STACK(&args, upcall_s_cmp_type);
421422
}
422423

branches/try/src/rt/rust_util.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ vec_data(rust_vec *v) {
9595

9696
inline void reserve_vec_exact(rust_task* task, rust_vec** vpp, size_t size) {
9797
if (size > (*vpp)->alloc) {
98-
*vpp = (rust_vec*)task->kernel->realloc(*vpp, size + sizeof(rust_vec));
98+
*vpp = (rust_vec*)task->kernel
99+
->realloc(*vpp, size + sizeof(rust_vec));
99100
(*vpp)->alloc = size;
100101
}
101102
}
@@ -107,7 +108,8 @@ inline void reserve_vec(rust_task* task, rust_vec** vpp, size_t size) {
107108
typedef rust_vec rust_str;
108109

109110
inline rust_str *
110-
make_str(rust_kernel* kernel, const char* c, size_t strlen, const char* name) {
111+
make_str(rust_kernel* kernel, const char* c, size_t strlen,
112+
const char* name) {
111113
size_t str_fill = strlen + 1;
112114
size_t str_alloc = str_fill;
113115
rust_str *str = (rust_str *)

0 commit comments

Comments
 (0)