mirror of
https://github.com/rui314/mold.git
synced 2025-01-04 06:48:19 +03:00
15 lines
357 B
C++
15 lines
357 B
C++
#include "chibild.h"
|
|
|
|
Symbol *Symbol::intern(StringRef name) {
|
|
typedef tbb::concurrent_hash_map<StringRef, Symbol> MapTy;
|
|
static MapTy map;
|
|
|
|
MapTy::accessor acc;
|
|
map.insert(acc, std::make_pair(name, Symbol(name)));
|
|
return &acc->second;
|
|
}
|
|
|
|
std::string toString(Symbol sym) {
|
|
return (StringRef(sym.name) + "(" + toString(sym.file) + ")").str();
|
|
}
|