mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 04:24:00 +00:00
Eliminate the concept of a deferred symbol table. The optimization really isn't,
and it causes obscure bugs to show up in passes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4777 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -111,22 +111,12 @@ public:
|
|||||||
//===--------------------------------------------------------------------===//
|
//===--------------------------------------------------------------------===//
|
||||||
// Symbol Table Accessing functions...
|
// Symbol Table Accessing functions...
|
||||||
|
|
||||||
/// hasSymbolTable() - Returns true if there is a symbol table allocated to
|
/// getSymbolTable() - Return the symbol table...
|
||||||
/// this object AND if there is at least one name in it!
|
|
||||||
///
|
|
||||||
bool hasSymbolTable() const;
|
|
||||||
|
|
||||||
/// getSymbolTable() - CAUTION: The current symbol table may be null if there
|
|
||||||
/// are no names (ie, the symbol table is empty)
|
|
||||||
///
|
///
|
||||||
inline SymbolTable *getSymbolTable() { return SymTab; }
|
inline SymbolTable *getSymbolTable() { return SymTab; }
|
||||||
inline const SymbolTable *getSymbolTable() const { return SymTab; }
|
inline const SymbolTable *getSymbolTable() const { return SymTab; }
|
||||||
|
SymbolTable *getSymbolTableSure() { return SymTab; }
|
||||||
/// getSymbolTableSure is guaranteed to not return a null pointer, because if
|
bool hasSymbolTable() const { return true; }
|
||||||
/// the function does not already have a symtab, one is created. Use this if
|
|
||||||
/// you intend to put something into the symbol table for the function.
|
|
||||||
///
|
|
||||||
SymbolTable *getSymbolTableSure(); // Implemented in Value.cpp
|
|
||||||
|
|
||||||
|
|
||||||
//===--------------------------------------------------------------------===//
|
//===--------------------------------------------------------------------===//
|
||||||
|
@ -84,7 +84,7 @@ Function::Function(const FunctionType *Ty, bool isInternal,
|
|||||||
BasicBlocks.setParent(this);
|
BasicBlocks.setParent(this);
|
||||||
ArgumentList.setItemParent(this);
|
ArgumentList.setItemParent(this);
|
||||||
ArgumentList.setParent(this);
|
ArgumentList.setParent(this);
|
||||||
SymTab = 0;
|
SymTab = new SymbolTable();
|
||||||
|
|
||||||
// Create the arguments vector, all arguments start out unnamed.
|
// Create the arguments vector, all arguments start out unnamed.
|
||||||
for (unsigned i = 0, e = Ty->getNumParams(); i != e; ++i) {
|
for (unsigned i = 0, e = Ty->getNumParams(); i != e; ++i) {
|
||||||
@ -137,27 +137,6 @@ const Type *Function::getReturnType() const {
|
|||||||
return getFunctionType()->getReturnType();
|
return getFunctionType()->getReturnType();
|
||||||
}
|
}
|
||||||
|
|
||||||
SymbolTable *Function::getSymbolTableSure() {
|
|
||||||
if (!SymTab) SymTab = new SymbolTable();
|
|
||||||
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 Function::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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// dropAllReferences() - This function causes all the subinstructions to "let
|
// dropAllReferences() - This function causes all the subinstructions to "let
|
||||||
// go" of all references that they are maintaining. This allows one to
|
// go" of all references that they are maintaining. This allows one to
|
||||||
// 'delete' a whole class at a time, even though there may be circular
|
// 'delete' a whole class at a time, even though there may be circular
|
||||||
|
Reference in New Issue
Block a user