1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
Commit Graph

342 Commits

Author SHA1 Message Date
Dan Gohman
859ffd353e Make NamedMDNode not be a subclass of Value, and simplify the interface
for creating and populating NamedMDNodes.

llvm-svn: 109061
2010-07-21 23:38:33 +00:00
Bill Wendling
59ef9bcc6d Revert r107205 and r107207.
llvm-svn: 107215
2010-06-29 22:34:52 +00:00
Bill Wendling
05a4c0b1f2 Introducing the "linker_weak" linkage type. This will be used for Objective-C
metadata types which should be marked as "weak", but which the linker will
remove upon final linkage. For example, the "objc_msgSend_fixup_alloc" symbol is
defined like this:

       .globl l_objc_msgSend_fixup_alloc
       .weak_definition l_objc_msgSend_fixup_alloc
       .section __DATA, __objc_msgrefs, coalesced
       .align 3
l_objc_msgSend_fixup_alloc:
        .quad   _objc_msgSend_fixup
        .quad   L_OBJC_METH_VAR_NAME_1

This is different from the "linker_private" linkage type, because it can't have
the metadata defined with ".weak_definition".

llvm-svn: 107205
2010-06-29 21:24:00 +00:00
Dan Gohman
9789093ab7 Add basic error checking to MemoryBuffer::getSTDIN.
llvm-svn: 104855
2010-05-27 17:31:51 +00:00
Dan Gohman
018b11555d Use the return value of getMagicNumber instead of using a
separate canRead() call.

llvm-svn: 104853
2010-05-27 17:18:38 +00:00
Duncan Sands
e9a13a3c60 Introduce isOpaqueTy and use it rather than isa<OpaqueType>. Also, move some
methods to try to have the type predicates be more logically positioned.

llvm-svn: 96349
2010-02-16 14:50:09 +00:00
Victor Hernandez
157da4b794 Linker should not remap null operands of metadata
llvm-svn: 95468
2010-02-06 01:31:55 +00:00
Victor Hernandez
8bef667691 Need to recurse for all operands of function-local metadata; and handle Instructions (which map to themselves)
llvm-svn: 94691
2010-01-27 22:03:03 +00:00
Jeffrey Yasskin
fb10587e50 Kill ModuleProvider and ghost linkage by inverting the relationship between
Modules and ModuleProviders. Because the "ModuleProvider" simply materializes
GlobalValues now, and doesn't provide modules, it's renamed to
"GVMaterializer". Code that used to need a ModuleProvider to materialize
Functions can now materialize the Functions directly. Functions no longer use a
magic linkage to record that they're materializable; they simply ask the
GVMaterializer.

Because the C ABI must never change, we can't remove LLVMModuleProviderRef or
the functions that refer to it. Instead, because Module now exposes the same
functionality ModuleProvider used to, we store a Module* in any
LLVMModuleProviderRef and translate in the wrapper methods.  The bindings to
other languages still use the ModuleProvider concept.  It would probably be
worth some time to update them to follow the C++ more closely, but I don't
intend to do it.

Fixes http://llvm.org/PR5737 and http://llvm.org/PR5735.

llvm-svn: 94686
2010-01-27 20:34:15 +00:00
Chris Lattner
3b984e1b99 merge two ifs
llvm-svn: 94650
2010-01-27 02:18:21 +00:00
Victor Hernandez
db86c7d1a0 Linker needs to do deep-copy of function-local metadata to update references to function arguments
llvm-svn: 94632
2010-01-27 00:30:42 +00:00
Chris Lattner
5a57121631 make -fno-rtti the default unless a directory builds with REQUIRES_RTTI.
llvm-svn: 94378
2010-01-24 20:43:08 +00:00
Devang Patel
81f0fa06d7 Remove MetadataBase class because it is not adding significant value.
llvm-svn: 94243
2010-01-22 22:52:10 +00:00
Chris Lattner
276811b58a Stop building RTTI information for *most* llvm libraries. Notable
missing ones are libsupport, libsystem and libvmcore.  libvmcore is
currently blocked on bugpoint, which uses EH.  Once it stops using
EH, we can switch it off.

This #if 0's out 3 unit tests, because gtest requires RTTI information.
Suggestions welcome on how to fix this.

llvm-svn: 94164
2010-01-22 06:49:46 +00:00
David Chisnall
edfb3fc27c Fixed linking of modules containing aliases to constant bitcasts. Existing behaviour first tried to replace the aliases with the global that they aliased (rather than the bitcast), causing a crash on an assert because the types didn't match. When this was fixed, it then did the same thing creating the new alias (creating an alias with a different type to its aliasee).
Linking modules containing aliases to GEPs is still not quite right.  GEPs that are equivalent to bitcasts will be replaced by bitcasts, GEPs that are not will just break.  Aliases to GEPs that are not equivalent to bitcasts are horribly broken anyway (it might be worth adding an assert when creating the alias to prevent these being created; they just cause problems later).

llvm-svn: 93052
2010-01-09 16:27:31 +00:00
David Greene
2f13cc8277 Change this back to errs().
llvm-svn: 92674
2010-01-05 01:55:22 +00:00
David Greene
fa8721709e Change errs() to dbgs().
llvm-svn: 92628
2010-01-05 01:27:59 +00:00
David Greene
771bfcd4c5 Change errs() to dbgs().
llvm-svn: 92626
2010-01-05 01:27:53 +00:00
Chris Lattner
c12382b7c8 rename "elements" of metadata to "operands". "Elements" are
things that occur in types.  "operands" are things that occur
in values.

llvm-svn: 92322
2009-12-31 01:22:29 +00:00
Bill Wendling
3f3f9a1bc8 Remove dead store.
llvm-svn: 92192
2009-12-28 01:54:15 +00:00
Daniel Dunbar
886e51b5c1 Fix MemoryBuffer::getSTDIN to *not* return null if stdin is empty, this is a lame API.
Also, Stringrefify some more MemoryBuffer functions, and add two performance FIXMEs.

llvm-svn: 86630
2009-11-10 00:43:58 +00:00
Chris Lattner
6c38ec917d random tidy
llvm-svn: 86511
2009-11-09 04:18:23 +00:00
Chris Lattner
c7f4a1df29 remove a redundant printout, LinkInArchive prints this as well.
llvm-svn: 86510
2009-11-09 04:15:28 +00:00
Daniel Dunbar
4daaf9d3f4 Pass StringRef by value.
llvm-svn: 86251
2009-11-06 10:58:06 +00:00
Chris Lattner
e3b5cc7fe6 implement linker support for BlockAddress.
llvm-svn: 85700
2009-11-01 02:46:39 +00:00
Dan Gohman
d7a57a70f3 Remove unnecessary #include.
llvm-svn: 81636
2009-09-12 22:24:25 +00:00
Devang Patel
8e274bafa9 There is not any need to copy metadata while merging modules.
llvm-svn: 80941
2009-09-03 20:35:57 +00:00
Chris Lattner
3203639c35 Prune #includes from llvm/Linker.h and llvm/System/Path.h,
forcing them down into various .cpp files.

This change also:
1. Renames TimeValue::toString() and Path::toString() to ::str()
   for similarity with the STL.
2. Removes all stream insertion support for sys::Path, forcing
   clients to call .str().
3. Removes a use of Config/alloca.h from bugpoint, using smallvector
   instead.
4. Weans llvm-db off <iostream>

sys::Path really needs to be gutted, but I don't have the desire to
do it at this point.

llvm-svn: 79869
2009-08-23 22:45:37 +00:00
Chris Lattner
01dae858b6 eliminate the "Value" printing methods that print to a std::ostream.
This required converting a bunch of stuff off DOUT and other cleanups.

llvm-svn: 79819
2009-08-23 04:37:46 +00:00
Devang Patel
df6d338da2 Link NamedMDNodes.
llvm-svn: 78696
2009-08-11 18:01:24 +00:00
Devang Patel
c8a9584200 Link metadata.
llvm-svn: 78652
2009-08-11 06:46:31 +00:00
Owen Anderson
1dc40e205b Move a few more APIs back to 2.5 forms. The only remaining ones left to change back are
metadata related, which I'm waiting on to avoid conflicting with Devang.

llvm-svn: 77721
2009-07-31 20:28:14 +00:00
Owen Anderson
881d928f9b Move types back to the 2.5 API.
llvm-svn: 77516
2009-07-29 22:17:13 +00:00
Benjamin Kramer
da986c3fc9 Remove now unused Context variables.
llvm-svn: 77495
2009-07-29 19:14:17 +00:00
Owen Anderson
0ce2151b36 Move ConstantExpr to 2.5 API.
llvm-svn: 77494
2009-07-29 18:55:55 +00:00
Owen Anderson
390e9778d4 Return ConstantVector to 2.5 API.
llvm-svn: 77366
2009-07-28 21:19:26 +00:00
Owen Anderson
aa8c94b051 Change ConstantArray to 2.5 API.
llvm-svn: 77347
2009-07-28 18:32:17 +00:00
Owen Anderson
d729f993b8 Move ConstantStruct back to 2.5 API.
llvm-svn: 77266
2009-07-27 22:29:26 +00:00
Daniel Dunbar
038a7f0d35 Remove Value::{isName, getNameRef}.
Also, change MDString to use a StringRef.

llvm-svn: 77098
2009-07-25 23:55:21 +00:00
Daniel Dunbar
9f50ab3c49 Finish migrating VMCore to StringRef/Twine based APIs.
llvm-svn: 77051
2009-07-25 06:02:13 +00:00
Daniel Dunbar
251177c96e Initial update to VMCore to use Twines for string arguments.
- The only meat here is in Value.{h,cpp} the rest is essential 'const
   std::string &' -> 'const Twine &'.

llvm-svn: 77048
2009-07-25 04:41:11 +00:00
Daniel Dunbar
4499c47ea4 Switch ValueSymbolTable to StringRef based API.
llvm-svn: 76894
2009-07-23 18:52:12 +00:00
Owen Anderson
cc287b28c9 Get rid of the Pass+Context magic.
llvm-svn: 76702
2009-07-22 00:24:57 +00:00
Bill Wendling
1a10a060cb Add plumbing for the `linker_private' linkage type. This type is meant for
"private" symbols which the assember shouldn't strip, but which the linker may
remove after evaluation. This is mostly useful for Objective-C metadata.

This is plumbing, so we don't have a use of it yet. More to come, etc.

llvm-svn: 76385
2009-07-20 01:03:30 +00:00
Torok Edwin
f955a6ef49 llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.
This adds location info for all llvm_unreachable calls (which is a macro now) in
!NDEBUG builds.
In NDEBUG builds location info and the message is off (it only prints
"UREACHABLE executed").

llvm-svn: 75640
2009-07-14 16:55:14 +00:00
Torok Edwin
ae8a3ff177 assert(0) -> LLVM_UNREACHABLE.
Make llvm_unreachable take an optional string, thus moving the cerr<< out of
line.
LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for
NDEBUG builds.

llvm-svn: 75379
2009-07-11 20:10:48 +00:00
Owen Anderson
332aae685b Switch GlobalVariable ctors to a sane API, where *either* a context or a module is required.
llvm-svn: 75025
2009-07-08 19:03:57 +00:00
Owen Anderson
7a1f69e433 Push LLVMContext through GlobalVariables and IRBuilder.
llvm-svn: 74985
2009-07-08 01:26:06 +00:00
Owen Anderson
64d037fba9 LLVM Context-ification.
llvm-svn: 74948
2009-07-07 21:07:14 +00:00
Owen Anderson
4fa7e54329 Make the use of const with respect to LLVMContext sane. Hopefully this is the last time, for the
moment, that I will need to make far-reaching changes.

llvm-svn: 74655
2009-07-01 23:13:44 +00:00
Owen Anderson
cf112e59c3 Hold the LLVMContext by reference rather than by pointer.
llvm-svn: 74640
2009-07-01 21:22:36 +00:00
Owen Anderson
81b8dabb53 Add a pointer to the owning LLVMContext to Module. This requires threading LLVMContext through a lot
of the bitcode reader and ASM parser APIs, as well as supporting it in all of the tools.

Patches for Clang and LLVM-GCC to follow.

llvm-svn: 74614
2009-07-01 16:58:40 +00:00
Chris Lattner
c1bfdc9bb2 Add a new "available_externally" linkage type. This is intended
to support C99 inline, GNU extern inline, etc.  Related bugzilla's
include PR3517, PR3100, & PR2933.  Nothing uses this yet, but it
appears to work.

llvm-svn: 68940
2009-04-13 05:44:34 +00:00
Duncan Sands
26ab759672 Apply ODR linkage changes accidentally dropped during
final cleaning.  This fixes a bunch of testsuite failures.

llvm-svn: 66380
2009-03-08 13:35:23 +00:00
Duncan Sands
5ab54d488f Introduce new linkage types linkonce_odr, weak_odr, common_odr
and extern_weak_odr.  These are the same as the non-odr versions,
except that they indicate that the global will only be overridden
by an *equivalent* global.  In C, a function with weak linkage can
be overridden by a function which behaves completely differently.
This means that IP passes have to skip weak functions, since any
deductions made from the function definition might be wrong, since
the definition could be replaced by something completely different
at link time.   This is not allowed in C++, thanks to the ODR
(One-Definition-Rule): if a function is replaced by another at
link-time, then the new function must be the same as the original
function.  If a language knows that a function or other global can
only be overridden by an equivalent global, it can give it the
weak_odr linkage type, and the optimizers will understand that it
is alright to make deductions based on the function body.  The
code generators on the other hand map weak and weak_odr linkage
to the same thing.

llvm-svn: 66339
2009-03-07 15:45:40 +00:00
Mikhail Glushenkov
a4a724f737 Oops.
llvm-svn: 65942
2009-03-03 10:04:23 +00:00
Mikhail Glushenkov
1d23d4e16b 80-column violation + trailing whitespace.
llvm-svn: 65936
2009-03-03 07:22:23 +00:00
Rafael Espindola
0aba6c9435 Add the private linkage.
llvm-svn: 62279
2009-01-15 20:18:42 +00:00
Misha Brukman
71c7e40966 Removed trailing whitespace from Makefiles.
llvm-svn: 61991
2009-01-09 16:44:42 +00:00
Dan Gohman
64431fe1db Make comments and code for QuietWarnings and QuietErrors
actually correspond to what their names suggest.

llvm-svn: 58146
2008-10-25 17:57:20 +00:00
Anton Korobeynikov
e322e95ecd Also properly handle linking of strong alias and weak global
llvm-svn: 57595
2008-10-15 20:10:50 +00:00
Anton Korobeynikov
d514695f79 Properly handle linking of strong alias with weak function, this fixes PR2883
llvm-svn: 57594
2008-10-15 20:10:08 +00:00
Duncan Sands
651eeb4be2 Rename isWeakForLinker to mayBeOverridden. Use it
instead of hasWeakLinkage in a bunch of optimization
passes.

llvm-svn: 56782
2008-09-29 11:25:42 +00:00
Oscar Fuentes
0f25988689 Initial support for the CMake build system.
llvm-svn: 56419
2008-09-22 01:08:49 +00:00
Anton Korobeynikov
6ad8b060d0 Make safer variant of alias resolution routine to be default
llvm-svn: 56005
2008-09-09 20:05:04 +00:00
Anton Korobeynikov
3a24741034 Fix incorrect linker behaviour: we shouldn't resolve weak aliases.
llvm-svn: 55997
2008-09-09 18:23:48 +00:00
Chris Lattner
ef7178406b Reimplement LinkFunctionProtos in terms of GetLinkageResult. This fixes
the second half of link-global-to-func.ll and causes some minor changes in
messages.

There are two TODOs here.  First, this causes a regression in 
2008-07-06-AliasWeakDest.ll, which is now failing (so I xfailed it).  Anton,
I would really appreciate it if you could take a look at this.  It should be
a matter of adding proper alias support to GetLinkageResult, and was probably
already a latent bug that would manifest with globals.

The second todo is to reimplement LinkAlias in the same pattern as 
function and global linking.  This should be pretty straight-forward for 
someone who knows aliases, but isn't a requirement for correctness.

llvm-svn: 53548
2008-07-14 07:23:24 +00:00
Chris Lattner
0b95d5f57d don't do any linkage, not even type resolution, of symbols that have
internal linkage.

llvm-svn: 53547
2008-07-14 06:52:19 +00:00
Chris Lattner
d31cacb5d6 implement linking of globals to functions, in one direction
(replacing a function with a global).  This is needed when building
llvm itself with LTO on darwin, because of the EXPLICIT_SYMBOL hack
in lib/system/DynamicLibrary.cpp.

Implementation of linking the other way will need to wait for a 
cleanup of LinkFunctionProtos.

llvm-svn: 53546
2008-07-14 06:49:45 +00:00
Chris Lattner
c68c953e71 wrap long lines, remove some code from a non-assert build.
llvm-svn: 53545
2008-07-14 05:52:33 +00:00
Chris Lattner
6d7c5fa8dc The source and dest of an alias are *not* required to have the same type,
though that would be nice and make sense :).  Patch by Nathan Keynes!

llvm-svn: 53387
2008-07-10 01:09:33 +00:00
Dan Gohman
c97817aac3 Make DenseMap's insert return a pair, to more closely resemble std::map.
llvm-svn: 53177
2008-07-07 17:46:23 +00:00
Anton Korobeynikov
47e1a76977 Add convenient helper for checking whether global is weak in linker sense
having weak or linkonce or common or extweak LLVM linkage.

llvm-svn: 53158
2008-07-05 23:48:30 +00:00
Anton Korobeynikov
302db24cf1 Override weak stuff during linking of aliases. This fixes PR2463.
llvm-svn: 53156
2008-07-05 23:33:22 +00:00
Anton Korobeynikov
3593f9f7f1 Properly link alias and function decls. This fixes PR2146
llvm-svn: 53154
2008-07-05 23:03:21 +00:00
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
Gordon Henriksen
90d48b077d Fixing several transforms which would drop the collector attribute
when copying functions.

llvm-svn: 45356
2007-12-25 22:16:06 +00:00
Duncan Sands
3602011bec Fix PR1146: parameter attributes are longer part of
the function type, instead they belong to functions
and function calls.  This is an updated and slightly
corrected version of Reid Spencer's original patch.
The only known problem is that auto-upgrading of
bitcode files doesn't seem to work properly (see
test/Bitcode/AutoUpgradeIntrinsics.ll).  Hopefully
a bitcode guru (who might that be? :) ) will fix it.

llvm-svn: 44359
2007-11-27 13:23:08 +00:00
Dan Gohman
d5c936914c Use correct parentheses with the '&& "..."' idiom in an assert.
llvm-svn: 42750
2007-10-08 15:13:30 +00:00
Chris Lattner
2de224be98 Fix PR1611 - Visibility should be ignored for a declaration
when a definition's visibility is different.  Likewise, the
visibility of two declarations mismatching is not an error.

llvm-svn: 41174
2007-08-19 22:22:54 +00:00
Reid Spencer
056b656f99 Improve error handling in the linker by:
1. Eliminate redundant error messages. LinkInFile and LinkInArchive
   already call the error() method in each case so there's no use
   telling the user again that an item couldn't be linked in.

2. Improve the formatting of error messages (separating content).

3. Change the wording for the warning about unrecognized files. Make
   it clear that the file is being ignored.

llvm-svn: 41121
2007-08-16 07:47:30 +00:00
Reid Spencer
3860c113ab Ensure that error messages a propagated from calls to LinkInModule so they get
reported to the end user.

llvm-svn: 41117
2007-08-16 07:23:37 +00:00
Reid Spencer
c5f311aa70 Allow the filename "-" to be a place holder for stdin. This allows directing
stdin through llvm-ld and llvm-link.

llvm-svn: 40938
2007-08-08 19:52:29 +00:00
Reid Spencer
dd93d5abaa Report an error if one occurs in releaseModule.
llvm-svn: 40405
2007-07-22 21:39:37 +00:00
Gabor Greif
f5e225a756 eliminate residual cruft related to recognizing bytecode
files.
bitcode files are the only LLVM format left.

llvm-svn: 37945
2007-07-06 13:38:17 +00:00
Gabor Greif
5f705671e4 Here is the bulk of the sanitizing.
Almost all occurrences of "bytecode" in the sources have been eliminated.

llvm-svn: 37913
2007-07-05 17:07:56 +00:00
Lauro Ramos Venancio
04172124dd Fix a bug in my previous patch.
llvm-svn: 37778
2007-06-28 20:06:38 +00:00
Lauro Ramos Venancio
eb29d717b3 When linking two modules, we should copy the alias.
llvm-svn: 37776
2007-06-28 19:02:54 +00:00
Lauro Ramos Venancio
9907d0f8db Propagate alignment, section name and visibility when linking "appending
global values".
Fix noinline linkage.

llvm-svn: 37482
2007-06-06 22:01:12 +00:00
Chris Lattner
c684dbdb6b switch this to bitcode instead of bytecode
llvm-svn: 36867
2007-05-06 09:29:13 +00:00
Chris Lattner
c0fa93d591 add bitcode support
llvm-svn: 36855
2007-05-06 06:02:13 +00:00
Reid Spencer
db43279e9a If an archive is not recognized as an LLVM bytecode archive then declare
that it is native so that the linker will pass it on downstream. This avoids
a problem where the native link line fails because there is both a .so and
a .a file. The .a file gets processed as bytecode and then dropped from the
command line.

llvm-svn: 36584
2007-04-30 00:29:39 +00:00
Reid Spencer
d27ed404ea Dependent libraries could be native too.
llvm-svn: 36582
2007-04-30 00:00:10 +00:00
Anton Korobeynikov
081d3bdd9f Implement visibility checking during linking. Also implement protected
visibility support for bitcode.

llvm-svn: 36577
2007-04-29 20:56:48 +00:00
Lauro Ramos Venancio
a76c2806de Implement the "thread_local" keyword.
llvm-svn: 35950
2007-04-12 18:32:50 +00:00
Reid Spencer
2792e203c5 For PR1146:
Put the parameter attributes in their own ParamAttr name space. Adjust the
rest of llvm as a result.

llvm-svn: 35877
2007-04-11 02:44:20 +00:00
Reid Spencer
d8c3813f51 For PR1302:
Use local variable names that match the function parameter name that it
is passed to so the code is more clear, to wit: is_bytecode -> is_native

llvm-svn: 35656
2007-04-04 06:44:18 +00:00
Reid Spencer
87ede33a19 For PR1302:
Implement file tests for both LinkInLibrary and LinkInFile to determine if
the file is native. Don't generate warnings if the file is native.

llvm-svn: 35653
2007-04-04 06:33:17 +00:00
Reid Spencer
55e4e98a2a For PR1195:
Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and
PackedTyID -> VectorTyID. No functional changes.

llvm-svn: 34293
2007-02-15 02:26:10 +00:00
Chris Lattner
8aafcbb579 simplify this code by using value::takename
llvm-svn: 34172
2007-02-11 00:39:38 +00:00
Chris Lattner
43d0b955a3 push bytecode decompressor out through APIs. Now the bytecode reader
api's look like this:

ModuleProvider *getBytecodeModuleProvider(
  const std::string &Filename,  ///< Name of file to be read
  BCDecompressor_t *BCDC = Compressor::decompressToNewBuffer,
  std::string* ErrMsg = 0,      ///< Optional error message holder
  BytecodeHandler* H = 0        ///< Optional handler for reader events
);

This is ugly, but allows a client to say:

  getBytecodeModuleProvider("foo", 0);

If they do this, there is no dependency on the compression libraries, saving
codesize.

llvm-svn: 34012
2007-02-07 21:41:02 +00:00