aboutsummaryrefslogtreecommitdiff
path: root/lib/MC/MCWasmStreamer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/MC/MCWasmStreamer.cpp')
-rw-r--r--lib/MC/MCWasmStreamer.cpp26
1 files changed, 15 insertions, 11 deletions
diff --git a/lib/MC/MCWasmStreamer.cpp b/lib/MC/MCWasmStreamer.cpp
index d2a152058b90..86fa72197855 100644
--- a/lib/MC/MCWasmStreamer.cpp
+++ b/lib/MC/MCWasmStreamer.cpp
@@ -1,9 +1,8 @@
//===- lib/MC/MCWasmStreamer.cpp - Wasm Object Output ---------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
@@ -35,15 +34,15 @@
using namespace llvm;
-MCWasmStreamer::~MCWasmStreamer() {}
+MCWasmStreamer::~MCWasmStreamer() = default; // anchor.
void MCWasmStreamer::mergeFragment(MCDataFragment *DF, MCDataFragment *EF) {
flushPendingLabels(DF, DF->getContents().size());
- for (unsigned i = 0, e = EF->getFixups().size(); i != e; ++i) {
- EF->getFixups()[i].setOffset(EF->getFixups()[i].getOffset() +
+ for (unsigned I = 0, E = EF->getFixups().size(); I != E; ++I) {
+ EF->getFixups()[I].setOffset(EF->getFixups()[I].getOffset() +
DF->getContents().size());
- DF->getFixups().push_back(EF->getFixups()[i]);
+ DF->getFixups().push_back(EF->getFixups()[I]);
}
if (DF->getSubtargetInfo() == nullptr && EF->getSubtargetInfo())
DF->setHasInstructions(*EF->getSubtargetInfo());
@@ -119,6 +118,11 @@ bool MCWasmStreamer::EmitSymbolAttribute(MCSymbol *S, MCSymbolAttr Attribute) {
break;
case MCSA_ELF_TypeObject:
+ case MCSA_Cold:
+ break;
+
+ case MCSA_NoDeadStrip:
+ Symbol->setExported();
break;
default:
@@ -179,9 +183,9 @@ void MCWasmStreamer::EmitInstToData(const MCInst &Inst,
MCDataFragment *DF = getOrCreateDataFragment();
// Add the fixups and data.
- for (unsigned i = 0, e = Fixups.size(); i != e; ++i) {
- Fixups[i].setOffset(Fixups[i].getOffset() + DF->getContents().size());
- DF->getFixups().push_back(Fixups[i]);
+ for (unsigned I = 0, E = Fixups.size(); I != E; ++I) {
+ Fixups[I].setOffset(Fixups[I].getOffset() + DF->getContents().size());
+ DF->getFixups().push_back(Fixups[I]);
}
DF->setHasInstructions(STI);
DF->getContents().append(Code.begin(), Code.end());