1
1
mirror of https://github.com/rui314/mold.git synced 2024-12-28 02:44:48 +03:00

temporary

This commit is contained in:
Rui Ueyama 2020-10-12 15:32:27 +09:00
parent 706d9d41c9
commit 9f06724c0a
2 changed files with 5 additions and 3 deletions

View File

@ -110,7 +110,7 @@ struct tbb_hash_compare<StringRef> {
class SymbolTable { class SymbolTable {
public: public:
void add(StringRef key, Symbol sym); Symbol *add(StringRef key, Symbol sym);
Symbol *get(StringRef key); Symbol *get(StringRef key);
std::vector<StringRef> get_keys(); std::vector<StringRef> get_keys();

View File

@ -1,10 +1,12 @@
#include "chibild.h" #include "chibild.h"
void SymbolTable::add(StringRef name, Symbol sym) { Symbol *SymbolTable::add(StringRef name, Symbol sym) {
MapType::accessor acc; MapType::accessor acc;
map.insert(acc, name); map.insert(acc, name);
if (acc->second.file == nullptr)
acc->second = sym; acc->second = sym;
acc.release(); acc.release();
return nullptr;
} }
Symbol *SymbolTable::get(StringRef name) { Symbol *SymbolTable::get(StringRef name) {