mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
First try at a horrible global value reference wrapper
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@701 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -218,10 +218,38 @@ protected:
|
||||
~ConstPoolPointer() {}
|
||||
public:
|
||||
static ConstPoolPointer *getNullPointer(const PointerType *T) {
|
||||
// FIXME: These should all be shared!
|
||||
return new ConstPoolPointer(T);
|
||||
}
|
||||
|
||||
virtual string getStrValue() const;
|
||||
};
|
||||
|
||||
|
||||
// ConstPoolPointerReference - a constant pointer value that is initialized to
|
||||
// point to a global value, which is a constant.
|
||||
//
|
||||
class ConstPoolPointerReference : public ConstPoolPointer {
|
||||
ConstPoolPointerReference(const ConstPoolPointerReference &); // DNI!
|
||||
protected:
|
||||
ConstPoolPointerReference(GlobalVariable *GV);
|
||||
~ConstPoolPointerReference() {}
|
||||
public:
|
||||
static ConstPoolPointerReference *get(GlobalVariable *GV) {
|
||||
// FIXME: These should all be shared!
|
||||
return new ConstPoolPointerReference(GV);
|
||||
}
|
||||
|
||||
virtual string getStrValue() const;
|
||||
|
||||
const GlobalVariable *getValue() const {
|
||||
return cast<GlobalVariable>(Operands[0].get());
|
||||
}
|
||||
GlobalVariable *getValue() {
|
||||
return cast<GlobalVariable>(Operands[0].get());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user