Skip to content

Commit b01d313

Browse files
committed
Remove Visual Studio 2013-specific code
We strictly require Visual Studio 2015 or later in other areas of the code base, and thus do not need to maintain bits of code that is necessarily dead.
1 parent 7f2ff2c commit b01d313

File tree

5 files changed

+1
-77
lines changed

5 files changed

+1
-77
lines changed

jbmc/src/java_bytecode/java_bytecode_parse_tree.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,11 @@ struct java_bytecode_parse_treet
2323
{
2424
// Disallow copy construction and copy assignment, but allow move construction
2525
// and move assignment.
26-
#ifndef _MSC_VER // Ommit this on MS VC2013 as move is not supported.
2726
java_bytecode_parse_treet(const java_bytecode_parse_treet &) = delete;
2827
java_bytecode_parse_treet &
2928
operator=(const java_bytecode_parse_treet &) = delete;
3029
java_bytecode_parse_treet(java_bytecode_parse_treet &&) = default;
3130
java_bytecode_parse_treet &operator=(java_bytecode_parse_treet &&) = default;
32-
#endif
3331

3432
struct annotationt
3533
{
@@ -206,12 +204,10 @@ struct java_bytecode_parse_treet
206204

207205
// Disallow copy construction and copy assignment, but allow move
208206
// construction and move assignment.
209-
#ifndef _MSC_VER // Ommit this on MS VC2013 as move is not supported.
210207
classt(const classt &) = delete;
211208
classt &operator=(const classt &) = delete;
212209
classt(classt &&) = default;
213210
classt &operator=(classt &&) = default;
214-
#endif
215211

216212
irep_idt name, super_class, inner_name;
217213
bool is_abstract=false;

src/goto-programs/goto_program.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -461,16 +461,9 @@ class goto_programt
461461
swap(instruction.function, function);
462462
}
463463

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

475468
/// A globally unique number to identify a program location.
476469
/// It's guaranteed to be ordered in program order within

src/util/arith_tools.h

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,22 +79,13 @@ struct numeric_castt<T,
7979
// Conversion from mp_integer to integral type T
8080
optionalt<T> operator()(const mp_integer &mpi) const
8181
{
82-
#if !defined(_MSC_VER) || _MSC_VER >= 1900
8382
static_assert(
8483
std::numeric_limits<T>::max() <=
8584
std::numeric_limits<decltype(get_val(mpi))>::max() &&
8685
std::numeric_limits<T>::min() >=
8786
std::numeric_limits<decltype(get_val(mpi))>::min(),
8887
"Numeric cast only works for types smaller than long long");
89-
#else
90-
// std::numeric_limits<> methods are not declared constexpr in old versions
91-
// of VS
92-
PRECONDITION(
93-
std::numeric_limits<T>::max() <=
94-
std::numeric_limits<decltype(get_val(mpi))>::max() &&
95-
std::numeric_limits<T>::min() >=
96-
std::numeric_limits<decltype(get_val(mpi))>::min());
97-
#endif
88+
9889
if(
9990
mpi <= std::numeric_limits<T>::max() &&
10091
mpi >= std::numeric_limits<T>::min())

src/util/small_map.h

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -25,45 +25,6 @@ Author: Daniel Poetzl
2525

2626
//#define _SMALL_MAP_REALLOC_STATS
2727

28-
// The following templates are used by the class below to compute parameters at
29-
// compilation time. When having a compiler that supports constexpr, the
30-
// parameters are computed via static methods defined within the class.
31-
#if !defined(__GNUC__) && _MSC_VER < 1900
32-
33-
template <std::size_t N>
34-
struct num_bitst
35-
{
36-
static const std::size_t value = 1 + num_bitst<(N >> 1)>::value;
37-
};
38-
39-
template <>
40-
struct num_bitst<1>
41-
{
42-
static const std::size_t value = 1;
43-
};
44-
45-
template <>
46-
struct num_bitst<0>
47-
{
48-
static const std::size_t value = 1;
49-
};
50-
51-
template <typename T, std::size_t B, typename U = std::integral_constant<T, 1>>
52-
struct indicator_maskt
53-
{
54-
static const T value =
55-
U::value |
56-
indicator_maskt<T, B, std::integral_constant<T, (U::value << B)>>::value;
57-
};
58-
59-
template <typename T, std::size_t B>
60-
struct indicator_maskt<T, B, std::integral_constant<T, 0>>
61-
{
62-
static const T value = 0;
63-
};
64-
65-
#endif
66-
6728
/// Map from small integers to values
6829
///
6930
/// A data structure that maps small integers (in {0, ..., Num-1}) to values.
@@ -208,17 +169,6 @@ class small_mapt
208169

209170
static_assert(NUM >= 2, "");
210171

211-
// When we don't have constexpr
212-
#if !defined(__GNUC__) && _MSC_VER < 1900
213-
214-
static const std::size_t S_BITS = NUM * num_bitst<NUM - 1>::value + NUM;
215-
216-
static const std::size_t BITS = num_bitst<NUM - 1>::value + 1;
217-
218-
static const index_fieldt IND = indicator_maskt<index_fieldt, BITS>::value;
219-
220-
#else
221-
222172
static constexpr std::size_t num_bits(const std::size_t n)
223173
{
224174
return n < 2 ? 1 : 1 + num_bits(n >> 1);
@@ -235,8 +185,6 @@ class small_mapt
235185

236186
static const index_fieldt IND = indicator_mask();
237187

238-
#endif
239-
240188
static const index_fieldt MASK = ((index_fieldt)1 << BITS) - 1;
241189

242190
static_assert(S_BITS <= N_BITS, "");

unit/util/unicode.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ Author: Vojtech Forejt, [email protected]
1515

1616
#include <util/unicode.h>
1717

18-
// the u8 prefix is only available from VS 2015 onwards
19-
#if !defined(_MSC_VER) || _MSC_VER >= 1900
20-
2118
// This unit test compares our implementation with codecvt implementation,
2219
// checking bit-by-bit equivalence of results.
2320

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

0 commit comments

Comments
 (0)