{
_bvconst = CONSTANTBV::BitVector_Clone(bv);
_value_width = width;
+ cbv_managed_outside =false;
} //End of ASTBVConst constructor
// Copy constructor.
{
_bvconst = CONSTANTBV::BitVector_Clone(sym._bvconst);
_value_width = sym._value_width;
+ cbv_managed_outside =false;
} //End of copy constructor()
// Call this when deleting a node that has been stored in the the
//CBV is actually an unsigned*. The bitvector constant is
//represented using an external library in extlib-bvconst.
CBV _bvconst;
-
+
+ // If the CBV is managed outside of this class. Then a defensive copy isn't taken.
+ bool cbv_managed_outside;
+
/****************************************************************
* Class ASTBVConstHasher: *
* *
size_t operator()(const ASTBVConst * bvc) const;
}; //End of class ASTBVConstHahser
+
+
/****************************************************************
* Class ASTBVConstEqual: *
* *
/****************************************************************
* Private Functions (virtual defs and friends) *
****************************************************************/
+
//Constructor
ASTBVConst(CBV bv, unsigned int width);
+ enum CBV_LIFETIME {CBV_MANAGED_OUTSIDE};
+
+ ASTBVConst(CBV bv, unsigned int width, enum CBV_LIFETIME l )
+ : ASTInternal(BVCONST)
+ {
+ _bvconst = (bv);
+ _value_width = width;
+ cbv_managed_outside =true;
+ }
+
// Copy constructor.
ASTBVConst(const ASTBVConst &sym);
//Destructor. Call the external destructor
virtual ~ASTBVConst()
{
- CONSTANTBV::BitVector_Destroy(_bvconst);
+ if (!cbv_managed_outside)
+ CONSTANTBV::BitVector_Destroy(_bvconst);
} //End of destructor
// Return the bvconst. It is a const-value