[PATCH] D38246: [WebAssembly] Model weak aliases as wasm exports
Derek Schuff via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 26 15:31:13 PDT 2017
dschuff added inline comments.
================
Comment at: lib/Object/WasmObjectFile.cpp:340
: WasmSymbol::SymbolType::GLOBAL_EXPORT;
- auto Pair = SymbolMap.try_emplace(Export.Name, Symbols.size());
- if (Pair.second) {
- Symbols.emplace_back(Export.Name, ExportType,
- ExportSection, Export.Index);
- DEBUG(dbgs() << "Adding export: " << Symbols.back()
- << " sym index:" << Symbols.size() << "\n");
- } else {
- uint32_t SymIndex = Pair.first->second;
- Symbols[SymIndex] =
- WasmSymbol(Export.Name, ExportType, ExportSection, Export.Index);
- DEBUG(dbgs() << "Replacing existing symbol: " << Symbols[SymIndex]
- << " sym index:" << SymIndex << "\n");
- }
+ SymbolMap.try_emplace(Export.Name, Symbols.size());
+ Symbols.emplace_back(Export.Name, ExportType,
----------------
I just remembered that `try_emplace` is a C++17 function, so it may not be in the stdlib on all supported LLVM platforms; we should probably switch to something else.
https://reviews.llvm.org/D38246
More information about the llvm-commits
mailing list