mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-21 02:24:22 +00:00
Make VarInit Name an Init
Make the VarInit name an Init itself. We need this to implement paste functionality so we can reference variables whose names are not yet completely resolved. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142497 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1298,7 +1298,12 @@ TypedInit::convertInitListSlice(const std::vector<unsigned> &Elements) const {
|
||||
|
||||
|
||||
VarInit *VarInit::get(const std::string &VN, RecTy *T) {
|
||||
typedef std::pair<RecTy *, TableGenStringKey> Key;
|
||||
Init *Value = StringInit::get(VN);
|
||||
return VarInit::get(Value, T);
|
||||
}
|
||||
|
||||
VarInit *VarInit::get(Init *VN, RecTy *T) {
|
||||
typedef std::pair<RecTy *, Init *> Key;
|
||||
typedef DenseMap<Key, VarInit *> Pool;
|
||||
static Pool ThePool;
|
||||
|
||||
@ -1309,6 +1314,13 @@ VarInit *VarInit::get(const std::string &VN, RecTy *T) {
|
||||
return I;
|
||||
}
|
||||
|
||||
const std::string &VarInit::getName() const {
|
||||
StringInit *NameString =
|
||||
dynamic_cast<StringInit *>(getNameInit());
|
||||
assert(NameString && "VarInit name is not a string!");
|
||||
return NameString->getValue();
|
||||
}
|
||||
|
||||
Init *VarInit::resolveBitReference(Record &R, const RecordVal *IRV,
|
||||
unsigned Bit) const {
|
||||
if (R.isTemplateArg(getName())) return 0;
|
||||
|
Reference in New Issue
Block a user