Skip to content

Commit 48000e6

Browse files
author
git apple-llvm automerger
committed
Merge commit '6e006e11f350' from llvm.org/release/19.x into stable/20240723
2 parents 39e04d2 + 6e006e1 commit 48000e6

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,7 @@ class CoalesceFeaturesAndStripAtomics final : public ModulePass {
202202
bool runOnModule(Module &M) override {
203203
FeatureBitset Features = coalesceFeatures(M);
204204

205-
std::string FeatureStr =
206-
getFeatureString(Features, WasmTM->getTargetFeatureString());
205+
std::string FeatureStr = getFeatureString(Features);
207206
WasmTM->setTargetFeatureString(FeatureStr);
208207
for (auto &F : M)
209208
replaceFeatures(F, FeatureStr);
@@ -241,17 +240,14 @@ class CoalesceFeaturesAndStripAtomics final : public ModulePass {
241240
return Features;
242241
}
243242

244-
static std::string getFeatureString(const FeatureBitset &Features,
245-
StringRef TargetFS) {
243+
static std::string getFeatureString(const FeatureBitset &Features) {
246244
std::string Ret;
247245
for (const SubtargetFeatureKV &KV : WebAssemblyFeatureKV) {
248246
if (Features[KV.Value])
249247
Ret += (StringRef("+") + KV.Key + ",").str();
248+
else
249+
Ret += (StringRef("-") + KV.Key + ",").str();
250250
}
251-
SubtargetFeatures TF{TargetFS};
252-
for (std::string const &F : TF.getFeatures())
253-
if (!SubtargetFeatures::isEnabled(F))
254-
Ret += F + ",";
255251
return Ret;
256252
}
257253

0 commit comments

Comments
 (0)