From 3de30f4ef2f535b4cec24bba6166b8275d8400af Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Mon, 12 Mar 2012 18:03:10 -0700 Subject: [PATCH] rt: Change alignof to rust_alignof. Remove -Wno-c++11-compat. Closes #1644 --- mk/platform.mk | 3 +-- src/rt/rust_shape.cpp | 6 +++--- src/rt/rust_shape.h | 18 +++++++++--------- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/mk/platform.mk b/mk/platform.mk index 2afe8872a67..ee09a4811a6 100644 --- a/mk/platform.mk +++ b/mk/platform.mk @@ -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) diff --git a/src/rt/rust_shape.cpp b/src/rt/rust_shape.cpp index ef53a7ca7fa..9883400d173 100644 --- a/src/rt/rust_shape.cpp +++ b/src/rt/rust_shape.cpp @@ -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()); + tinfo.tag_sa.add(sizeof(tag_variant_t), rust_alignof()); } } @@ -277,7 +277,7 @@ private: } inline void cmp_two_pointers() { - ALIGN_TO(alignof()); + ALIGN_TO(rust_alignof()); data_pair fst = bump_dp(dp); data_pair snd = bump_dp(dp); cmp_number(fst); @@ -286,7 +286,7 @@ private: } inline void cmp_pointer() { - ALIGN_TO(alignof()); + ALIGN_TO(rust_alignof()); cmp_number(bump_dp(dp)); } diff --git a/src/rt/rust_shape.h b/src/rt/rust_shape.h index 29c65a2d55f..64de224464e 100644 --- a/src/rt/rust_shape.h +++ b/src/rt/rust_shape.h @@ -108,7 +108,7 @@ public: template inline size_t -alignof() { +rust_alignof() { #ifdef _MSC_VER return __alignof(T); #else @@ -118,7 +118,7 @@ alignof() { template<> inline size_t -alignof() { +rust_alignof() { return 4; } @@ -649,7 +649,7 @@ public: } template - void walk_number1() { sa.set(sizeof(T), alignof()); } + void walk_number1() { sa.set(sizeof(T), rust_alignof()); } void compute_tag_size(tag_info &tinfo); @@ -851,7 +851,7 @@ namespace shape { } #define DATA_SIMPLE(ty, call) \ - ALIGN_TO(alignof()); \ + ALIGN_TO(rust_alignof()); \ U end_dp = dp + sizeof(ty); \ static_cast(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()); + ALIGN_TO(rust_alignof()); U next_dp = dp + sizeof(void *) * 2; static_cast(this)->walk_fn2(code); dp = next_dp; } void walk_iface1() { - ALIGN_TO(alignof()); + ALIGN_TO(rust_alignof()); U next_dp = dp + sizeof(void *); static_cast(this)->walk_iface2(); dp = next_dp; } void walk_tydesc1(char kind) { - ALIGN_TO(alignof()); + ALIGN_TO(rust_alignof()); U next_dp = dp + sizeof(void *); static_cast(this)->walk_tydesc2(kind); dp = next_dp; @@ -938,7 +938,7 @@ public: template void walk_number1() { //DATA_SIMPLE(W, walk_number2()); - ALIGN_TO(alignof()); + ALIGN_TO(rust_alignof()); U end_dp = dp + sizeof(WN); T* t = static_cast(this); t->template walk_number2(); @@ -1003,7 +1003,7 @@ data::walk_tag1(tag_info &tinfo) { size_of::compute_tag_size(*this, tinfo); if (tinfo.variant_count > 1) - ALIGN_TO(alignof()); + ALIGN_TO(rust_alignof()); U end_dp = dp + tinfo.tag_sa.size;