[llvm-branch-commits] [llvm-gcc-branch] r104782 - in /llvm-gcc-4.2/branches/Apple/Morbo: ./ gcc/cp/cp-lang.c gcc/langhooks-def.h gcc/langhooks.h gcc/llvm-convert.cpp
Bill Wendling
isanbard at gmail.com
Wed May 26 16:14:54 PDT 2010
Author: void
Date: Wed May 26 18:14:54 2010
New Revision: 104782
URL: http://llvm.org/viewvc/llvm-project?rev=104782&view=rev
Log:
$ svn merge -c 104181 https://llvm.org/svn/llvm-project/llvm-gcc-4.2/trunk
--- Merging r104181 into '.':
U gcc/cp/cp-lang.c
U gcc/llvm-convert.cpp
U gcc/langhooks.h
U gcc/langhooks-def.h
Modified:
llvm-gcc-4.2/branches/Apple/Morbo/ (props changed)
llvm-gcc-4.2/branches/Apple/Morbo/gcc/cp/cp-lang.c
llvm-gcc-4.2/branches/Apple/Morbo/gcc/langhooks-def.h
llvm-gcc-4.2/branches/Apple/Morbo/gcc/langhooks.h
llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm-convert.cpp
Propchange: llvm-gcc-4.2/branches/Apple/Morbo/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed May 26 18:14:54 2010
@@ -1,2 +1,2 @@
/llvm/trunk:100565
-/llvm-gcc-4.2/trunk:98728,98841,98893,99196,99305,99592-99593,99629,99670,99982,99984-99986,99988,99992-99993,99995,99997-99999,100035,100149,100303,100565,100624-100626,100712,100721,101090-101091,101199,101216,101304,101333,101804,101959,102139,102148,102433,102444,102506-102507,102511,102532,102561,102589,102636,102648,102745,103361,103366-103367,103394,103414,103644,103800,103918,104420,104423,104726
+/llvm-gcc-4.2/trunk:98728,98841,98893,99196,99305,99592-99593,99629,99670,99982,99984-99986,99988,99992-99993,99995,99997-99999,100035,100149,100303,100565,100624-100626,100712,100721,101090-101091,101199,101216,101304,101333,101804,101959,102139,102148,102433,102444,102506-102507,102511,102532,102561,102589,102636,102648,102745,103361,103366-103367,103394,103414,103644,103800,103918,104181,104384,104420,104423,104726
Modified: llvm-gcc-4.2/branches/Apple/Morbo/gcc/cp/cp-lang.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Morbo/gcc/cp/cp-lang.c?rev=104782&r1=104781&r2=104782&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Morbo/gcc/cp/cp-lang.c (original)
+++ llvm-gcc-4.2/branches/Apple/Morbo/gcc/cp/cp-lang.c Wed May 26 18:14:54 2010
@@ -36,20 +36,26 @@
enum c_language_kind c_language = clk_cxx;
static void cp_init_ts (void);
+/* LLVM LOCAL <rdar://problem/7929157> */
+static bool cp_function_thunk_p (tree fndecl);
/* Lang hooks common to C++ and ObjC++ are declared in cp/cp-objcp-common.h;
consequently, there should be very few hooks below. */
#undef LANG_HOOKS_NAME
-#define LANG_HOOKS_NAME "GNU C++"
+#define LANG_HOOKS_NAME "GNU C++"
#undef LANG_HOOKS_INIT
-#define LANG_HOOKS_INIT cxx_init
+#define LANG_HOOKS_INIT cxx_init
#undef LANG_HOOKS_DECL_PRINTABLE_NAME
#define LANG_HOOKS_DECL_PRINTABLE_NAME cxx_printable_name
#undef LANG_HOOKS_FOLD_OBJ_TYPE_REF
-#define LANG_HOOKS_FOLD_OBJ_TYPE_REF cp_fold_obj_type_ref
+#define LANG_HOOKS_FOLD_OBJ_TYPE_REF cp_fold_obj_type_ref
#undef LANG_HOOKS_INIT_TS
-#define LANG_HOOKS_INIT_TS cp_init_ts
+#define LANG_HOOKS_INIT_TS cp_init_ts
+/* LLVM LOCAL begin <rdar://problem/7929157> */
+#undef LANG_HOOKS_FUNCTION_THUNK_P
+#define LANG_HOOKS_FUNCTION_THUNK_P cp_function_thunk_p
+/* LLVM LOCAL end <rdar://problem/7929157> */
/* Each front end provides its own lang hook initializer. */
const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
@@ -145,6 +151,14 @@
}
+/* LLVM LOCAL begin <rdar://problem/7929157> */
+bool
+cp_function_thunk_p (tree fndecl)
+{
+ return DECL_THUNK_P (fndecl);
+}
+/* LLVM LOCAL end <rdar://problem/7929157> */
+
void
finish_file (void)
{
Modified: llvm-gcc-4.2/branches/Apple/Morbo/gcc/langhooks-def.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Morbo/gcc/langhooks-def.h?rev=104782&r1=104781&r2=104782&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Morbo/gcc/langhooks-def.h (original)
+++ llvm-gcc-4.2/branches/Apple/Morbo/gcc/langhooks-def.h Wed May 26 18:14:54 2010
@@ -156,6 +156,9 @@
#define LANG_HOOKS_FUNCTION_LEAVE_NESTED lhd_do_nothing_f
#define LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P hook_bool_tree_true
+/* LLVM LOCAL <rdar://problem/7929157> */
+#define LANG_HOOKS_FUNCTION_THUNK_P hook_bool_tree_false
+
/* APPLE LOCAL begin radar 6353006 */
#define LANG_HOOKS_BUILD_GENERIC_BLOCK_STRUCT_TYPE \
lhd_build_generic_block_struct_type
@@ -303,64 +306,66 @@
}
/* The whole thing. The structure is defined in langhooks.h. */
-#define LANG_HOOKS_INITIALIZER { \
- LANG_HOOKS_NAME, \
- LANG_HOOKS_IDENTIFIER_SIZE, \
- LANG_HOOKS_TREE_SIZE, \
- LANG_HOOKS_INIT_OPTIONS, \
- LANG_HOOKS_INITIALIZE_DIAGNOSTICS, \
- LANG_HOOKS_HANDLE_OPTION, \
- LANG_HOOKS_MISSING_ARGUMENT, \
- LANG_HOOKS_POST_OPTIONS, \
- LANG_HOOKS_INIT, \
- LANG_HOOKS_FINISH, \
- LANG_HOOKS_PARSE_FILE, \
- LANG_HOOKS_CLEAR_BINDING_STACK, \
- LANG_HOOKS_GET_ALIAS_SET, \
- LANG_HOOKS_EXPAND_CONSTANT, \
- LANG_HOOKS_EXPAND_EXPR, \
- LANG_HOOKS_EXPAND_DECL, \
- LANG_HOOKS_SAFE_FROM_P, \
- LANG_HOOKS_FINISH_INCOMPLETE_DECL, \
- LANG_HOOKS_MARK_ADDRESSABLE, \
- LANG_HOOKS_STATICP, \
- LANG_HOOKS_DUP_LANG_SPECIFIC_DECL, \
- LANG_HOOKS_SET_DECL_ASSEMBLER_NAME, \
- LANG_HOOKS_CAN_USE_BIT_FIELDS_P, \
- LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS, \
- LANG_HOOKS_NO_BODY_BLOCKS, \
- LANG_HOOKS_PRINT_STATISTICS, \
- LANG_HOOKS_PRINT_XNODE, \
- LANG_HOOKS_PRINT_DECL, \
- LANG_HOOKS_PRINT_TYPE, \
- LANG_HOOKS_PRINT_IDENTIFIER, \
- LANG_HOOKS_DECL_PRINTABLE_NAME, \
- LANG_HOOKS_DWARF_NAME, \
- LANG_HOOKS_TYPES_COMPATIBLE_P, \
- LANG_HOOKS_GET_CALLEE_FNDECL, \
- LANG_HOOKS_PRINT_ERROR_FUNCTION, \
- LANG_HOOKS_EXPR_SIZE, \
-/* LLVM LOCAL 7659636 */ \
- LANG_HOOKS_EMPTY_TYPE_P, \
- LANG_HOOKS_TO_TARGET_CHARSET, \
- LANG_HOOKS_ATTRIBUTE_TABLE, \
- LANG_HOOKS_COMMON_ATTRIBUTE_TABLE, \
- LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE, \
-/* APPLE LOCAL kext identify vtables */ \
- LANG_HOOKS_VTABLE_P, \
- LANG_HOOKS_FUNCTION_INITIALIZER, \
- LANG_HOOKS_TREE_INLINING_INITIALIZER, \
- LANG_HOOKS_CALLGRAPH_INITIALIZER, \
- LANG_HOOKS_TREE_DUMP_INITIALIZER, \
- LANG_HOOKS_DECLS, \
- LANG_HOOKS_FOR_TYPES_INITIALIZER, \
- LANG_HOOKS_GIMPLIFY_EXPR, \
- LANG_HOOKS_FOLD_OBJ_TYPE_REF, \
- LANG_HOOKS_BUILTIN_FUNCTION, \
- LANG_HOOKS_INIT_TS, \
- LANG_HOOKS_EXPR_TO_DECL, \
-/* APPLE LOCAL radar 6353006 */ \
- LANG_HOOKS_BUILD_GENERIC_BLOCK_STRUCT_TYPE, \
+#define LANG_HOOKS_INITIALIZER { \
+ LANG_HOOKS_NAME, \
+ LANG_HOOKS_IDENTIFIER_SIZE, \
+ LANG_HOOKS_TREE_SIZE, \
+ LANG_HOOKS_INIT_OPTIONS, \
+ LANG_HOOKS_INITIALIZE_DIAGNOSTICS, \
+ LANG_HOOKS_HANDLE_OPTION, \
+ LANG_HOOKS_MISSING_ARGUMENT, \
+ LANG_HOOKS_POST_OPTIONS, \
+ LANG_HOOKS_INIT, \
+ LANG_HOOKS_FINISH, \
+ LANG_HOOKS_PARSE_FILE, \
+ LANG_HOOKS_CLEAR_BINDING_STACK, \
+ LANG_HOOKS_GET_ALIAS_SET, \
+ LANG_HOOKS_EXPAND_CONSTANT, \
+ LANG_HOOKS_EXPAND_EXPR, \
+ LANG_HOOKS_EXPAND_DECL, \
+ LANG_HOOKS_SAFE_FROM_P, \
+ LANG_HOOKS_FINISH_INCOMPLETE_DECL, \
+ LANG_HOOKS_MARK_ADDRESSABLE, \
+ LANG_HOOKS_STATICP, \
+ LANG_HOOKS_DUP_LANG_SPECIFIC_DECL, \
+ LANG_HOOKS_SET_DECL_ASSEMBLER_NAME, \
+ LANG_HOOKS_CAN_USE_BIT_FIELDS_P, \
+ LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS, \
+ LANG_HOOKS_NO_BODY_BLOCKS, \
+ LANG_HOOKS_PRINT_STATISTICS, \
+ LANG_HOOKS_PRINT_XNODE, \
+ LANG_HOOKS_PRINT_DECL, \
+ LANG_HOOKS_PRINT_TYPE, \
+ LANG_HOOKS_PRINT_IDENTIFIER, \
+ LANG_HOOKS_DECL_PRINTABLE_NAME, \
+ LANG_HOOKS_DWARF_NAME, \
+ LANG_HOOKS_TYPES_COMPATIBLE_P, \
+ LANG_HOOKS_GET_CALLEE_FNDECL, \
+ LANG_HOOKS_PRINT_ERROR_FUNCTION, \
+ LANG_HOOKS_EXPR_SIZE, \
+ /* LLVM LOCAL 7659636 */ \
+ LANG_HOOKS_EMPTY_TYPE_P, \
+ LANG_HOOKS_TO_TARGET_CHARSET, \
+ LANG_HOOKS_ATTRIBUTE_TABLE, \
+ LANG_HOOKS_COMMON_ATTRIBUTE_TABLE, \
+ LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE, \
+ /* APPLE LOCAL kext identify vtables */ \
+ LANG_HOOKS_VTABLE_P, \
+ LANG_HOOKS_FUNCTION_INITIALIZER, \
+ LANG_HOOKS_TREE_INLINING_INITIALIZER, \
+ LANG_HOOKS_CALLGRAPH_INITIALIZER, \
+ LANG_HOOKS_TREE_DUMP_INITIALIZER, \
+ LANG_HOOKS_DECLS, \
+ LANG_HOOKS_FOR_TYPES_INITIALIZER, \
+ LANG_HOOKS_GIMPLIFY_EXPR, \
+ LANG_HOOKS_FOLD_OBJ_TYPE_REF, \
+ LANG_HOOKS_BUILTIN_FUNCTION, \
+ LANG_HOOKS_INIT_TS, \
+ LANG_HOOKS_EXPR_TO_DECL, \
+ /* APPLE LOCAL radar 6353006 */ \
+ LANG_HOOKS_BUILD_GENERIC_BLOCK_STRUCT_TYPE, \
+ /* LLVM LOCAL <rdar://problem/7929157> */ \
+ LANG_HOOKS_FUNCTION_THUNK_P, \
}
#endif /* GCC_LANG_HOOKS_DEF_H */
Modified: llvm-gcc-4.2/branches/Apple/Morbo/gcc/langhooks.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Morbo/gcc/langhooks.h?rev=104782&r1=104781&r2=104782&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Morbo/gcc/langhooks.h (original)
+++ llvm-gcc-4.2/branches/Apple/Morbo/gcc/langhooks.h Wed May 26 18:14:54 2010
@@ -479,13 +479,17 @@
TREE_SIDE_EFFECTS need updating. */
tree (*expr_to_decl) (tree expr, bool *tc, bool *ti, bool *se);
-
/* APPLE LOCAL begin radar 6353006 */
/* For c-based languages, builds a generic type for Blocks pointers (for
emitting debug information. For other languages, returns NULL. */
tree (*build_generic_block_struct_type) (void);
/* APPLE LOCAL end radar 6353006 */
+ /* LLVM LOCAL begin <rdar://problem/7929157> */
+ /* Returns true if the function decl is a thunk. */
+ bool (*function_is_thunk_p) (tree fndecl);
+ /* LLVM LOCAL end <rdar://problem/7929157> */
+
/* Whenever you add entries here, make sure you adjust langhooks-def.h
and langhooks.c accordingly. */
};
Modified: llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm-convert.cpp?rev=104782&r1=104781&r2=104782&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm-convert.cpp Wed May 26 18:14:54 2010
@@ -527,7 +527,7 @@
// The function should not already have a body.
assert(Fn->empty() && "Function expanded multiple times!");
-
+
// Compute the linkage that the function should get.
if (DECL_LLVM_PRIVATE(FnDecl)) {
Fn->setLinkage(Function::PrivateLinkage);
@@ -540,10 +540,10 @@
Fn->setLinkage(Function::AvailableExternallyLinkage);
} else if (DECL_COMDAT(FnDecl)) {
Fn->setLinkage(Function::getLinkOnceLinkage(flag_odr));
- } else if (DECL_WEAK(FnDecl)) {
+ } else if (DECL_WEAK(FnDecl) && !lang_hooks.function_is_thunk_p (FnDecl)) {
// The user may have explicitly asked for weak linkage - ignore flag_odr.
Fn->setLinkage(Function::WeakAnyLinkage);
- } else if (DECL_ONE_ONLY(FnDecl)) {
+ } else if (DECL_ONE_ONLY(FnDecl) || lang_hooks.function_is_thunk_p (FnDecl)) {
Fn->setLinkage(Function::getWeakLinkage(flag_odr));
} else if (IS_EXTERN_INLINE(FnDecl)) {
// gcc "extern inline", C99 "inline"
More information about the llvm-branch-commits
mailing list