From: Dan Gohman Date: Tue, 5 Dec 2017 17:46:17 +0000 (+0000) Subject: [WebAssembly] Don't use Wasm function sections for more than one function X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9dec99fdb04cb694bdaa3ee12e0796bdb7f2a781;p=clang [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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@319801 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Basic/Targets/OSTargets.h b/lib/Basic/Targets/OSTargets.h index 03895f7159..5af63615dc 100644 --- a/lib/Basic/Targets/OSTargets.h +++ b/lib/Basic/Targets/OSTargets.h @@ -711,11 +711,6 @@ class LLVM_LIBRARY_VISIBILITY WebAssemblyOSTargetInfo 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) diff --git a/test/CodeGenCXX/static-init-wasm.cpp b/test/CodeGenCXX/static-init-wasm.cpp index 5f2f94fd85..68d139157e 100644 --- a/test/CodeGenCXX/static-init-wasm.cpp +++ b/test/CodeGenCXX/static-init-wasm.cpp @@ -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()