Remove FxGlobalVariable class

This commit is contained in:
Randy Heit 2013-08-21 23:01:41 -05:00
parent 01822c002f
commit d798c7896c
2 changed files with 0 additions and 81 deletions

View file

@ -690,23 +690,6 @@ public:
};
//==========================================================================
//
// FxGlobalVariable
//
//==========================================================================
class FxGlobalVariable : public FxExpression
{
public:
PSymbolVariable *var;
bool AddressRequested;
FxGlobalVariable(PSymbolVariable*, const FScriptPosition&);
FxExpression *Resolve(FCompileContext&);
void RequestAddress();
};
//==========================================================================
//
// FxClassMember

View file

@ -2348,12 +2348,6 @@ FxExpression *FxIdentifier::Resolve(FCompileContext& ctx)
ScriptPosition.Message(MSG_DEBUGLOG, "Resolving name '%s' as global constant\n", Identifier.GetChars());
newex = FxConstant::MakeConstant(sym, ScriptPosition);
}
else if (sym->IsKindOf(RUNTIME_CLASS(PSymbolVariable))) // global variables will always be native
{
PSymbolVariable *vsym = static_cast<PSymbolVariable*>(sym);
ScriptPosition.Message(MSG_DEBUGLOG, "Resolving name '%s' as global variable, address %d\n", Identifier.GetChars(), vsym->offset);
newex = new FxGlobalVariable(vsym, ScriptPosition);
}
else
{
ScriptPosition.Message(MSG_ERROR, "Invalid global identifier '%s'\n", Identifier.GetChars());
@ -2444,64 +2438,6 @@ ExpEmit FxSelf::Emit(VMFunctionBuilder *build)
//
//==========================================================================
FxGlobalVariable::FxGlobalVariable(PSymbolVariable *mem, const FScriptPosition &pos)
: FxExpression(pos)
{
var = mem;
AddressRequested = false;
}
//==========================================================================
//
//
//
//==========================================================================
void FxGlobalVariable::RequestAddress()
{
AddressRequested = true;
}
//==========================================================================
//
//
//
//==========================================================================
FxExpression *FxGlobalVariable::Resolve(FCompileContext&)
{
CHECKRESOLVED();
switch (var->ValueType.Type)
{
case VAL_Int:
case VAL_Bool:
ValueType = VAL_Int;
break;
case VAL_Float:
case VAL_Fixed:
case VAL_Angle:
ValueType = VAL_Float;
case VAL_Object:
case VAL_Class:
ValueType = var->ValueType;
break;
default:
ScriptPosition.Message(MSG_ERROR, "Invalid type for global variable");
delete this;
return NULL;
}
return this;
}
//==========================================================================
//
//
//
//==========================================================================
FxClassMember::FxClassMember(FxExpression *x, PSymbolVariable* mem, const FScriptPosition &pos)
: FxExpression(pos)
{