mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Rearrange some code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14427 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fae098a56b
commit
f6b7844101
@ -41,26 +41,17 @@ class SymbolTable;
|
||||
/// as operands to other values.
|
||||
///
|
||||
struct Value {
|
||||
enum ValueTy {
|
||||
TypeVal, // This is an instance of Type
|
||||
ConstantVal, // This is an instance of Constant
|
||||
ArgumentVal, // This is an instance of Argument
|
||||
InstructionVal, // This is an instance of Instruction
|
||||
BasicBlockVal, // This is an instance of BasicBlock
|
||||
FunctionVal, // This is an instance of Function
|
||||
GlobalVariableVal, // This is an instance of GlobalVariable
|
||||
};
|
||||
|
||||
private:
|
||||
unsigned SubclassID; // Subclass identifier (for isa/dyn_cast)
|
||||
PATypeHolder Ty;
|
||||
iplist<Use> Uses;
|
||||
std::string Name;
|
||||
PATypeHolder Ty;
|
||||
ValueTy VTy;
|
||||
|
||||
void operator=(const Value &); // Do not implement
|
||||
Value(const Value &); // Do not implement
|
||||
|
||||
public:
|
||||
Value(const Type *Ty, ValueTy vty, const std::string &name = "");
|
||||
Value(const Type *Ty, unsigned scid, const std::string &name = "");
|
||||
virtual ~Value();
|
||||
|
||||
/// dump - Support for debugging, callable in GDB: V->dump()
|
||||
@ -83,10 +74,6 @@ public:
|
||||
Name = name;
|
||||
}
|
||||
|
||||
/// getValueType - Return the immediate subclass of this Value.
|
||||
///
|
||||
inline ValueTy getValueType() const { return VTy; }
|
||||
|
||||
/// replaceAllUsesWith - Go through the uses list for this definition and make
|
||||
/// each use point to "V" instead of "this". After this completes, 'this's
|
||||
/// use list is guaranteed to be empty.
|
||||
@ -126,6 +113,26 @@ public:
|
||||
///
|
||||
void addUse(Use &U) { Uses.push_back(&U); }
|
||||
void killUse(Use &U) { Uses.remove(&U); }
|
||||
|
||||
/// getValueType - Return an ID for the concrete type of this object. This is
|
||||
/// used to implement the classof checks. This should not be used for any
|
||||
/// other purpose, as the values may change as LLVM evolves. Also, note that
|
||||
/// starting with the InstructionVal value, the value stored is actually the
|
||||
/// Instruction opcode, so there are more than just these values possible here
|
||||
/// (and Instruction must be last).
|
||||
///
|
||||
enum ValueTy {
|
||||
TypeVal, // This is an instance of Type
|
||||
ArgumentVal, // This is an instance of Argument
|
||||
BasicBlockVal, // This is an instance of BasicBlock
|
||||
FunctionVal, // This is an instance of Function
|
||||
GlobalVariableVal, // This is an instance of GlobalVariable
|
||||
ConstantVal, // This is an instance of Constant
|
||||
InstructionVal, // This is an instance of Instruction
|
||||
};
|
||||
unsigned getValueType() const {
|
||||
return SubclassID;
|
||||
}
|
||||
};
|
||||
|
||||
inline std::ostream &operator<<(std::ostream &OS, const Value *V) {
|
||||
|
Loading…
Reference in New Issue
Block a user