[compiler-rt] r209095 - assembly: support symbol definitions for COFF

Saleem Abdulrasool compnerd at compnerd.org
Sun May 18 11:39:15 PDT 2014


Author: compnerd
Date: Sun May 18 13:39:15 2014
New Revision: 209095

URL: http://llvm.org/viewvc/llvm-project?rev=209095&view=rev
Log:
assembly: support symbol definitions for COFF

Extend the function definition macros further to support COFF object emission.
The function definition in COFF includes the type and storage class in the
symbol definition context.  This is needed to make the assembly routines
possible to be built for COFF environments (i.e. Windows).

Modified:
    compiler-rt/trunk/lib/builtins/assembly.h

Modified: compiler-rt/trunk/lib/builtins/assembly.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/assembly.h?rev=209095&r1=209094&r2=209095&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/assembly.h (original)
+++ compiler-rt/trunk/lib/builtins/assembly.h Sun May 18 13:39:15 2014
@@ -28,7 +28,7 @@
 // tell linker it can break up file at label boundaries
 #define FILE_LEVEL_DIRECTIVE .subsections_via_symbols
 #define SYMBOL_IS_FUNC(name)
-#else
+#elif defined(__ELF__)
 #define HIDDEN(name) .hidden name
 #define LOCAL_LABEL(name) .L_##name
 #define FILE_LEVEL_DIRECTIVE
@@ -37,6 +37,15 @@
 #else
 #define SYMBOL_IS_FUNC(name) .type name, at function
 #endif
+#else
+#define HIDDEN_DIRECTIVE(name)
+#define LOCAL_LABEL(name) .L ## name
+#define SYMBOL_IS_FUNC(name)                                                   \
+  .def name SEPARATOR                                                          \
+    .scl 3 SEPARATOR                                                           \
+    .type 32 SEPARATOR                                                         \
+  .endef
+#define FILE_LEVEL_DIRECTIVE
 #endif
 
 #if defined(__arm__)





More information about the llvm-commits mailing list