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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2402 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2002-04-29 18:25:33 +00:00
parent fbaed2e070
commit 924025e9ad

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