mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
add a new Type::getIntegralTypeMask() method, which is useful for clients that
want to do bitwise inspection of integer types. llvm-svn: 26032
This commit is contained in:
parent
e66383eb06
commit
0c8352628d
@ -22,7 +22,6 @@
|
||||
|
||||
#include "llvm/Constant.h"
|
||||
#include "llvm/Type.h"
|
||||
#include "llvm/Support/DataTypes.h"
|
||||
|
||||
namespace llvm {
|
||||
|
||||
|
@ -19,7 +19,6 @@
|
||||
#define LLVM_DERIVED_TYPES_H
|
||||
|
||||
#include "llvm/Type.h"
|
||||
#include "llvm/Support/DataTypes.h"
|
||||
|
||||
namespace llvm {
|
||||
|
||||
|
@ -36,6 +36,7 @@
|
||||
|
||||
#include "AbstractTypeUser.h"
|
||||
#include "llvm/Support/Casting.h"
|
||||
#include "llvm/Support/DataTypes.h"
|
||||
#include "llvm/ADT/GraphTraits.h"
|
||||
#include "llvm/ADT/iterator"
|
||||
#include <string>
|
||||
@ -232,6 +233,14 @@ public:
|
||||
/// getSignedVersion - If this is an integer type, return the signed variant
|
||||
/// of this type. For example uint -> int.
|
||||
const Type *getSignedVersion() const;
|
||||
|
||||
/// getIntegralTypeMask - Return a bitmask with ones set for all of the bits
|
||||
/// that can be set by an unsigned version of this type. This is 0xFF for
|
||||
/// sbyte/ubyte, 0xFFFF for shorts, etc.
|
||||
uint64_t getIntegralTypeMask() const {
|
||||
assert(isIntegral() && "This only works for integral types!");
|
||||
return ~0ULL >> (64-getPrimitiveSizeInBits());
|
||||
}
|
||||
|
||||
/// getForwaredType - Return the type that this type has been resolved to if
|
||||
/// it has been resolved to anything. This is used to implement the
|
||||
|
Loading…
Reference in New Issue
Block a user