[PATCH] D71493: [WebAssembly] Setting export_name implies no_dead_strip

Sam Clegg via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 16 14:44:59 PST 2019


sbc100 updated this revision to Diff 234160.
sbc100 added a comment.

- revert part


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71493/new/

https://reviews.llvm.org/D71493

Files:
  clang/lib/Sema/SemaDeclAttr.cpp
  clang/test/CodeGen/wasm-export-name.c


Index: clang/test/CodeGen/wasm-export-name.c
===================================================================
--- clang/test/CodeGen/wasm-export-name.c
+++ clang/test/CodeGen/wasm-export-name.c
@@ -6,6 +6,8 @@
   return 43;
 }
 
+// CHECK: @llvm.used = appending global [1 x i8*] [i8* bitcast (i32 ()* @foo to i8*)]
+
 // CHECK: define i32 @foo() [[A:#[0-9]+]]
 
 // CHECK: attributes [[A]] = {{{.*}} "wasm-export-name"="bar" {{.*}}}
Index: clang/lib/Sema/SemaDeclAttr.cpp
===================================================================
--- clang/lib/Sema/SemaDeclAttr.cpp
+++ clang/lib/Sema/SemaDeclAttr.cpp
@@ -5772,8 +5772,8 @@
   if (!S.checkStringLiteralArgumentAttr(AL, 0, Str, &ArgLoc))
     return;
 
-  FD->addAttr(::new (S.Context)
-                  WebAssemblyExportNameAttr(S.Context, AL, Str));
+  D->addAttr(::new (S.Context) WebAssemblyExportNameAttr(S.Context, AL, Str));
+  D->addAttr(UsedAttr::CreateImplicit(S.Context));
 }
 
 static void handleWebAssemblyImportModuleAttr(Sema &S, Decl *D, const ParsedAttr &AL) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71493.234160.patch
Type: text/x-patch
Size: 1042 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191216/e2de47cb/attachment-0001.bin>


More information about the cfe-commits mailing list