rt: Change alignof to rust_alignof. Remove -Wno-c++11-compat. Closes #1644

This commit is contained in:
Brian Anderson 2012-03-12 18:03:10 -07:00
parent dd610a151b
commit 3de30f4ef2
3 changed files with 13 additions and 14 deletions

View File

@ -210,8 +210,7 @@ ifeq ($(CFG_C_COMPILER),clang)
CC=clang
CXX=clang++
CPP=cpp
# -Wno-c++11-compat allows us to use 'alignof' as an identifier in the runtime
CFG_GCCISH_CFLAGS += -Wall -Werror -Wno-c++11-compat -fno-rtti -g
CFG_GCCISH_CFLAGS += -Wall -Werror -fno-rtti -g
CFG_GCCISH_LINK_FLAGS += -g
CFG_DEPEND_C = $(CFG_GCCISH_CROSS)$(CXX) $(CFG_GCCISH_CFLAGS) -MT "$(1)" \
-MM $(2)

View File

@ -212,7 +212,7 @@ size_of::compute_tag_size(tag_info &tinfo) {
tinfo.tag_sa.set(1, 1);
} else {
// Add in space for the tag.
tinfo.tag_sa.add(sizeof(tag_variant_t), alignof<tag_align_t>());
tinfo.tag_sa.add(sizeof(tag_variant_t), rust_alignof<tag_align_t>());
}
}
@ -277,7 +277,7 @@ private:
}
inline void cmp_two_pointers() {
ALIGN_TO(alignof<void *>());
ALIGN_TO(rust_alignof<void *>());
data_pair<uint8_t *> fst = bump_dp<uint8_t *>(dp);
data_pair<uint8_t *> snd = bump_dp<uint8_t *>(dp);
cmp_number(fst);
@ -286,7 +286,7 @@ private:
}
inline void cmp_pointer() {
ALIGN_TO(alignof<void *>());
ALIGN_TO(rust_alignof<void *>());
cmp_number(bump_dp<uint8_t *>(dp));
}

View File

@ -108,7 +108,7 @@ public:
template<typename T>
inline size_t
alignof() {
rust_alignof() {
#ifdef _MSC_VER
return __alignof(T);
#else
@ -118,7 +118,7 @@ alignof() {
template<>
inline size_t
alignof<double>() {
rust_alignof<double>() {
return 4;
}
@ -649,7 +649,7 @@ public:
}
template<typename T>
void walk_number1() { sa.set(sizeof(T), alignof<T>()); }
void walk_number1() { sa.set(sizeof(T), rust_alignof<T>()); }
void compute_tag_size(tag_info &tinfo);
@ -851,7 +851,7 @@ namespace shape {
}
#define DATA_SIMPLE(ty, call) \
ALIGN_TO(alignof<ty>()); \
ALIGN_TO(rust_alignof<ty>()); \
U end_dp = dp + sizeof(ty); \
static_cast<T *>(this)->call; \
dp = end_dp;
@ -899,21 +899,21 @@ public:
void walk_uniq1() { DATA_SIMPLE(void *, walk_uniq2()); }
void walk_fn1(char code) {
ALIGN_TO(alignof<void *>());
ALIGN_TO(rust_alignof<void *>());
U next_dp = dp + sizeof(void *) * 2;
static_cast<T *>(this)->walk_fn2(code);
dp = next_dp;
}
void walk_iface1() {
ALIGN_TO(alignof<void *>());
ALIGN_TO(rust_alignof<void *>());
U next_dp = dp + sizeof(void *);
static_cast<T *>(this)->walk_iface2();
dp = next_dp;
}
void walk_tydesc1(char kind) {
ALIGN_TO(alignof<void *>());
ALIGN_TO(rust_alignof<void *>());
U next_dp = dp + sizeof(void *);
static_cast<T *>(this)->walk_tydesc2(kind);
dp = next_dp;
@ -938,7 +938,7 @@ public:
template<typename WN>
void walk_number1() {
//DATA_SIMPLE(W, walk_number2<W>());
ALIGN_TO(alignof<WN>());
ALIGN_TO(rust_alignof<WN>());
U end_dp = dp + sizeof(WN);
T* t = static_cast<T *>(this);
t->template walk_number2<WN>();
@ -1003,7 +1003,7 @@ data<T,U>::walk_tag1(tag_info &tinfo) {
size_of::compute_tag_size(*this, tinfo);
if (tinfo.variant_count > 1)
ALIGN_TO(alignof<tag_align_t>());
ALIGN_TO(rust_alignof<tag_align_t>());
U end_dp = dp + tinfo.tag_sa.size;