mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-01 15:11:24 +00:00
add a new Type::getIntegralTypeMask() method, which is useful for clients that
want to do bitwise inspection of integer types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26032 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8c9191c644
commit
ab0e04c2f2
@ -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