[llvm] r245982 - WebAssembly: comment out .globl when printing textual assembly

JF Bastien via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 25 15:23:15 PDT 2015


Author: jfb
Date: Tue Aug 25 17:23:15 2015
New Revision: 245982

URL: http://llvm.org/viewvc/llvm-project?rev=245982&view=rev
Log:
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.

Added:
    llvm/trunk/test/CodeGen/WebAssembly/globl.ll
Modified:
    llvm/trunk/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCAsmInfo.cpp

Modified: llvm/trunk/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCAsmInfo.cpp?rev=245982&r1=245981&r2=245982&view=diff
==============================================================================
--- llvm/trunk/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCAsmInfo.cpp Tue Aug 25 17:23:15 2015
@@ -28,7 +28,7 @@ WebAssemblyMCAsmInfo::WebAssemblyMCAsmIn
   // TODO: What should MaxInstLength be?
 
   // The s-expression format of WebAssembly uses LISP-style comments.
-  CommentString = ";";
+  CommentString = ";;";
 
   PrivateGlobalPrefix = "";
   PrivateLabelPrefix = "";
@@ -52,5 +52,8 @@ WebAssemblyMCAsmInfo::WebAssemblyMCAsmIn
   // For now, WebAssembly does not support exceptions.
   ExceptionsType = ExceptionHandling::None;
 
+  WeakDirective = "\t;; .weak\t";
+  GlobalDirective = "\t;; .globl\t";
+
   // TODO: UseIntegratedAssembler?
 }

Added: llvm/trunk/test/CodeGen/WebAssembly/globl.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/WebAssembly/globl.ll?rev=245982&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/WebAssembly/globl.ll (added)
+++ llvm/trunk/test/CodeGen/WebAssembly/globl.ll Tue Aug 25 17:23:15 2015
@@ -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
+}




More information about the llvm-commits mailing list