[PATCH] D74565: [WebAssembly] Remove unneeded getWasmKindForNamedSection function

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 13 08:51:49 PST 2020


sbc100 created this revision.
Herald added subscribers: llvm-commits, sunfish, aheejin, hiraditya, jgravelle-google, dschuff.
Herald added a project: LLVM.
sbc100 added a reviewer: dschuff.

I believe this was carried over from getELFKindForNamedSection since
the wasm backend originally used ELF object writing as a template.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D74565

Files:
  llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp


Index: llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
===================================================================
--- llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -1691,16 +1691,6 @@
   return C;
 }
 
-static SectionKind getWasmKindForNamedSection(StringRef Name, SectionKind K) {
-  // If we're told we have function data, then use that.
-  if (K.isText())
-    return SectionKind::getText();
-
-  // Otherwise, ignore whatever section type the generic impl detected and use
-  // a plain data section.
-  return SectionKind::getData();
-}
-
 MCSection *TargetLoweringObjectFileWasm::getExplicitSectionGlobal(
     const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
   // We don't support explict section names for functions in the wasm object
@@ -1711,8 +1701,6 @@
 
   StringRef Name = GO->getSection();
 
-  Kind = getWasmKindForNamedSection(Name, Kind);
-
   StringRef Group = "";
   if (const Comdat *C = getWasmComdat(GO)) {
     Group = C->getName();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74565.244452.patch
Type: text/x-patch
Size: 1056 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200213/5b6012de/attachment.bin>


More information about the llvm-commits mailing list