Go to file
Bill Wendling 4f60125dd8 The internalize pass can be dangerous for LTO.
Consider the following program:

$ cat main.c
void foo(void) { }

int main(int argc, char *argv[]) {
    foo();
    return 0;
}
$ cat bundle.c 
extern void foo(void);

void bar(void) {
     foo();
}
$ clang -o main main.c
$ clang -o bundle.so bundle.c -bundle -bundle_loader ./main
$ nm -m bundle.so
0000000000000f40 (__TEXT,__text) external _bar
                 (undefined) external _foo (from executable)
                 (undefined) external dyld_stub_binder (from libSystem)
$ clang -o main main.c -O4
$ clang -o bundle.so bundle.c -bundle -bundle_loader ./main
Undefined symbols for architecture x86_64:
  "_foo", referenced from:
      _bar in bundle-elQN6d.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The linker was told that the 'foo' in 'main' was 'internal' and had no uses, so
it was dead stripped.

Another situation is something like:

define void @foo() {
  ret void
}

define void @bar() {
  call asm volatile "call _foo" ...
  ret void
}

The only use of 'foo' is inside of an inline ASM call. Since we don't look
inside those for uses of functions, we don't specify this as a "use."

Get around this by not invoking the 'internalize' pass by default. This is an
admitted hack for LTO correctness.
<rdar://problem/11185386>

llvm-svn: 154124
2012-04-05 21:26:44 +00:00
clang Require that all static analyzer issues have a category. As part of this change, 2012-04-05 20:43:28 +00:00
compiler-rt [ASan/Win] Revert the local Makefile change slipped into the prev commit 2012-04-05 18:33:17 +00:00
debuginfo-tests Revert previous patch as the corresponding clang patch was reverted. 2012-01-26 07:01:33 +00:00
libclc Switch to BSD/MIT dual license. 2012-02-22 04:47:39 +00:00
libcxx Fix the remaining atomic tests, all of which were wrong for the case where a 2012-04-05 13:48:16 +00:00
libcxxabi I would really like to write the handlers in terms of C++11 atomics. This would give us the best performance, portablity, and safety tradeoff. Unfortunately I can not yet do that. So I've put the desired code in comments, and reverted the handler getters to the slower but safer legacy atomic intrinsics. 2012-03-19 16:56:51 +00:00
lld Remove trailing whitespace. 2012-04-03 18:40:27 +00:00
lldb Enable building the POSIX-DYLD dynamic loader plug-in in the Makefile build since it can be used for remote debugging. 2012-04-05 17:43:02 +00:00
llvm The internalize pass can be dangerous for LTO. 2012-04-05 21:26:44 +00:00
polly CodeGen: Remove unused declaration 2012-04-03 12:37:14 +00:00