-
-
-//===----------------------------------------------------------------------===//
-// SymTabValue Class
-//===----------------------------------------------------------------------===//
-
-SymTabValue::SymTabValue(Value *p) : ValueParent(p) {
- assert(ValueParent && "SymTavValue without parent!?!");
- ParentSymTab = SymTab = 0;
-}
-
-
-SymTabValue::~SymTabValue() {
- delete SymTab;
-}
-
-void SymTabValue::setParentSymTab(SymbolTable *ST) {
- ParentSymTab = ST;
- if (SymTab)
- SymTab->setParentSymTab(ST);
-}
-
-SymbolTable *SymTabValue::getSymbolTableSure() {
- if (!SymTab) SymTab = new SymbolTable(ParentSymTab);
- return SymTab;
-}
-
-// hasSymbolTable() - Returns true if there is a symbol table allocated to
-// this object AND if there is at least one name in it!
-//
-bool SymTabValue::hasSymbolTable() const {
- if (!SymTab) return false;
-
- for (SymbolTable::const_iterator I = SymTab->begin();
- I != SymTab->end(); ++I) {
- if (I->second.begin() != I->second.end())
- return true; // Found nonempty type plane!
- }
-
- return false;
-}