[llvm-commits] [llvm-gcc-4.2] r54203 - in /llvm-gcc-4.2/trunk/gcc: c-common.c cp/decl.c flags.h toplev.c var-tracking.c varasm.c
Bill Wendling
isanbard at gmail.com
Tue Jul 29 23:51:52 PDT 2008
Author: void
Date: Wed Jul 30 01:51:51 2008
New Revision: 54203
URL: http://llvm.org/viewvc/llvm-project?rev=54203&view=rev
Log:
Merges from Apple's GCC 4.2 r148430
Modified:
llvm-gcc-4.2/trunk/gcc/c-common.c
llvm-gcc-4.2/trunk/gcc/cp/decl.c
llvm-gcc-4.2/trunk/gcc/flags.h
llvm-gcc-4.2/trunk/gcc/toplev.c
llvm-gcc-4.2/trunk/gcc/var-tracking.c
llvm-gcc-4.2/trunk/gcc/varasm.c
Modified: llvm-gcc-4.2/trunk/gcc/c-common.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-common.c?rev=54203&r1=54202&r2=54203&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/c-common.c (original)
+++ llvm-gcc-4.2/trunk/gcc/c-common.c Wed Jul 30 01:51:51 2008
@@ -745,12 +745,12 @@
{ "sentinel", 0, 2, false, true, true,
handle_sentinel_attribute },
/* LLVM LOCAL begin */
- #ifdef ENABLE_LLVM
+#ifdef ENABLE_LLVM
{ "annotate", 0, -1, true, false, false,
handle_annotate_attribute },
{ "gcroot", 0, 0, false, true, false,
handle_gcroot_attribute },
- #endif
+#endif
/* LLVM LOCAL end */
/* APPLE LOCAL radar 5932809 - copyable byref blocks */
{ "blocks", 1, 1, true, false, false, handle_blocks_attribute },
@@ -3254,19 +3254,20 @@
return value;
}
+/* APPLE LOCAL begin mainline aligned functions 5933878 */
/* Implement the __alignof keyword: Return the minimum required
- alignment of EXPR, measured in bytes. For VAR_DECL's and
- FIELD_DECL's return DECL_ALIGN (which can be set from an
- "aligned" __attribute__ specification). */
+ alignment of EXPR, measured in bytes. For VAR_DECLs,
+ FUNCTION_DECLs and FIELD_DECLs return DECL_ALIGN (which can be set
+ from an "aligned" __attribute__ specification). */
tree
c_alignof_expr (tree expr)
{
tree t;
- if (TREE_CODE (expr) == VAR_DECL)
+ if (VAR_OR_FUNCTION_DECL_P (expr))
t = size_int (DECL_ALIGN_UNIT (expr));
-
+/* APPLE LOCAL end mainline aligned functions 5933878 */
else if (TREE_CODE (expr) == COMPONENT_REF
&& DECL_C_BIT_FIELD (TREE_OPERAND (expr, 1)))
{
@@ -5095,7 +5096,8 @@
TYPE_ALIGN (*type) = (1 << i) * BITS_PER_UNIT;
TYPE_USER_ALIGN (*type) = 1;
}
- else if (TREE_CODE (decl) != VAR_DECL
+ /* APPLE LOCAL mainline aligned functions 5933878 */
+ else if (! VAR_OR_FUNCTION_DECL_P (decl)
/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \
&& TREE_CODE (decl) != FIELD_DECL
&& TREE_CODE (decl) != LABEL_DECL)
@@ -5104,6 +5106,20 @@
error ("alignment may not be specified for %q+D", decl);
*no_add_attrs = true;
}
+ /* APPLE LOCAL begin mainline aligned functions 5933878 */
+ else if (TREE_CODE (decl) == FUNCTION_DECL
+ && DECL_ALIGN (decl) > (1 << i) * BITS_PER_UNIT)
+ {
+ if (DECL_USER_ALIGN (decl))
+ error ("alignment for %q+D was previously specified as %d "
+ "and may not be decreased", decl,
+ DECL_ALIGN (decl) / BITS_PER_UNIT);
+ else
+ error ("alignment for %q+D must be at least %d", decl,
+ DECL_ALIGN (decl) / BITS_PER_UNIT);
+ *no_add_attrs = true;
+ }
+ /* APPLE LOCAL end mainline aligned functions 5933878 */
else
{
DECL_ALIGN (decl) = (1 << i) * BITS_PER_UNIT;
@@ -9002,10 +9018,4 @@
}
-/* APPLE LOCAL begin define this sensibly in all languages */
-bool c_flag_no_builtin(void) {
- return flag_no_builtin;
-}
-/* APPLE LOCAL end define this sensibly in all languages */
-
#include "gt-c-common.h"
Modified: llvm-gcc-4.2/trunk/gcc/cp/decl.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/decl.c?rev=54203&r1=54202&r2=54203&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/cp/decl.c (original)
+++ llvm-gcc-4.2/trunk/gcc/cp/decl.c Wed Jul 30 01:51:51 2008
@@ -3284,11 +3284,9 @@
default_visibility = VISIBILITY_HIDDEN;
/* APPLE LOCAL end mainline 2007-06-28 ms tinfo compat 4230099 */
- /* Force minimum function alignment if using the least significant
- bit of function pointers to store the virtual bit. */
- if (TARGET_PTRMEMFUNC_VBIT_LOCATION == ptrmemfunc_vbit_in_pfn
- && force_align_functions_log < 1)
- force_align_functions_log = 1;
+ /* APPLE LOCAL begin mainline aligned functions 5933878 */
+ /* Removed lines. */
+ /* APPLE LOCAL end mainline aligned functions 5933878 */
/* Initially, C. */
current_lang_name = lang_name_c;
@@ -6267,6 +6265,16 @@
if (TYPE_VOLATILE (type))
TREE_THIS_VOLATILE (decl) = 1;
+ /* APPLE LOCAL begin mainline aligned functions 5933878 */
+ /* If pointers to member functions use the least significant bit to
+ indicate whether a function is virtual, ensure a pointer
+ to this function will have that bit clear. */
+ if (TARGET_PTRMEMFUNC_VBIT_LOCATION == ptrmemfunc_vbit_in_pfn
+ && TREE_CODE (type) == METHOD_TYPE
+ && DECL_ALIGN (decl) < 2 * BITS_PER_UNIT)
+ DECL_ALIGN (decl) = 2 * BITS_PER_UNIT;
+ /* APPLE LOCAL end mainline aligned functions 5933878 */
+
if (friendp
&& TREE_CODE (orig_declarator) == TEMPLATE_ID_EXPR)
{
Modified: llvm-gcc-4.2/trunk/gcc/flags.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/flags.h?rev=54203&r1=54202&r2=54203&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/flags.h (original)
+++ llvm-gcc-4.2/trunk/gcc/flags.h Wed Jul 30 01:51:51 2008
@@ -239,8 +239,6 @@
extern int align_functions_log;
/* APPLE LOCAL begin mainline aligned functions 5933878 */
-/* LLVM FIXME: Remove next line!! */
-extern int force_align_functions_log;
/* Removed extern force_align_functions_log. */
/* APPLE LOCAL end mainline aligned functions 5933878 */
Modified: llvm-gcc-4.2/trunk/gcc/toplev.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/toplev.c?rev=54203&r1=54202&r2=54203&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/toplev.c (original)
+++ llvm-gcc-4.2/trunk/gcc/toplev.c Wed Jul 30 01:51:51 2008
@@ -399,9 +399,9 @@
int align_labels_max_skip;
int align_functions_log;
-/* Like align_functions_log above, but used by front-ends to force the
- minimum function alignment. Zero means no alignment is forced. */
-int force_align_functions_log;
+/* APPLE LOCAL begin mainline aligned functions 5933878 */
+/* Removed force_align_functions_log. */
+/* APPLE LOCAL end mainline aligned functions 5933878 */
typedef struct
{
Modified: llvm-gcc-4.2/trunk/gcc/var-tracking.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/var-tracking.c?rev=54203&r1=54202&r2=54203&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/var-tracking.c (original)
+++ llvm-gcc-4.2/trunk/gcc/var-tracking.c Wed Jul 30 01:51:51 2008
@@ -1867,6 +1867,13 @@
&& SET_DEST (XVECEXP (PATTERN (insn), 0, i)) == loc)
src = SET_SRC (XVECEXP (PATTERN (insn), 0, i));
}
+ /* APPLE LOCAL begin ARM 5595749 */
+ else if (GET_CODE (PATTERN (insn)) == COND_EXEC
+ && GET_CODE (COND_EXEC_CODE (PATTERN (insn))) == SET)
+ src = SET_SRC (COND_EXEC_CODE (PATTERN (insn)));
+ else
+ gcc_unreachable ();
+ /* APPLE LOCAL end ARM 5595749 */
if (REG_P (src))
decl = var_debug_decl (REG_EXPR (src));
@@ -1905,6 +1912,13 @@
&& SET_DEST (XVECEXP (PATTERN (insn), 0, i)) == loc)
src = SET_SRC (XVECEXP (PATTERN (insn), 0, i));
}
+ /* APPLE LOCAL begin ARM 5595749 */
+ else if (GET_CODE (PATTERN (insn)) == COND_EXEC
+ && GET_CODE (COND_EXEC_CODE (PATTERN (insn))) == SET)
+ src = SET_SRC (COND_EXEC_CODE (PATTERN (insn)));
+ else
+ gcc_unreachable ();
+ /* APPLE LOCAL end ARM 5595749 */
if (REG_P (src))
decl = var_debug_decl (REG_EXPR (src));
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=54203&r1=54202&r2=54203&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/varasm.c (original)
+++ llvm-gcc-4.2/trunk/gcc/varasm.c Wed Jul 30 01:51:51 2008
@@ -54,7 +54,9 @@
#include "cfglayout.h"
#include "basic-block.h"
/* LLVM LOCAL begin */
+#ifdef ENABLE_LLVM
#include "llvm.h"
+#endif
/* LLVM LOCAL end */
#ifdef XCOFF_DEBUGGING_INFO
@@ -1478,19 +1480,19 @@
&& !hot_label_written)
ASM_OUTPUT_LABEL (asm_out_file, cfun->hot_section_label);
+ /* APPLE LOCAL begin mainline aligned functions 5933878 */
/* Tell assembler to move to target machine's alignment for functions. */
- align = floor_log2 (FUNCTION_BOUNDARY / BITS_PER_UNIT);
- if (align < force_align_functions_log)
- align = force_align_functions_log;
+ align = floor_log2 (DECL_ALIGN (decl) / BITS_PER_UNIT);
if (align > 0)
{
ASM_OUTPUT_ALIGN (asm_out_file, align);
}
/* Handle a user-specified function alignment.
- Note that we still need to align to FUNCTION_BOUNDARY, as above,
+ Note that we still need to align to DECL_ALIGN, as above,
because ASM_OUTPUT_MAX_SKIP_ALIGN might not do any alignment at all. */
- if (align_functions_log > align
+ if (! DECL_USER_ALIGN (decl)
+ && align_functions_log > align
&& cfun->function_frequency != FUNCTION_FREQUENCY_UNLIKELY_EXECUTED)
{
#ifdef ASM_OUTPUT_MAX_SKIP_ALIGN
@@ -1500,6 +1502,7 @@
ASM_OUTPUT_ALIGN (asm_out_file, align_functions_log);
#endif
}
+ /* APPLE LOCAL end mainline aligned functions 5933878 */
#ifdef ASM_OUTPUT_FUNCTION_PREFIX
ASM_OUTPUT_FUNCTION_PREFIX (asm_out_file, fnname);
@@ -5290,7 +5293,7 @@
emit_alias_to_llvm(decl, target, target_decl);
#endif
#else
- do_assemble_alias (decl, target);
+ do_assemble_alias (decl, target);
#endif
else
{
@@ -5315,7 +5318,6 @@
name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
type = visibility_types[vis];
-
#ifdef HAVE_GAS_HIDDEN
/* LLVM LOCAL */
#ifndef ENABLE_LLVM
More information about the llvm-commits
mailing list