summaryrefslogtreecommitdiff
path: root/lib/Linker
Commit message (Collapse)AuthorAge
...
* Initial update to VMCore to use Twines for string arguments.Daniel Dunbar2009-07-25
| | | | | | | | - The only meat here is in Value.{h,cpp} the rest is essential 'const std::string &' -> 'const Twine &'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77048 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch ValueSymbolTable to StringRef based API.Daniel Dunbar2009-07-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76894 91177308-0d34-0410-b5e6-96231b3b80d8
* Get rid of the Pass+Context magic.Owen Anderson2009-07-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76702 91177308-0d34-0410-b5e6-96231b3b80d8
* Add plumbing for the `linker_private' linkage type. This type is meant forBill Wendling2009-07-20
| | | | | | | | | | "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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76385 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.Torok Edwin2009-07-14
| | | | | | | | | | 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"). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75640 91177308-0d34-0410-b5e6-96231b3b80d8
* assert(0) -> LLVM_UNREACHABLE.Torok Edwin2009-07-11
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75379 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch GlobalVariable ctors to a sane API, where *either* a context or a ↵Owen Anderson2009-07-08
| | | | | | module is required. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75025 91177308-0d34-0410-b5e6-96231b3b80d8
* Push LLVMContext through GlobalVariables and IRBuilder.Owen Anderson2009-07-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74985 91177308-0d34-0410-b5e6-96231b3b80d8
* LLVM Context-ification.Owen Anderson2009-07-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74948 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the use of const with respect to LLVMContext sane. Hopefully this is ↵Owen Anderson2009-07-01
| | | | | | | | | the last time, for the moment, that I will need to make far-reaching changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74655 91177308-0d34-0410-b5e6-96231b3b80d8
* Hold the LLVMContext by reference rather than by pointer.Owen Anderson2009-07-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74640 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a pointer to the owning LLVMContext to Module. This requires threading ↵Owen Anderson2009-07-01
| | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74614 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new "available_externally" linkage type. This is intendedChris Lattner2009-04-13
| | | | | | | | | to support C99 inline, GNU extern inline, etc. Related bugzilla's include PR3517, PR3100, & PR2933. Nothing uses this yet, but it appears to work. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68940 91177308-0d34-0410-b5e6-96231b3b80d8
* Apply ODR linkage changes accidentally dropped duringDuncan Sands2009-03-08
| | | | | | | final cleaning. This fixes a bunch of testsuite failures. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66380 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce new linkage types linkonce_odr, weak_odr, common_odrDuncan Sands2009-03-07
| | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66339 91177308-0d34-0410-b5e6-96231b3b80d8
* Oops.Mikhail Glushenkov2009-03-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65942 91177308-0d34-0410-b5e6-96231b3b80d8
* 80-column violation + trailing whitespace.Mikhail Glushenkov2009-03-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65936 91177308-0d34-0410-b5e6-96231b3b80d8
* Add the private linkage.Rafael Espindola2009-01-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62279 91177308-0d34-0410-b5e6-96231b3b80d8
* Removed trailing whitespace from Makefiles.Misha Brukman2009-01-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61991 91177308-0d34-0410-b5e6-96231b3b80d8
* Make comments and code for QuietWarnings and QuietErrorsDan Gohman2008-10-25
| | | | | | | actually correspond to what their names suggest. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58146 91177308-0d34-0410-b5e6-96231b3b80d8
* Also properly handle linking of strong alias and weak globalAnton Korobeynikov2008-10-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57595 91177308-0d34-0410-b5e6-96231b3b80d8
* Properly handle linking of strong alias with weak function, this fixes PR2883Anton Korobeynikov2008-10-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57594 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename isWeakForLinker to mayBeOverridden. Use itDuncan Sands2008-09-29
| | | | | | | | instead of hasWeakLinkage in a bunch of optimization passes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56782 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial support for the CMake build system.Oscar Fuentes2008-09-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56419 91177308-0d34-0410-b5e6-96231b3b80d8
* Make safer variant of alias resolution routine to be defaultAnton Korobeynikov2008-09-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56005 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix incorrect linker behaviour: we shouldn't resolve weak aliases.Anton Korobeynikov2008-09-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55997 91177308-0d34-0410-b5e6-96231b3b80d8
* Reimplement LinkFunctionProtos in terms of GetLinkageResult. This fixesChris Lattner2008-07-14
| | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53548 91177308-0d34-0410-b5e6-96231b3b80d8
* don't do any linkage, not even type resolution, of symbols that have Chris Lattner2008-07-14
| | | | | | | internal linkage. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53547 91177308-0d34-0410-b5e6-96231b3b80d8
* implement linking of globals to functions, in one directionChris Lattner2008-07-14
| | | | | | | | | | | | (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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53546 91177308-0d34-0410-b5e6-96231b3b80d8
* wrap long lines, remove some code from a non-assert build.Chris Lattner2008-07-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53545 91177308-0d34-0410-b5e6-96231b3b80d8
* The source and dest of an alias are *not* required to have the same type,Chris Lattner2008-07-10
| | | | | | | though that would be nice and make sense :). Patch by Nathan Keynes! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53387 91177308-0d34-0410-b5e6-96231b3b80d8
* Make DenseMap's insert return a pair, to more closely resemble std::map.Dan Gohman2008-07-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53177 91177308-0d34-0410-b5e6-96231b3b80d8
* Add convenient helper for checking whether global is weak in linker senseAnton Korobeynikov2008-07-05
| | | | | | having weak or linkonce or common or extweak LLVM linkage. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53158 91177308-0d34-0410-b5e6-96231b3b80d8
* Override weak stuff during linking of aliases. This fixes PR2463.Anton Korobeynikov2008-07-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53156 91177308-0d34-0410-b5e6-96231b3b80d8
* Properly link alias and function decls. This fixes PR2146Anton Korobeynikov2008-07-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53154 91177308-0d34-0410-b5e6-96231b3b80d8
* when linking globals, make sure to preserve the address space of the global.Chris Lattner2008-06-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52810 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an error handling redefinition of linkonce functions where theChris Lattner2008-06-20
| | | | | | | types differ. Patch by Nathan Keynes! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52527 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a missing ~ (dtor became ctor) which caused crashes on a bunch of stuff.Chris Lattner2008-06-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52374 91177308-0d34-0410-b5e6-96231b3b80d8
* stop making PATypeHolder's so crazily.Chris Lattner2008-06-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52364 91177308-0d34-0410-b5e6-96231b3b80d8
* use a real associative container for type association instead of usingChris Lattner2008-06-16
| | | | | | | | a vector with a linear search. This speeds up the linking testcase in PR1860 from 0.965s to 0.385s on my system. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52357 91177308-0d34-0410-b5e6-96231b3b80d8
* bail out sooner if we have two concrete but different types.Chris Lattner2008-06-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52351 91177308-0d34-0410-b5e6-96231b3b80d8
* simplify some code.Chris Lattner2008-06-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52350 91177308-0d34-0410-b5e6-96231b3b80d8
* Apply a patch from Nathan Keynes, which speeds up llvm-link onChris Lattner2008-06-16
| | | | | | | | the testcases in PR1860 from taking more than 1 hour (when I killed it) to taking 1s. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52347 91177308-0d34-0410-b5e6-96231b3b80d8
* handle vectors. Any integers that got here would necessarily be different ↵Chris Lattner2008-06-16
| | | | | | already. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52341 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify ResolveTypes by pulling the null case out into the one Chris Lattner2008-06-16
| | | | | | | | | | | client that cares and simplifying its control flow. Remove the DestST argument to ResolveTypes and RecursiveResolveTypes* which are dead now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52340 91177308-0d34-0410-b5e6-96231b3b80d8
* simplify RecursiveResolveTypes and ResolveTypes by pulling the naming out ofChris Lattner2008-06-16
| | | | | | | ResolveTypes into the one place that needs it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52338 91177308-0d34-0410-b5e6-96231b3b80d8
* use 'continue' to make the function linker simpler. When linking a strongChris Lattner2008-06-09
| | | | | | | | function into a weak function, zap the weak function body so that the strong one overrides it. This fixes PR2410 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52135 91177308-0d34-0410-b5e6-96231b3b80d8
* minor changes to short circuit the 'no linkage' case earlier forChris Lattner2008-06-09
| | | | | | | | function bodies. We now don't try to unify types or handling type mismatches if when linking an internal foo to an external foo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52134 91177308-0d34-0410-b5e6-96231b3b80d8
* simplify function visibility handling.Chris Lattner2008-06-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52133 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor code to copy global value attributes likeDuncan Sands2008-05-26
| | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51567 91177308-0d34-0410-b5e6-96231b3b80d8