Skip to content

Remove Visual Studio 2013-specific code #3965

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions jbmc/src/java_bytecode/java_bytecode_parse_tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@ struct java_bytecode_parse_treet
{
// Disallow copy construction and copy assignment, but allow move construction
// and move assignment.
#ifndef _MSC_VER // Ommit this on MS VC2013 as move is not supported.
java_bytecode_parse_treet(const java_bytecode_parse_treet &) = delete;
java_bytecode_parse_treet &
operator=(const java_bytecode_parse_treet &) = delete;
java_bytecode_parse_treet(java_bytecode_parse_treet &&) = default;
java_bytecode_parse_treet &operator=(java_bytecode_parse_treet &&) = default;
#endif

struct annotationt
{
Expand Down Expand Up @@ -206,12 +204,10 @@ struct java_bytecode_parse_treet

// Disallow copy construction and copy assignment, but allow move
// construction and move assignment.
#ifndef _MSC_VER // Ommit this on MS VC2013 as move is not supported.
classt(const classt &) = delete;
classt &operator=(const classt &) = delete;
classt(classt &&) = default;
classt &operator=(classt &&) = default;
#endif

irep_idt name, super_class, inner_name;
bool is_abstract=false;
Expand Down
7 changes: 0 additions & 7 deletions src/goto-programs/goto_program.h
Original file line number Diff line number Diff line change
Expand Up @@ -461,16 +461,9 @@ class goto_programt
swap(instruction.function, function);
}

#if (defined _MSC_VER && _MSC_VER <= 1800)
// Visual Studio <= 2013 does not support constexpr, making
// numeric_limits::max() unviable for a static const member
static const unsigned nil_target=
static_cast<unsigned>(-1);
#else
/// Uniquely identify an invalid target or location
static const unsigned nil_target=
std::numeric_limits<unsigned>::max();
#endif

/// A globally unique number to identify a program location.
/// It's guaranteed to be ordered in program order within
Expand Down
11 changes: 1 addition & 10 deletions src/util/arith_tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,22 +79,13 @@ struct numeric_castt<T,
// Conversion from mp_integer to integral type T
optionalt<T> operator()(const mp_integer &mpi) const
{
#if !defined(_MSC_VER) || _MSC_VER >= 1900
static_assert(
std::numeric_limits<T>::max() <=
std::numeric_limits<decltype(get_val(mpi))>::max() &&
std::numeric_limits<T>::min() >=
std::numeric_limits<decltype(get_val(mpi))>::min(),
"Numeric cast only works for types smaller than long long");
#else
// std::numeric_limits<> methods are not declared constexpr in old versions
// of VS
PRECONDITION(
std::numeric_limits<T>::max() <=
std::numeric_limits<decltype(get_val(mpi))>::max() &&
std::numeric_limits<T>::min() >=
std::numeric_limits<decltype(get_val(mpi))>::min());
#endif

if(
mpi <= std::numeric_limits<T>::max() &&
mpi >= std::numeric_limits<T>::min())
Expand Down
52 changes: 0 additions & 52 deletions src/util/small_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,45 +25,6 @@ Author: Daniel Poetzl

//#define _SMALL_MAP_REALLOC_STATS

// The following templates are used by the class below to compute parameters at
// compilation time. When having a compiler that supports constexpr, the
// parameters are computed via static methods defined within the class.
#if !defined(__GNUC__) && _MSC_VER < 1900

template <std::size_t N>
struct num_bitst
{
static const std::size_t value = 1 + num_bitst<(N >> 1)>::value;
};

template <>
struct num_bitst<1>
{
static const std::size_t value = 1;
};

template <>
struct num_bitst<0>
{
static const std::size_t value = 1;
};

template <typename T, std::size_t B, typename U = std::integral_constant<T, 1>>
struct indicator_maskt
{
static const T value =
U::value |
indicator_maskt<T, B, std::integral_constant<T, (U::value << B)>>::value;
};

template <typename T, std::size_t B>
struct indicator_maskt<T, B, std::integral_constant<T, 0>>
{
static const T value = 0;
};

#endif

/// Map from small integers to values
///
/// A data structure that maps small integers (in {0, ..., Num-1}) to values.
Expand Down Expand Up @@ -208,17 +169,6 @@ class small_mapt

static_assert(NUM >= 2, "");

// When we don't have constexpr
#if !defined(__GNUC__) && _MSC_VER < 1900

static const std::size_t S_BITS = NUM * num_bitst<NUM - 1>::value + NUM;

static const std::size_t BITS = num_bitst<NUM - 1>::value + 1;

static const index_fieldt IND = indicator_maskt<index_fieldt, BITS>::value;

#else

static constexpr std::size_t num_bits(const std::size_t n)
{
return n < 2 ? 1 : 1 + num_bits(n >> 1);
Expand All @@ -235,8 +185,6 @@ class small_mapt

static const index_fieldt IND = indicator_mask();

#endif

static const index_fieldt MASK = ((index_fieldt)1 << BITS) - 1;

static_assert(S_BITS <= N_BITS, "");
Expand Down
4 changes: 0 additions & 4 deletions unit/util/unicode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ Author: Vojtech Forejt, [email protected]

#include <util/unicode.h>

// the u8 prefix is only available from VS 2015 onwards
#if !defined(_MSC_VER) || _MSC_VER >= 1900

// This unit test compares our implementation with codecvt implementation,
// checking bit-by-bit equivalence of results.

Expand Down Expand Up @@ -96,4 +93,3 @@ TEST_CASE("unicode4", "[core][util][unicode]")
const std::string s = u8"дȚȨɌṡʒʸͼἨѶݔݺ→⅒⅀▤▞╢◍⛳⻥龍ンㄗㄸ";
REQUIRE(compare_utf8_to_utf16(s));
}
#endif