Page MenuHomeFreeBSD
Paste P243

ikos patch-clang-workaround
ActivePublic

Authored by val_packett.cool on Jan 4 2019, 11:06 AM.
Tags
None
Referenced Files
F4115621: raw.txt
Jan 4 2019, 11:06 AM
Subscribers
None
Workaround for clang/libc++ nested pair bug:
https://github.com/NASA-SW-VnV/ikos/issues/22
--- ar/src/semantic/context_impl.hpp.orig 2019-01-04 10:58:52 UTC
+++ ar/src/semantic/context_impl.hpp
@@ -91,7 +91,7 @@ class ContextImpl { (private)
OpaqueType _libc_file_ty;
// Integer types
- boost::container::flat_map< std::pair< unsigned, Signedness >,
+ boost::container::flat_map< boost::container::dtl::pair< unsigned, Signedness >,
std::unique_ptr< IntegerType > >
_integer_types;
@@ -100,12 +100,12 @@ class ContextImpl { (private)
_pointer_types;
// Array types
- boost::container::flat_map< std::pair< Type*, ZNumber >,
+ boost::container::flat_map< boost::container::dtl::pair< Type*, ZNumber >,
std::unique_ptr< ArrayType > >
_array_types;
// Vector types
- boost::container::flat_map< std::pair< Type*, ZNumber >,
+ boost::container::flat_map< boost::container::dtl::pair< Type*, ZNumber >,
std::unique_ptr< VectorType > >
_vector_types;
@@ -123,12 +123,12 @@ class ContextImpl { (private)
_undefined_constants;
// Integer constants
- boost::container::flat_map< std::pair< IntegerType*, MachineInt >,
+ boost::container::flat_map< boost::container::dtl::pair< IntegerType*, MachineInt >,
std::unique_ptr< IntegerConstant > >
_integer_constants;
// Float constants
- boost::container::flat_map< std::pair< FloatType*, std::string >,
+ boost::container::flat_map< boost::container::dtl::pair< FloatType*, std::string >,
std::unique_ptr< FloatConstant > >
_float_constants;
@@ -137,17 +137,17 @@ class ContextImpl { (private)
_null_constants;
// Structure constants
- boost::container::flat_map< std::pair< StructType*, StructConstant::Values >,
+ boost::container::flat_map< boost::container::dtl::pair< StructType*, StructConstant::Values >,
std::unique_ptr< StructConstant > >
_struct_constants;
// Array constants
- boost::container::flat_map< std::pair< ArrayType*, ArrayConstant::Values >,
+ boost::container::flat_map< boost::container::dtl::pair< ArrayType*, ArrayConstant::Values >,
std::unique_ptr< ArrayConstant > >
_array_constants;
// Vector constants
- boost::container::flat_map< std::pair< VectorType*, VectorConstant::Values >,
+ boost::container::flat_map< boost::container::dtl::pair< VectorType*, VectorConstant::Values >,
std::unique_ptr< VectorConstant > >
_vector_constants;
@@ -162,7 +162,7 @@ class ContextImpl { (private)
_function_pointer_constants;
// Inline assembly constants
- boost::container::flat_map< std::pair< PointerType*, std::string >,
+ boost::container::flat_map< boost::container::dtl::pair< PointerType*, std::string >,
std::unique_ptr< InlineAssemblyConstant > >
_inline_assembly_constants;
--- ar/src/semantic/context_impl.cpp.orig 2019-01-04 11:03:37 UTC
+++ ar/src/semantic/context_impl.cpp
@@ -76,10 +76,10 @@ void ContextImpl::add_bundle(std::unique_ptr< Bundle >
}
IntegerType* ContextImpl::integer_type(unsigned bit_width, Signedness sign) {
- auto it = this->_integer_types.find(std::make_pair(bit_width, sign));
+ auto it = this->_integer_types.find(boost::container::dtl::make_pair(bit_width, sign));
if (it == this->_integer_types.end()) {
auto type = new IntegerType(bit_width, sign);
- this->_integer_types.emplace(std::make_pair(bit_width, sign),
+ this->_integer_types.emplace(boost::container::dtl::make_pair(bit_width, sign),
std::unique_ptr< IntegerType >(type));
return type;
} else {
@@ -99,10 +99,10 @@ PointerType* ContextImpl::pointer_type(Type* pointee)
}
ArrayType* ContextImpl::array_type(Type* element_type, ZNumber num_element) {
- auto it = this->_array_types.find(std::make_pair(element_type, num_element));
+ auto it = this->_array_types.find(boost::container::dtl::make_pair(element_type, num_element));
if (it == this->_array_types.end()) {
auto type = new ArrayType(element_type, num_element);
- this->_array_types.emplace(std::make_pair(element_type, num_element),
+ this->_array_types.emplace(boost::container::dtl::make_pair(element_type, num_element),
std::unique_ptr< ArrayType >(type));
return type;
} else {
@@ -111,10 +111,10 @@ ArrayType* ContextImpl::array_type(Type* element_type,
}
VectorType* ContextImpl::vector_type(Type* element_type, ZNumber num_element) {
- auto it = this->_vector_types.find(std::make_pair(element_type, num_element));
+ auto it = this->_vector_types.find(boost::container::dtl::make_pair(element_type, num_element));
if (it == this->_vector_types.end()) {
auto type = new VectorType(element_type, num_element);
- this->_vector_types.emplace(std::make_pair(element_type, num_element),
+ this->_vector_types.emplace(boost::container::dtl::make_pair(element_type, num_element),
std::unique_ptr< VectorType >(type));
return type;
} else {
@@ -158,10 +158,10 @@ UndefinedConstant* ContextImpl::undefined_cst(Type* ty
}
IntegerConstant* ContextImpl::integer_cst(IntegerType* type, MachineInt value) {
- auto it = this->_integer_constants.find(std::make_pair(type, value));
+ auto it = this->_integer_constants.find(boost::container::dtl::make_pair(type, value));
if (it == this->_integer_constants.end()) {
auto cst = new IntegerConstant(type, value);
- this->_integer_constants.emplace(std::make_pair(type, value),
+ this->_integer_constants.emplace(boost::container::dtl::make_pair(type, value),
std::unique_ptr< IntegerConstant >(cst));
return cst;
} else {
@@ -171,10 +171,10 @@ IntegerConstant* ContextImpl::integer_cst(IntegerType*
FloatConstant* ContextImpl::float_cst(FloatType* type,
const std::string& value) {
- auto it = this->_float_constants.find(std::make_pair(type, value));
+ auto it = this->_float_constants.find(boost::container::dtl::make_pair(type, value));
if (it == this->_float_constants.end()) {
auto cst = new FloatConstant(type, value);
- this->_float_constants.emplace(std::make_pair(type, value),
+ this->_float_constants.emplace(boost::container::dtl::make_pair(type, value),
std::unique_ptr< FloatConstant >(cst));
return cst;
} else {
@@ -195,10 +195,10 @@ NullConstant* ContextImpl::null_cst(PointerType* type)
StructConstant* ContextImpl::struct_cst(StructType* type,
const StructConstant::Values& values) {
- auto it = this->_struct_constants.find(std::make_pair(type, values));
+ auto it = this->_struct_constants.find(boost::container::dtl::make_pair(type, values));
if (it == this->_struct_constants.end()) {
auto cst = new StructConstant(type, values);
- this->_struct_constants.emplace(std::make_pair(type, values),
+ this->_struct_constants.emplace(boost::container::dtl::make_pair(type, values),
std::unique_ptr< StructConstant >(cst));
return cst;
} else {
@@ -208,10 +208,10 @@ StructConstant* ContextImpl::struct_cst(StructType* ty
ArrayConstant* ContextImpl::array_cst(ArrayType* type,
const ArrayConstant::Values& values) {
- auto it = this->_array_constants.find(std::make_pair(type, values));
+ auto it = this->_array_constants.find(boost::container::dtl::make_pair(type, values));
if (it == this->_array_constants.end()) {
auto cst = new ArrayConstant(type, values);
- this->_array_constants.emplace(std::make_pair(type, values),
+ this->_array_constants.emplace(boost::container::dtl::make_pair(type, values),
std::unique_ptr< ArrayConstant >(cst));
return cst;
} else {
@@ -221,10 +221,10 @@ ArrayConstant* ContextImpl::array_cst(ArrayType* type,
VectorConstant* ContextImpl::vector_cst(VectorType* type,
const VectorConstant::Values& values) {
- auto it = this->_vector_constants.find(std::make_pair(type, values));
+ auto it = this->_vector_constants.find(boost::container::dtl::make_pair(type, values));
if (it == this->_vector_constants.end()) {
auto cst = new VectorConstant(type, values);
- this->_vector_constants.emplace(std::make_pair(type, values),
+ this->_vector_constants.emplace(boost::container::dtl::make_pair(type, values),
std::unique_ptr< VectorConstant >(cst));
return cst;
} else {
@@ -260,11 +260,11 @@ FunctionPointerConstant* ContextImpl::function_pointer
InlineAssemblyConstant* ContextImpl::inline_assembly_cst(
PointerType* type, const std::string& code) {
- auto it = this->_inline_assembly_constants.find(std::make_pair(type, code));
+ auto it = this->_inline_assembly_constants.find(boost::container::dtl::make_pair(type, code));
if (it == this->_inline_assembly_constants.end()) {
auto cst = new InlineAssemblyConstant(type, code);
this->_inline_assembly_constants
- .emplace(std::make_pair(type, code),
+ .emplace(boost::container::dtl::make_pair(type, code),
std::unique_ptr< InlineAssemblyConstant >(cst));
return cst;
} else {

Event Timeline