[llvm-commits] [llvm-gcc-4.2] r46747 - in /llvm-gcc-4.2/trunk/gcc: config/darwin.c config/rs6000/rs6000.c varasm.c
Bill Wendling
isanbard at gmail.com
Tue Feb 5 01:46:25 PST 2008
Author: void
Date: Tue Feb 5 03:46:24 2008
New Revision: 46747
URL: http://llvm.org/viewvc/llvm-project?rev=46747&view=rev
Log:
maybe_assemble_visibility issues a warning if the visibility isn't supported on
a particular platform. A configuration might check for visibility. A warning in
this case indicates that it's not supported. So this warning is actually
important.
Make it so!
Modified:
llvm-gcc-4.2/trunk/gcc/config/darwin.c
llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c
llvm-gcc-4.2/trunk/gcc/varasm.c
Modified: llvm-gcc-4.2/trunk/gcc/config/darwin.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/darwin.c?rev=46747&r1=46746&r2=46747&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/darwin.c (original)
+++ llvm-gcc-4.2/trunk/gcc/config/darwin.c Tue Feb 5 03:46:24 2008
@@ -1988,6 +1988,19 @@
extern". There is no MACH-O equivalent of ELF's
VISIBILITY_INTERNAL or VISIBILITY_PROTECTED. */
+/* LLVM LOCAL begin */
+#ifdef ENABLE_LLVM
+void
+darwin_assemble_visibility (tree decl ATTRIBUTE_UNUSED, int vis)
+{
+ /* Emit a warning if the visibility isn't supported with this
+ configuration. We don't want to output anything to the ASM file, of
+ course. */
+ if (!(vis == VISIBILITY_DEFAULT || vis == VISIBILITY_HIDDEN))
+ warning (OPT_Wattributes, "internal and protected visibility attributes "
+ "not supported in this configuration; ignored");
+}
+#else
void
darwin_assemble_visibility (tree decl, int vis)
{
@@ -2004,6 +2017,8 @@
warning (OPT_Wattributes, "internal and protected visibility attributes "
"not supported in this configuration; ignored");
}
+#endif
+/* LLVM LOCAL end */
/* Output a difference of two labels that will be an assembly time
constant if the two labels are local. (.long lab1-lab2 will be
Modified: llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c?rev=46747&r1=46746&r2=46747&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c (original)
+++ llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c Tue Feb 5 03:46:24 2008
@@ -944,10 +944,14 @@
#undef TARGET_ASM_INTEGER
#define TARGET_ASM_INTEGER rs6000_assemble_integer
+/* LLVM LOCAL - Use default assemble_visibility */
+#ifndef ENABLE_LLVM
#ifdef HAVE_GAS_HIDDEN
#undef TARGET_ASM_ASSEMBLE_VISIBILITY
#define TARGET_ASM_ASSEMBLE_VISIBILITY rs6000_assemble_visibility
#endif
+/* LLVM LOCAL - Use default assemble_visibility */
+#endif
#undef TARGET_HAVE_TLS
#define TARGET_HAVE_TLS HAVE_AS_TLS
Modified: llvm-gcc-4.2/trunk/gcc/varasm.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/varasm.c?rev=46747&r1=46746&r2=46747&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/varasm.c (original)
+++ llvm-gcc-4.2/trunk/gcc/varasm.c Tue Feb 5 03:46:24 2008
@@ -1889,7 +1889,15 @@
fprintf(stderr, "LLVM must emit the data!");
abort();
}
+
emit_global_to_llvm(decl);
+
+ /* The "make_assemble_visibility" method may issue a warning if the visibility
+ attribute isn't supported in a configuration. This is all done through a
+ call-back. We want to issue this same warning when needed. */
+ if (TREE_PUBLIC (decl))
+ maybe_assemble_visibility (decl);
+
return;
#endif
/* LLVM LOCAL end */
@@ -5307,7 +5315,8 @@
name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
type = visibility_types[vis];
-#ifdef HAVE_GAS_HIDDEN
+
+#if !defined(ENABLE_LLVM) && defined(HAVE_GAS_HIDDEN)
fprintf (asm_out_file, "\t.%s\t", type);
assemble_name (asm_out_file, name);
fprintf (asm_out_file, "\n");
More information about the llvm-commits
mailing list