#ifndef LLVM_USE_H
#define LLVM_USE_H
-#include "llvm/Support/Casting.h"
#include "llvm/ADT/PointerIntPair.h"
-#include <cstddef>
#include <iterator>
namespace llvm {
class User;
class Use;
-/// Tag - generic tag type for (at least 32 bit) pointers
-enum Tag { noTag, tagOne, tagTwo, tagThree };
-
// Use** is only 4-byte aligned.
template<>
class PointerLikeTypeTraits<Use**> {
if (Val) removeFromList();
}
- enum PrevPtrTag { zeroDigitTag = noTag
- , oneDigitTag = tagOne
- , stopTag = tagTwo
- , fullStopTag = tagThree };
+ enum PrevPtrTag { zeroDigitTag
+ , oneDigitTag
+ , stopTag
+ , fullStopTag };
/// Constructor
Use(PrevPtrTag tag) : Val(0) {
//===----------------------------------------------------------------------===//
struct AugmentedUse : public Use {
- PointerIntPair<User*, 1, Tag> ref;
+ PointerIntPair<User*, 1, unsigned> ref;
AugmentedUse(); // not implemented
};
User *Use::getUser() const {
const Use *End = getImpliedUser();
- const PointerIntPair<User*, 1, Tag>& ref(
- static_cast<const AugmentedUse*>(End - 1)->ref);
+ const PointerIntPair<User*, 1, unsigned>&
+ ref(static_cast<const AugmentedUse*>(End - 1)->ref);
User *She = ref.getPointer();
return ref.getInt()
? She
+ sizeof(AugmentedUse)
- sizeof(Use)));
Use *End = Begin + N;
- PointerIntPair<User*, 1, Tag>& ref(static_cast<AugmentedUse&>(End[-1]).ref);
+ PointerIntPair<User*, 1, unsigned>&
+ ref(static_cast<AugmentedUse&>(End[-1]).ref);
ref.setPointer(const_cast<User*>(this));
- ref.setInt(tagOne);
+ ref.setInt(1);
return Use::initTags(Begin, End);
}