]> granicus.if.org Git - clang/commitdiff
[WebAssembly] Don't use Wasm function sections for more than one function
authorDan Gohman <dan433584@gmail.com>
Tue, 5 Dec 2017 17:46:17 +0000 (17:46 +0000)
committerDan Gohman <dan433584@gmail.com>
Tue, 5 Dec 2017 17:46:17 +0000 (17:46 +0000)
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

lib/Basic/Targets/OSTargets.h
test/CodeGenCXX/static-init-wasm.cpp

index 03895f7159464e7f21d81ab0fab598e25a786394..5af63615dc5ece940b094eb9f97f9a616a4c1fe3 100644 (file)
@@ -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)
index 5f2f94fd85f3d6ca0d449631fd15a0422f7110ed..68d139157e2db029d02fd7faa9c3e26ebf30f06a 100644 (file)
@@ -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()