Fix bug: test/Regression/Other/2002-04-29-NameBinding.ll

llvm-svn: 2402
This commit is contained in:
Chris Lattner 2002-04-29 18:25:33 +00:00
parent 9689364fee
commit 9468519f34

View File

@ -248,18 +248,7 @@ static const Type *getTypeVal(const ValID &D, bool DoNotImprovise = false) {
static Value *lookupInSymbolTable(const Type *Ty, const string &Name) {
SymbolTable *SymTab =
inFunctionScope() ? CurMeth.CurrentFunction->getSymbolTable() : 0;
Value *N = SymTab ? SymTab->lookup(Ty, Name) : 0;
if (N == 0) {
// Symbol table doesn't automatically chain yet... because the method
// hasn't been added to the module...
//
SymTab = CurModule.CurrentModule->getSymbolTable();
if (SymTab)
N = SymTab->lookup(Ty, Name);
}
return N;
return SymTab ? SymTab->lookup(Ty, Name) : 0;
}
// getValNonImprovising - Look up the value specified by the provided type and