mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
For PR411:
Take an incremental step towards type plane elimination. This change separates types from values in the symbol tables by finally making use of the TypeSymbolTable class. This yields more natural interfaces for dealing with types and unclutters the SymbolTable class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32956 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -639,8 +639,8 @@ static const Type *getTypeVal(const ValID &D, bool DoNotImprovise = false) {
|
||||
|
||||
static Value *lookupInSymbolTable(const Type *Ty, const std::string &Name) {
|
||||
SymbolTable &SymTab =
|
||||
inFunctionScope() ? CurFun.CurrentFunction->getSymbolTable() :
|
||||
CurModule.CurrentModule->getSymbolTable();
|
||||
inFunctionScope() ? CurFun.CurrentFunction->getValueSymbolTable() :
|
||||
CurModule.CurrentModule->getValueSymbolTable();
|
||||
return SymTab.lookup(Ty, Name);
|
||||
}
|
||||
|
||||
@@ -821,7 +821,7 @@ static BasicBlock *getBBVal(const ValID &ID, bool isDefinition = false) {
|
||||
case ValID::NameVal: // Is it a named definition?
|
||||
Name = ID.Name;
|
||||
if (Value *N = CurFun.CurrentFunction->
|
||||
getSymbolTable().lookup(Type::LabelTy, Name))
|
||||
getValueSymbolTable().lookup(Type::LabelTy, Name))
|
||||
BB = cast<BasicBlock>(N);
|
||||
break;
|
||||
}
|
||||
@@ -961,7 +961,7 @@ static void setValueName(Value *V, char *NameStr) {
|
||||
}
|
||||
|
||||
assert(inFunctionScope() && "Must be in function scope!");
|
||||
SymbolTable &ST = CurFun.CurrentFunction->getSymbolTable();
|
||||
SymbolTable &ST = CurFun.CurrentFunction->getValueSymbolTable();
|
||||
if (ST.lookup(V->getType(), Name)) {
|
||||
GenerateError("Redefinition of value '" + Name + "' of type '" +
|
||||
V->getType()->getDescription() + "'!");
|
||||
|
@@ -311,8 +311,8 @@ static const Type *getTypeVal(const ValID &D, bool DoNotImprovise = false) {
|
||||
|
||||
static Value *lookupInSymbolTable(const Type *Ty, const std::string &Name) {
|
||||
SymbolTable &SymTab =
|
||||
inFunctionScope() ? CurFun.CurrentFunction->getSymbolTable() :
|
||||
CurModule.CurrentModule->getSymbolTable();
|
||||
inFunctionScope() ? CurFun.CurrentFunction->getValueSymbolTable() :
|
||||
CurModule.CurrentModule->getValueSymbolTable();
|
||||
return SymTab.lookup(Ty, Name);
|
||||
}
|
||||
|
||||
@@ -493,7 +493,7 @@ static BasicBlock *getBBVal(const ValID &ID, bool isDefinition = false) {
|
||||
case ValID::NameVal: // Is it a named definition?
|
||||
Name = ID.Name;
|
||||
if (Value *N = CurFun.CurrentFunction->
|
||||
getSymbolTable().lookup(Type::LabelTy, Name))
|
||||
getValueSymbolTable().lookup(Type::LabelTy, Name))
|
||||
BB = cast<BasicBlock>(N);
|
||||
break;
|
||||
}
|
||||
@@ -633,7 +633,7 @@ static void setValueName(Value *V, char *NameStr) {
|
||||
}
|
||||
|
||||
assert(inFunctionScope() && "Must be in function scope!");
|
||||
SymbolTable &ST = CurFun.CurrentFunction->getSymbolTable();
|
||||
SymbolTable &ST = CurFun.CurrentFunction->getValueSymbolTable();
|
||||
if (ST.lookup(V->getType(), Name)) {
|
||||
GenerateError("Redefinition of value '" + Name + "' of type '" +
|
||||
V->getType()->getDescription() + "'!");
|
||||
|
@@ -311,8 +311,8 @@ static const Type *getTypeVal(const ValID &D, bool DoNotImprovise = false) {
|
||||
|
||||
static Value *lookupInSymbolTable(const Type *Ty, const std::string &Name) {
|
||||
SymbolTable &SymTab =
|
||||
inFunctionScope() ? CurFun.CurrentFunction->getSymbolTable() :
|
||||
CurModule.CurrentModule->getSymbolTable();
|
||||
inFunctionScope() ? CurFun.CurrentFunction->getValueSymbolTable() :
|
||||
CurModule.CurrentModule->getValueSymbolTable();
|
||||
return SymTab.lookup(Ty, Name);
|
||||
}
|
||||
|
||||
@@ -493,7 +493,7 @@ static BasicBlock *getBBVal(const ValID &ID, bool isDefinition = false) {
|
||||
case ValID::NameVal: // Is it a named definition?
|
||||
Name = ID.Name;
|
||||
if (Value *N = CurFun.CurrentFunction->
|
||||
getSymbolTable().lookup(Type::LabelTy, Name))
|
||||
getValueSymbolTable().lookup(Type::LabelTy, Name))
|
||||
BB = cast<BasicBlock>(N);
|
||||
break;
|
||||
}
|
||||
@@ -633,7 +633,7 @@ static void setValueName(Value *V, char *NameStr) {
|
||||
}
|
||||
|
||||
assert(inFunctionScope() && "Must be in function scope!");
|
||||
SymbolTable &ST = CurFun.CurrentFunction->getSymbolTable();
|
||||
SymbolTable &ST = CurFun.CurrentFunction->getValueSymbolTable();
|
||||
if (ST.lookup(V->getType(), Name)) {
|
||||
GenerateError("Redefinition of value '" + Name + "' of type '" +
|
||||
V->getType()->getDescription() + "'!");
|
||||
|
Reference in New Issue
Block a user