[llvm-commits] [llvm-gcc-4.2] r63051 - in /llvm-gcc-4.2/trunk/gcc: gimplify.c llvm-backend.cpp llvm-convert.cpp tree.h
Bill Wendling
isanbard at gmail.com
Mon Jan 26 14:13:14 PST 2009
Author: void
Date: Mon Jan 26 16:13:14 2009
New Revision: 63051
URL: http://llvm.org/viewvc/llvm-project?rev=63051&view=rev
Log:
This "private" stuff was causing Objective-C programs to fail. Reverting r62850:
$ cat f.m
#include <Foundation/Foundation.h>
void foo() {
NSLog(@"");
NSLog(@"hello world");
}
int main() {
foo();
return 0;
}
$ llvm-gcc -o - -S f.m
f.m: In function ‘foo’:
f.m:2: internal compiler error: tree check: expected tree that contains ‘decl with visibility’ structure, have ‘const_decl’ in emit_global_to_llvm, at llvm-backend.cpp:1087
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.
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=63051&r1=63050&r2=63051&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/gimplify.c (original)
+++ llvm-gcc-4.2/trunk/gcc/gimplify.c Mon Jan 26 16:13:14 2009
@@ -3096,7 +3096,6 @@
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=63051&r1=63050&r2=63051&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Mon Jan 26 16:13:14 2009
@@ -830,9 +830,7 @@
GlobalValue::LinkageTypes Linkage;
// A weak alias has TREE_PUBLIC set but not the other bits.
- if (DECL_LLVM_PRIVATE(decl))
- Linkage = GlobalValue::PrivateLinkage;
- else if (DECL_WEAK(decl))
+ if (DECL_WEAK(decl))
Linkage = GlobalValue::WeakLinkage;
else if (!TREE_PUBLIC(decl))
Linkage = GlobalValue::InternalLinkage;
@@ -1084,9 +1082,7 @@
GV->setThreadLocal(true);
// Set the linkage.
- if (DECL_LLVM_PRIVATE(decl)) {
- GV->setLinkage(GlobalValue::PrivateLinkage);
- } else if (!TREE_PUBLIC(decl)) {
+ 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=63051&r1=63050&r2=63051&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Mon Jan 26 16:13:14 2009
@@ -642,9 +642,7 @@
// 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 (DECL_LLVM_PRIVATE(FnDecl)) {
- Fn->setLinkage(Function::PrivateLinkage);
- } else if (!TREE_PUBLIC(FnDecl) /*|| lang_hooks.llvm_is_in_anon(subr)*/) {
+ 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=63051&r1=63050&r2=63051&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/tree.h (original)
+++ llvm-gcc-4.2/trunk/gcc/tree.h Mon Jan 26 16:13:14 2009
@@ -2916,9 +2916,6 @@
/* 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) \
@@ -3055,10 +3052,6 @@
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. */
@@ -3079,7 +3072,7 @@
unsigned block_synthesized_function : 1;
/* APPLE LOCAL radar 5847976 */
unsigned block_weak : 1;
- /* 4 unused bits. */
+ /* 5 unused bits. */
/* APPLE LOCAL end radar 5932809 - copyable byref blocks */
/* APPLE LOCAL end radar 5732232 - blocks */
};
More information about the llvm-commits
mailing list