Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Symtab::addSymbolToAggregate #1534

Merged
merged 2 commits into from
Sep 21, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 14 additions & 12 deletions symtabAPI/src/Symtab.C
Original file line number Diff line number Diff line change
Expand Up @@ -667,14 +667,16 @@ bool Symtab::addSymbolToAggregates(const Symbol *sym_tmp)
{
dyn_c_hash_map<Offset,Function*>::accessor a;
found = !funcsByOffset.insert(a, sym->getOffset());
if(found) func = a->second;
else {
// Create a new function
// Also, update the symbol to point to this function.
func = new Function(sym);
if(found){
func = a->second;
} else {
// Create a new function
// Also, update the symbol to point to this function.
func = new Function(sym);
a->second = func;
}
}
} // Release the lock on the offset/function pair

if(found) {
/* XXX
* For relocatable files, the offset of a symbol is relative to the
Expand All @@ -687,16 +689,16 @@ bool Symtab::addSymbolToAggregates(const Symbol *sym_tmp)

if( func->getRegion() != sym->getRegion() ) {
func = new Function(sym);
boost::unique_lock<dyn_rwlock> l(symbols_rwlock);
everyFunction.push_back(func);
sorted_everyFunction = false;
}
func->addSymbol(sym);
hainest marked this conversation as resolved.
Show resolved Hide resolved
} else {
}

{
boost::unique_lock<dyn_rwlock> l(symbols_rwlock);
everyFunction.push_back(func);
sorted_everyFunction = false;
everyFunction.push_back(func);
sorted_everyFunction = false;
}

sym->setFunction(func);

break;
Expand Down