Skip to content

Commit

Permalink
Revert the attempt to optimize the constexpr functions. MSVC does not…
Browse files Browse the repository at this point in the history
… handle this yet

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291515 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
rnk committed Jan 10, 2017
1 parent 178be5d commit e444a76
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions include/llvm/Support/AlignOf.h
Original file line number Diff line number Diff line change
@@ -110,15 +110,14 @@ namespace detail {
template <typename T1> constexpr size_t aligner() { return alignof(T1); }

template <typename T1, typename T2, typename... Ts> constexpr size_t aligner() {
size_t rest = aligner<T2, Ts...>();
return (alignof(T1) > rest) ? alignof(T1) : rest;
return (alignof(T1) > aligner<T2, Ts...>()) ? alignof(T1)
: aligner<T2, Ts...>();
}

template <typename T1> constexpr size_t sizer() { return sizeof(T1); }

template <typename T1, typename T2, typename... Ts> constexpr size_t sizer() {
size_t rest = sizer<T2, Ts...>();
return (sizeof(T1) > rest) ? sizeof(T1) : rest;
return (sizeof(T1) > sizer<T2, Ts...>()) ? sizeof(T1) : sizer<T2, Ts...>();
}
} // end namespace detail

0 comments on commit e444a76

Please sign in to comment.