Chris Lattner
f40ef5f964
when linking globals, make sure to preserve the address space of the global.
...
llvm-svn: 52810
2008-06-27 03:10:24 +00:00
Chris Lattner
9ab7735924
Fix an error handling redefinition of linkonce functions where the
...
types differ. Patch by Nathan Keynes!
llvm-svn: 52527
2008-06-20 05:29:39 +00:00
Chris Lattner
468adb09d7
Add a missing ~ (dtor became ctor) which caused crashes on a bunch of stuff.
...
llvm-svn: 52374
2008-06-16 23:06:51 +00:00
Chris Lattner
6782f56054
stop making PATypeHolder's so crazily.
...
llvm-svn: 52364
2008-06-16 21:17:12 +00:00
Chris Lattner
3dfc439a87
use a real associative container for type association instead of using
...
a vector with a linear search. This speeds up the linking testcase
in PR1860 from 0.965s to 0.385s on my system.
llvm-svn: 52357
2008-06-16 21:00:18 +00:00
Chris Lattner
f87729aa1f
bail out sooner if we have two concrete but different types.
...
llvm-svn: 52351
2008-06-16 20:03:01 +00:00
Chris Lattner
896c38c96a
simplify some code.
...
llvm-svn: 52350
2008-06-16 19:55:40 +00:00
Chris Lattner
fe3ddf06a8
Apply a patch from Nathan Keynes, which speeds up llvm-link on
...
the testcases in PR1860 from taking more than 1 hour (when I killed it)
to taking 1s.
llvm-svn: 52347
2008-06-16 19:48:08 +00:00
Chris Lattner
1a604edf16
handle vectors. Any integers that got here would necessarily be different already.
...
llvm-svn: 52341
2008-06-16 18:27:53 +00:00
Chris Lattner
c24aba4724
Simplify ResolveTypes by pulling the null case out into the one
...
client that cares and simplifying its control flow.
Remove the DestST argument to ResolveTypes and RecursiveResolveTypes*
which are dead now.
llvm-svn: 52340
2008-06-16 18:19:05 +00:00
Chris Lattner
cebf7d79b3
simplify RecursiveResolveTypes and ResolveTypes by pulling the naming out of
...
ResolveTypes into the one place that needs it.
llvm-svn: 52338
2008-06-16 18:11:40 +00:00
Chris Lattner
96dec66124
use 'continue' to make the function linker simpler. When linking a strong
...
function into a weak function, zap the weak function body so that the
strong one overrides it. This fixes PR2410
llvm-svn: 52135
2008-06-09 07:47:34 +00:00
Chris Lattner
4c99f72771
minor changes to short circuit the 'no linkage' case earlier for
...
function bodies. We now don't try to unify types or handling type
mismatches if when linking an internal foo to an external foo.
llvm-svn: 52134
2008-06-09 07:36:11 +00:00
Chris Lattner
744e896c06
simplify function visibility handling.
...
llvm-svn: 52133
2008-06-09 07:25:28 +00:00
Duncan Sands
fa995d7cc5
Factor code to copy global value attributes like
...
the section or the visibility from one global
value to another: copyAttributesFrom. This is
particularly useful for duplicating functions:
previously this was done by explicitly copying
each attribute in turn at each place where a
new function was created out of an old one, with
the result that obscure attributes were regularly
forgotten (like the collector or the section).
Hopefully now everything is uniform and nothing
is forgotten.
llvm-svn: 51567
2008-05-26 19:58:59 +00:00
Gabor Greif
48ffb6c7dc
Fix a bunch of 80col violations that arose from the Create API change. Tweak makefile targets to find these better.
...
llvm-svn: 51143
2008-05-15 10:04:30 +00:00
Dale Johannesen
768b6f281e
Add CommonLinkage; currently tentative definitions
...
are represented as "weak", but there are subtle differences
in some cases on Darwin, so we need both. The intent
is that "common" will behave identically to "weak" unless
somebody changes their target to do something else.
No functional change as yet.
llvm-svn: 51118
2008-05-14 20:12:51 +00:00
Anton Korobeynikov
0f39a96feb
Fix linking of internal aliases
...
llvm-svn: 50950
2008-05-10 14:41:43 +00:00
Anton Korobeynikov
ddb93e7a02
Turn StripPointerCast() into a method
...
llvm-svn: 50836
2008-05-07 22:54:15 +00:00
Anton Korobeynikov
ef80f5dbca
If weak GlobalVariable was bitcast'ed to different type during linking
...
we will need to strip all casts for intializer lookup.
llvm-svn: 50776
2008-05-06 22:52:54 +00:00
Owen Anderson
8aaa632351
Revert r49614. As Dan pointed out, some of these aren't correct.
...
llvm-svn: 49657
2008-04-14 17:38:21 +00:00
Owen Anderson
b54defaff0
Replace calls of the form V1->setName(V2->getName()) with V1->takeName(V2),
...
which is significantly more efficient.
llvm-svn: 49614
2008-04-13 19:15:17 +00:00
Gabor Greif
6c6b8a57f3
API changes for class Use size reduction, wave 1.
...
Specifically, introduction of XXX::Create methods
for Users that have a potentially variable number of
Uses.
llvm-svn: 49277
2008-04-06 20:25:17 +00:00
Chris Lattner
d141d16ed7
Change the MemoryBuffer::getFile* methods to take just a pointer to the
...
start of a filename, not a filename+length. All clients can produce a
null terminated name, and the system api's require null terminated
strings anyway.
llvm-svn: 49041
2008-04-01 18:04:03 +00:00
Anton Korobeynikov
a69bd8b0e6
Ultimately resolve aliases during linking, if possible
...
llvm-svn: 48259
2008-03-11 22:51:09 +00:00
Anton Korobeynikov
da7746cf43
Fix thinko: alias always defines new symbol. Even is aliasee itself is undefined.
...
llvm-svn: 48203
2008-03-11 00:24:53 +00:00
Anton Korobeynikov
6d98df2a25
Add sanity checks
...
llvm-svn: 48184
2008-03-10 22:36:53 +00:00
Anton Korobeynikov
ada9acedd4
Typo: 'function' => 'alias'
...
llvm-svn: 48183
2008-03-10 22:36:35 +00:00
Anton Korobeynikov
25b1121a28
Syntactic sugar'ify stuff :)
...
llvm-svn: 48182
2008-03-10 22:36:08 +00:00
Anton Korobeynikov
4a897017af
Always run 'make check' :) Fix fallout from prev. commit: query for possible
...
alias destination only if we don't have anything to link to
llvm-svn: 48181
2008-03-10 22:35:31 +00:00
Anton Korobeynikov
24360dead3
Make error messages to have common style
...
llvm-svn: 48180
2008-03-10 22:34:46 +00:00
Anton Korobeynikov
a17ceb586c
Properly link globals with aliases
...
llvm-svn: 48179
2008-03-10 22:34:28 +00:00
Anton Korobeynikov
d33dd5acd2
Remove the LinkGlobal weirderness in common linking phase.
...
llvm-svn: 48177
2008-03-10 22:33:53 +00:00
Anton Korobeynikov
7ce7d7173a
Typo
...
llvm-svn: 48176
2008-03-10 22:33:22 +00:00
Ted Kremenek
b05e945be4
Fix some compilation errors on msvc:
...
- "Redefinition of I" (iterator masks previous definition)
- include missing header file
Patch by Argiris Kirtzidis!
llvm-svn: 48115
2008-03-09 18:32:50 +00:00
Anton Korobeynikov
4ce7b6011b
Clarify some important bits
...
llvm-svn: 48010
2008-03-07 18:34:50 +00:00
Anton Korobeynikov
d33aa31d4c
Small cleanup: propagate thread-localness via generic routine.
...
No functionality change.
llvm-svn: 48009
2008-03-07 18:32:18 +00:00
Anton Korobeynikov
b66feb845f
Missed patch from my last commit
...
llvm-svn: 47977
2008-03-05 23:21:39 +00:00
Anton Korobeynikov
d4e00c2d59
Resolve aliases to aliasees, where possible
...
llvm-svn: 47975
2008-03-05 23:08:47 +00:00
Anton Korobeynikov
76b5b2d294
Handle functions as targets during linking of aliases as well
...
llvm-svn: 47974
2008-03-05 23:08:16 +00:00
Anton Korobeynikov
f2f352ec48
Try hard to link aliases. Checks can be too strict by now.
...
llvm-svn: 47968
2008-03-05 22:22:46 +00:00
Anton Korobeynikov
79f6795ebb
Remember the source->dest mapping when copying aliases. This fixes PR2054
...
llvm-svn: 47945
2008-03-05 15:27:21 +00:00
Anton Korobeynikov
0d90b4596b
Clarify the state-of-the-art
...
llvm-svn: 47944
2008-03-05 15:11:00 +00:00
Anton Korobeynikov
f9d4370f22
Properly populate lists of defined/undefined symbols in presence of aliases
...
llvm-svn: 47900
2008-03-04 20:16:11 +00:00
Lauro Ramos Venancio
8dc3548bdf
Emit an error when a library is not found. It is the GNU ld behavior and it is expected by the configure scripts.
...
llvm-svn: 47674
2008-02-27 17:20:32 +00:00
Anton Korobeynikov
b2dfae5fed
And final pack of warnings silencing
...
llvm-svn: 47372
2008-02-20 11:27:04 +00:00
Chris Lattner
699e5dbcee
random cleanups.
...
llvm-svn: 47334
2008-02-19 18:49:08 +00:00
Chris Lattner
ad9a6ccb83
Remove attribution from file headers, per discussion on llvmdev.
...
llvm-svn: 45418
2007-12-29 20:36:04 +00:00
Chris Lattner
8193d4af33
remove attribution from lib Makefiles.
...
llvm-svn: 45415
2007-12-29 20:09:26 +00:00
Anton Korobeynikov
f12327cd32
Ignore functions with internal linkages during linking. This snipped mimics the
...
behaviour of LinkGlobals() function.
llvm-svn: 45375
2007-12-27 23:21:57 +00:00