Eliminate unused clone/dump methods.
TRAC #23185
Signed-off-by: Geoff Lang
Signed-off-by: Shannon Woods
Author: Nicolas Capens
diff --git a/src/compiler/SymbolTable.cpp b/src/compiler/SymbolTable.cpp
index 2af1209..d9f3ed3 100644
--- a/src/compiler/SymbolTable.cpp
+++ b/src/compiler/SymbolTable.cpp
@@ -144,44 +144,6 @@
}
//
-// Dump functions.
-//
-
-void TVariable::dump(TInfoSink& infoSink) const
-{
- infoSink.debug << getName().c_str() << ": " << type.getQualifierString() << " " << type.getPrecisionString() << " " << type.getBasicString();
- if (type.isArray()) {
- infoSink.debug << "[0]";
- }
- infoSink.debug << "\n";
-}
-
-void TFunction::dump(TInfoSink &infoSink) const
-{
- infoSink.debug << getName().c_str() << ": " << returnType.getBasicString() << " " << getMangledName().c_str() << "\n";
-}
-
-void TInterfaceBlockName::dump(TInfoSink &infoSink) const
-{
- infoSink.debug << "interface block " << getName().c_str() << "\n";
-}
-
-void TSymbolTableLevel::dump(TInfoSink &infoSink) const
-{
- tLevel::const_iterator it;
- for (it = level.begin(); it != level.end(); ++it)
- (*it).second->dump(infoSink);
-}
-
-void TSymbolTable::dump(TInfoSink &infoSink) const
-{
- for (int level = currentLevel(); level >= 0; --level) {
- infoSink.debug << "LEVEL " << level << "\n";
- table[level]->dump(infoSink);
- }
-}
-
-//
// Functions have buried pointers to delete.
//
TFunction::~TFunction()
@@ -240,79 +202,6 @@
uniqueId = copyOf.uniqueId;
}
-TVariable::TVariable(const TVariable& copyOf, TStructureMap& remapper) : TSymbol(copyOf)
-{
- type.copyType(copyOf.type, remapper);
- userType = copyOf.userType;
- // for builtIn symbol table level, unionArray and arrayInformation pointers should be NULL
- assert(copyOf.arrayInformationType == 0);
- arrayInformationType = 0;
-
- if (copyOf.unionArray) {
- assert(!copyOf.type.getStruct());
- assert(copyOf.type.getObjectSize() == 1);
- unionArray = new ConstantUnion[1];
- unionArray[0] = copyOf.unionArray[0];
- } else
- unionArray = 0;
-}
-
-TVariable* TVariable::clone(TStructureMap& remapper)
-{
- TVariable *variable = new TVariable(*this, remapper);
-
- return variable;
-}
-
-TFunction::TFunction(const TFunction& copyOf, TStructureMap& remapper) : TSymbol(copyOf)
-{
- for (unsigned int i = 0; i < copyOf.parameters.size(); ++i) {
- TParameter param;
- parameters.push_back(param);
- parameters.back().copyParam(copyOf.parameters[i], remapper);
- }
-
- returnType.copyType(copyOf.returnType, remapper);
- mangledName = copyOf.mangledName;
- op = copyOf.op;
- defined = copyOf.defined;
-}
-
-TFunction* TFunction::clone(TStructureMap& remapper)
-{
- TFunction *function = new TFunction(*this, remapper);
-
- return function;
-}
-
-TInterfaceBlockName* TInterfaceBlockName::clone(TStructureMap& remapper)
-{
- return new TInterfaceBlockName(this->name);
-}
-
-TSymbolTableLevel* TSymbolTableLevel::clone(TStructureMap& remapper)
-{
- TSymbolTableLevel *symTableLevel = new TSymbolTableLevel();
- tLevel::iterator iter;
- for (iter = level.begin(); iter != level.end(); ++iter) {
- symTableLevel->insert(*iter->second->clone(remapper));
- }
-
- return symTableLevel;
-}
-
-void TSymbolTable::copyTable(const TSymbolTable& copyOf)
-{
- TStructureMap remapper;
- uniqueId = copyOf.uniqueId;
- for (unsigned int i = 0; i < copyOf.table.size(); ++i) {
- table.push_back(copyOf.table[i]->clone(remapper));
- }
- for( unsigned int i = 0; i < copyOf.precisionStack.size(); i++) {
- precisionStack.push_back( copyOf.precisionStack[i] );
- }
-}
-
TSymbol *TSymbolTable::find(const TString &name, int shaderVersion, bool *builtIn, bool *sameScope)
{
int level = currentLevel();
diff --git a/src/compiler/SymbolTable.h b/src/compiler/SymbolTable.h
index 66e0bb9..8365df3 100644
--- a/src/compiler/SymbolTable.h
+++ b/src/compiler/SymbolTable.h
@@ -49,9 +49,8 @@
virtual bool isVariable() const { return false; }
void setUniqueId(int id) { uniqueId = id; }
int getUniqueId() const { return uniqueId; }
- virtual void dump(TInfoSink &infoSink) const = 0;
+
TSymbol(const TSymbol&);
- virtual TSymbol* clone(TStructureMap& remapper) = 0;
protected:
const TString *name;
@@ -80,8 +79,6 @@
void updateArrayInformationType(TType *t) { arrayInformationType = t; }
TType* getArrayInformationType() { return arrayInformationType; }
- virtual void dump(TInfoSink &infoSink) const;
-
ConstantUnion* getConstPointer()
{
if (!unionArray)
@@ -100,8 +97,6 @@
delete[] unionArray;
unionArray = constArray;
}
- TVariable(const TVariable&, TStructureMap& remapper); // copy constructor
- virtual TVariable* clone(TStructureMap& remapper);
protected:
TType type;
@@ -119,11 +114,6 @@
struct TParameter {
TString *name;
TType* type;
- void copyParam(const TParameter& param, TStructureMap& remapper)
- {
- name = NewPoolTString(param.name->c_str());
- type = param.type->clone(remapper);
- }
};
//
@@ -172,10 +162,6 @@
size_t getParamCount() const { return parameters.size(); }
const TParameter& getParam(size_t i) const { return parameters[i]; }
- virtual void dump(TInfoSink &infoSink) const;
- TFunction(const TFunction&, TStructureMap& remapper);
- virtual TFunction* clone(TStructureMap& remapper);
-
protected:
typedef TVector<TParameter> TParamList;
TParamList parameters;
@@ -197,9 +183,6 @@
{}
virtual ~TInterfaceBlockName() {}
-
- virtual void dump(TInfoSink &infoSink) const;
- virtual TInterfaceBlockName* clone(TStructureMap& remapper);
};
class TSymbolTableLevel {
@@ -245,8 +228,6 @@
void relateToOperator(const char* name, TOperator op);
void relateToExtension(const char* name, const TString& ext);
- void dump(TInfoSink &infoSink) const;
- TSymbolTableLevel* clone(TStructureMap& remapper);
protected:
tLevel level;
@@ -325,8 +306,6 @@
table[level]->relateToExtension(name, ext);
}
int getMaxSymbolId() { return uniqueId; }
- void dump(TInfoSink &infoSink) const;
- void copyTable(const TSymbolTable& copyOf);
bool setDefaultPrecision( const TPublicType& type, TPrecision prec ){
if (IsSampler(type.type))
diff --git a/src/compiler/Types.h b/src/compiler/Types.h
index 9caa58f..0e892ab 100644
--- a/src/compiler/Types.h
+++ b/src/compiler/Types.h
@@ -29,9 +29,6 @@
return new(memory) TTypeList;
}
-typedef TMap<TTypeList*, TTypeList*> TStructureMap;
-typedef TMap<TTypeList*, TTypeList*>::iterator TStructureMapIterator;
-
//
// Base class for things that have a type.
//
@@ -53,64 +50,6 @@
typeName = NewPoolTString(n.c_str());
}
- void copyType(const TType& copyOf, TStructureMap& remapper)
- {
- type = copyOf.type;
- precision = copyOf.precision;
- qualifier = copyOf.qualifier;
- primarySize = copyOf.primarySize;
- secondarySize = copyOf.secondarySize;
- array = copyOf.array;
- arraySize = copyOf.arraySize;
-
- TStructureMapIterator iter;
- if (copyOf.structure) {
- if ((iter = remapper.find(structure)) == remapper.end()) {
- // create the new structure here
- structure = NewPoolTTypeList();
- for (unsigned int i = 0; i < copyOf.structure->size(); ++i) {
- TTypeLine typeLine;
- typeLine.line = (*copyOf.structure)[i].line;
- typeLine.type = (*copyOf.structure)[i].type->clone(remapper);
- structure->push_back(typeLine);
- }
- } else {
- structure = iter->second;
- }
- } else
- structure = 0;
-
- fieldName = 0;
- if (copyOf.fieldName)
- fieldName = NewPoolTString(copyOf.fieldName->c_str());
- typeName = 0;
- if (copyOf.typeName)
- typeName = NewPoolTString(copyOf.typeName->c_str());
-
- mangled = 0;
- if (copyOf.mangled)
- mangled = NewPoolTString(copyOf.mangled->c_str());
-
- instanceName = 0;
- if (copyOf.instanceName)
- instanceName = NewPoolTString(copyOf.instanceName->c_str());
-
- structureSize = copyOf.structureSize;
- maxArraySize = copyOf.maxArraySize;
- deepestStructNesting = copyOf.deepestStructNesting;
- assert(copyOf.arrayInformationType == 0);
- arrayInformationType = 0; // arrayInformationType should not be set for builtIn symbol table level
- interfaceBlockType = 0;
- }
-
- TType* clone(TStructureMap& remapper)
- {
- TType *newType = new TType();
- newType->copyType(*this, remapper);
-
- return newType;
- }
-
TBasicType getBasicType() const { return type; }
void setBasicType(TBasicType t) { type = t; }