r319801 - [WebAssembly] Don't use Wasm function sections for more than one function

Dan Gohman via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 5 09:46:17 PST 2017


Author: djg
Date: Tue Dec  5 09:46:17 2017
New Revision: 319801

URL: http://llvm.org/viewvc/llvm-project?rev=319801&view=rev
Log:
[WebAssembly] Don't use Wasm function sections for more than one function

Patch by Nicholas Wilson!

Fixes PR35467.

Differential Revision: https://reviews.llvm.org/D40738

Modified:
    cfe/trunk/lib/Basic/Targets/OSTargets.h
    cfe/trunk/test/CodeGenCXX/static-init-wasm.cpp

Modified: cfe/trunk/lib/Basic/Targets/OSTargets.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets/OSTargets.h?rev=319801&r1=319800&r2=319801&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets/OSTargets.h (original)
+++ cfe/trunk/lib/Basic/Targets/OSTargets.h Tue Dec  5 09:46:17 2017
@@ -711,11 +711,6 @@ class LLVM_LIBRARY_VISIBILITY WebAssembl
       Builder.defineMacro("_GNU_SOURCE");
   }
 
-  // As an optimization, group static init code together in a section.
-  const char *getStaticInitSectionSpecifier() const final {
-    return ".text.__startup";
-  }
-
 public:
   explicit WebAssemblyOSTargetInfo(const llvm::Triple &Triple,
                                    const TargetOptions &Opts)

Modified: cfe/trunk/test/CodeGenCXX/static-init-wasm.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/static-init-wasm.cpp?rev=319801&r1=319800&r2=319801&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/static-init-wasm.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/static-init-wasm.cpp Tue Dec  5 09:46:17 2017
@@ -43,12 +43,12 @@ struct A {
 
 A theA;
 
-// WEBASSEMBLY32: define internal void @__cxx_global_var_init() #3 section ".text.__startup" {
+// WEBASSEMBLY32: define internal void @__cxx_global_var_init() #3 {
 // WEBASSEMBLY32: call %struct.A* @_ZN1AC1Ev(%struct.A* @theA)
-// WEBASSEMBLY32: define internal void @_GLOBAL__sub_I_static_init_wasm.cpp() #3 section ".text.__startup" {
+// WEBASSEMBLY32: define internal void @_GLOBAL__sub_I_static_init_wasm.cpp() #3 {
 // WEBASSEMBLY32: call void @__cxx_global_var_init()
 //
-// WEBASSEMBLY64: define internal void @__cxx_global_var_init() #3 section ".text.__startup" {
+// WEBASSEMBLY64: define internal void @__cxx_global_var_init() #3 {
 // WEBASSEMBLY64: call %struct.A* @_ZN1AC1Ev(%struct.A* @theA)
-// WEBASSEMBLY64: define internal void @_GLOBAL__sub_I_static_init_wasm.cpp() #3 section ".text.__startup" {
+// WEBASSEMBLY64: define internal void @_GLOBAL__sub_I_static_init_wasm.cpp() #3 {
 // WEBASSEMBLY64: call void @__cxx_global_var_init()




More information about the cfe-commits mailing list