diff options
| author | JF Bastien <jfb@google.com> | 2015-08-25 22:23:15 +0000 |
|---|---|---|
| committer | JF Bastien <jfb@google.com> | 2015-08-25 22:23:15 +0000 |
| commit | 289287060b7076935b544ba60cc6b5b5091da7c8 (patch) | |
| tree | 0a8d299c0e96acd034a95ceffeef34e4b10f77de | |
| parent | f8af87957c2e1069f730e2363b4ad07727f05582 (diff) | |
| download | bcm5719-llvm-289287060b7076935b544ba60cc6b5b5091da7c8.tar.gz bcm5719-llvm-289287060b7076935b544ba60cc6b5b5091da7c8.zip | |
WebAssembly: comment out .globl when printing textual assembly
Do the same for .weak (not implemented for now, but may as well to it). Update comment string to two semicolons.
llvm-svn: 245982
| -rw-r--r-- | llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCAsmInfo.cpp | 5 | ||||
| -rw-r--r-- | llvm/test/CodeGen/WebAssembly/globl.ll | 14 |
2 files changed, 18 insertions, 1 deletions
diff --git a/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCAsmInfo.cpp b/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCAsmInfo.cpp index c3ab48fd405..e8732abbbc7 100644 --- a/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCAsmInfo.cpp +++ b/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCAsmInfo.cpp @@ -28,7 +28,7 @@ WebAssemblyMCAsmInfo::WebAssemblyMCAsmInfo(const Triple &T) { // TODO: What should MaxInstLength be? // The s-expression format of WebAssembly uses LISP-style comments. - CommentString = ";"; + CommentString = ";;"; PrivateGlobalPrefix = ""; PrivateLabelPrefix = ""; @@ -52,5 +52,8 @@ WebAssemblyMCAsmInfo::WebAssemblyMCAsmInfo(const Triple &T) { // For now, WebAssembly does not support exceptions. ExceptionsType = ExceptionHandling::None; + WeakDirective = "\t;; .weak\t"; + GlobalDirective = "\t;; .globl\t"; + // TODO: UseIntegratedAssembler? } diff --git a/llvm/test/CodeGen/WebAssembly/globl.ll b/llvm/test/CodeGen/WebAssembly/globl.ll new file mode 100644 index 00000000000..571f793e3b7 --- /dev/null +++ b/llvm/test/CodeGen/WebAssembly/globl.ll @@ -0,0 +1,14 @@ +; RUN: llc < %s -asm-verbose=false | FileCheck %s + +; Test that the `.globl` directive is commented out. + +target datalayout = "e-p:32:32-i64:64-v128:8:128-n32:64-S128" +target triple = "wasm32-unknown-unknown" + +; CHECK-NOT: globl +; CHECK: ;; .globl foo +; CHECK-NOT: globl +; CHECK-LABEL: foo: +define void @foo() { + ret void +} |

