[llvm-commits] [llvm-gcc-4.2] r63109 - in /llvm-gcc-4.2/trunk/gcc: gimplify.c llvm-backend.cpp llvm-convert.cpp tree.h
Stuart Hastings
stuart at apple.com
Tue Jan 27 10:10:47 PST 2009
Author: stuart
Date: Tue Jan 27 12:10:47 2009
New Revision: 63109
URL: http://llvm.org/viewvc/llvm-project?rev=63109&view=rev
Log:
Restoring DECL_LLVM_PRIVATE (rev 62850) with a patch to fix some ObjC DejaGNU regressions.
Modified:
llvm-gcc-4.2/trunk/gcc/gimplify.c
llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
llvm-gcc-4.2/trunk/gcc/tree.h
Modified: llvm-gcc-4.2/trunk/gcc/gimplify.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/gimplify.c?rev=63109&r1=63108&r2=63109&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/gimplify.c (original)
+++ llvm-gcc-4.2/trunk/gcc/gimplify.c Tue Jan 27 12:10:47 2009
@@ -3096,6 +3096,7 @@
gimple_add_tmp_var (new);
TREE_STATIC (new) = 1;
TREE_READONLY (new) = 1;
+ DECL_LLVM_PRIVATE (new) = 1;
DECL_INITIAL (new) = ctor;
if (align > DECL_ALIGN (new))
{
Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=63109&r1=63108&r2=63109&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Tue Jan 27 12:10:47 2009
@@ -833,7 +833,9 @@
GlobalValue::LinkageTypes Linkage;
// A weak alias has TREE_PUBLIC set but not the other bits.
- if (DECL_WEAK(decl))
+ if (DECL_LLVM_PRIVATE(decl))
+ Linkage = GlobalValue::PrivateLinkage;
+ else if (DECL_WEAK(decl))
Linkage = GlobalValue::WeakLinkage;
else if (!TREE_PUBLIC(decl))
Linkage = GlobalValue::InternalLinkage;
@@ -1085,7 +1087,10 @@
GV->setThreadLocal(true);
// Set the linkage.
- if (!TREE_PUBLIC(decl)) {
+ if (CODE_CONTAINS_STRUCT (TREE_CODE (decl), TS_DECL_WITH_VIS)
+ && DECL_LLVM_PRIVATE(decl)) {
+ GV->setLinkage(GlobalValue::PrivateLinkage);
+ } else if (!TREE_PUBLIC(decl)) {
GV->setLinkage(GlobalValue::InternalLinkage);
} else if (DECL_WEAK(decl) || DECL_ONE_ONLY(decl)) {
GV->setLinkage(GlobalValue::WeakLinkage);
Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=63109&r1=63108&r2=63109&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Tue Jan 27 12:10:47 2009
@@ -642,7 +642,9 @@
// emitted; hack this by pretending they're static. That will either
// make them go away or emit a static definition that won't collide with
// anything.
- if (!TREE_PUBLIC(FnDecl) /*|| lang_hooks.llvm_is_in_anon(subr)*/) {
+ if (DECL_LLVM_PRIVATE(FnDecl)) {
+ Fn->setLinkage(Function::PrivateLinkage);
+ } else if (!TREE_PUBLIC(FnDecl) /*|| lang_hooks.llvm_is_in_anon(subr)*/) {
Fn->setLinkage(Function::InternalLinkage);
} else if (DECL_EXTERNAL(FnDecl) &&
lookup_attribute ("always_inline", DECL_ATTRIBUTES (FnDecl))) {
Modified: llvm-gcc-4.2/trunk/gcc/tree.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/tree.h?rev=63109&r1=63108&r2=63109&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/tree.h (original)
+++ llvm-gcc-4.2/trunk/gcc/tree.h Tue Jan 27 12:10:47 2009
@@ -2916,6 +2916,9 @@
/* Used to indicate that this DECL has weak linkage. */
#define DECL_WEAK(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.weak_flag)
+#define DECL_LLVM_PRIVATE(NODE) \
+ (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.llvm_private_flag)
+
/* Internal to the gimplifier. Indicates that the value is a formal
temporary controlled by the gimplifier. */
#define DECL_GIMPLE_FORMAL_TEMP_P(DECL) \
@@ -3052,6 +3055,10 @@
unsigned weak_flag:1;
unsigned seen_in_bind_expr : 1;
unsigned comdat_flag : 1;
+
+ /* LLVM LOCAL */
+ unsigned llvm_private_flag : 1;
+
ENUM_BITFIELD(symbol_visibility) visibility : 2;
unsigned visibility_specified : 1;
/* Belong to FUNCTION_DECL exclusively. */
@@ -3072,7 +3079,7 @@
unsigned block_synthesized_function : 1;
/* APPLE LOCAL radar 5847976 */
unsigned block_weak : 1;
- /* 5 unused bits. */
+ /* 4 unused bits. */
/* APPLE LOCAL end radar 5932809 - copyable byref blocks */
/* APPLE LOCAL end radar 5732232 - blocks */
};
More information about the llvm-commits
mailing list