#include "llvm/AbstractTypeUser.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/DataTypes.h"
+#include "llvm/Support/Streams.h"
#include "llvm/ADT/GraphTraits.h"
#include "llvm/ADT/iterator"
#include <string>
///
mutable std::vector<AbstractTypeUser *> AbstractTypeUsers;
public:
+ void print(llvm_ostream &O) const {
+ if (O.stream()) print(*O.stream());
+ }
void print(std::ostream &O) const;
/// @brief Debugging support: print to stderr
/// types
bool isFloatingPoint() const { return ID == FloatTyID || ID == DoubleTyID; }
+ /// isFPOrFPVector - Return true if this is a FP type or a vector of FP types.
+ ///
+ bool isFPOrFPVector() const;
+
/// isAbstract - True if the type is either an Opaque type, or is a derived
/// type that includes an opaque type somewhere in it.
///
inline bool isAbstract() const { return Abstract; }
- /// isLosslesslyConvertibleTo - Return true if this type can be converted to
- /// 'Ty' without any reinterpretation of bits. For example, uint to int.
- ///
- bool isLosslesslyConvertibleTo(const Type *Ty) const;
+ /// canLosslesslyBitCastTo - Return true if this type could be converted
+ /// with a lossless BitCast to type 'Ty'. For example, uint to int. BitCasts
+ /// are valid for types of the same size only where no re-interpretation of
+ /// the bits is done.
+ /// @brief Determine if this type could be losslessly bitcast to Ty
+ bool canLosslesslyBitCastTo(const Type *Ty) const;
/// Here are some useful little methods to query what type derived types are
///
void removeAbstractTypeUser(AbstractTypeUser *U) const;
- /// clearAllTypeMaps - This method frees all internal memory used by the
- /// type subsystem, which can be used in environments where this memory is
- /// otherwise reported as a leak.
- static void clearAllTypeMaps();
-
private:
/// isSizedDerivedType - Derived types like structures and arrays are sized
/// iff all of the members of the type are sized as well. Since asking for