mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 19:12:56 +02:00
[WebAssembly] MC: Remove SetUsed argument when calling MCSymbol::isDefined et al
Summary: This argument (the isUsed flag) seems to only be relevant when parsing. Other calls sites such as these don't seem to ever use it. Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish Differential Revision: https://reviews.llvm.org/D41970 llvm-svn: 322332
This commit is contained in:
parent
cbad481c69
commit
c35b211f46
@ -502,7 +502,7 @@ WasmObjectWriter::getProvisionalValue(const WasmRelocationEntry &RelEntry) {
|
|||||||
const MCSymbolWasm *Sym = ResolveSymbol(*RelEntry.Symbol);
|
const MCSymbolWasm *Sym = ResolveSymbol(*RelEntry.Symbol);
|
||||||
|
|
||||||
// For undefined symbols, use zero
|
// For undefined symbols, use zero
|
||||||
if (!Sym->isDefined(/*SetUsed=*/false))
|
if (!Sym->isDefined())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
uint32_t GlobalIndex = SymbolIndices[Sym];
|
uint32_t GlobalIndex = SymbolIndices[Sym];
|
||||||
@ -1122,7 +1122,7 @@ void WasmObjectWriter::writeObject(MCAssembler &Asm,
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
// If the symbol is not defined in this translation unit, import it.
|
// If the symbol is not defined in this translation unit, import it.
|
||||||
if ((!WS.isDefined(/*SetUsed=*/false) && !WS.isComdat()) ||
|
if ((!WS.isDefined() && !WS.isComdat()) ||
|
||||||
WS.isVariable()) {
|
WS.isVariable()) {
|
||||||
WasmImport Import;
|
WasmImport Import;
|
||||||
Import.ModuleName = WS.getModuleName();
|
Import.ModuleName = WS.getModuleName();
|
||||||
@ -1206,7 +1206,7 @@ void WasmObjectWriter::writeObject(MCAssembler &Asm,
|
|||||||
unsigned Index;
|
unsigned Index;
|
||||||
|
|
||||||
if (WS.isFunction()) {
|
if (WS.isFunction()) {
|
||||||
if (WS.isDefined(/*SetUsed=*/false)) {
|
if (WS.isDefined()) {
|
||||||
if (WS.getOffset() != 0)
|
if (WS.getOffset() != 0)
|
||||||
report_fatal_error(
|
report_fatal_error(
|
||||||
"function sections must contain one function each");
|
"function sections must contain one function each");
|
||||||
@ -1234,7 +1234,7 @@ void WasmObjectWriter::writeObject(MCAssembler &Asm,
|
|||||||
if (WS.isTemporary() && !WS.getSize())
|
if (WS.isTemporary() && !WS.getSize())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!WS.isDefined(/*SetUsed=*/false))
|
if (!WS.isDefined())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!WS.getSize())
|
if (!WS.getSize())
|
||||||
@ -1263,7 +1263,7 @@ void WasmObjectWriter::writeObject(MCAssembler &Asm,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If the symbol is visible outside this translation unit, export it.
|
// If the symbol is visible outside this translation unit, export it.
|
||||||
if (WS.isDefined(/*SetUsed=*/false)) {
|
if (WS.isDefined()) {
|
||||||
WasmExport Export;
|
WasmExport Export;
|
||||||
Export.FieldName = WS.getName();
|
Export.FieldName = WS.getName();
|
||||||
Export.Index = Index;
|
Export.Index = Index;
|
||||||
@ -1278,7 +1278,7 @@ void WasmObjectWriter::writeObject(MCAssembler &Asm,
|
|||||||
SymbolFlags.emplace_back(WS.getName(), wasm::WASM_SYMBOL_BINDING_LOCAL);
|
SymbolFlags.emplace_back(WS.getName(), wasm::WASM_SYMBOL_BINDING_LOCAL);
|
||||||
|
|
||||||
if (WS.isFunction()) {
|
if (WS.isFunction()) {
|
||||||
auto &Section = static_cast<MCSectionWasm &>(WS.getSection(false));
|
auto &Section = static_cast<MCSectionWasm &>(WS.getSection());
|
||||||
if (const MCSymbolWasm *C = Section.getGroup())
|
if (const MCSymbolWasm *C = Section.getGroup())
|
||||||
Comdats[C->getName()].emplace_back(
|
Comdats[C->getName()].emplace_back(
|
||||||
WasmComdatEntry{wasm::WASM_COMDAT_FUNCTION, Index});
|
WasmComdatEntry{wasm::WASM_COMDAT_FUNCTION, Index});
|
||||||
@ -1293,7 +1293,7 @@ void WasmObjectWriter::writeObject(MCAssembler &Asm,
|
|||||||
if (!S.isVariable())
|
if (!S.isVariable())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
assert(S.isDefined(/*SetUsed=*/false));
|
assert(S.isDefined());
|
||||||
|
|
||||||
// Find the target symbol of this weak alias and export that index
|
// Find the target symbol of this weak alias and export that index
|
||||||
const auto &WS = static_cast<const MCSymbolWasm &>(S);
|
const auto &WS = static_cast<const MCSymbolWasm &>(S);
|
||||||
|
Loading…
Reference in New Issue
Block a user