summaryrefslogtreecommitdiff
path: root/lib/Linker/LinkArchives.cpp
Commit message (Collapse)AuthorAge
* Kill ModuleProvider and ghost linkage by inverting the relationship betweenJeffrey Yasskin2010-01-27
| | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94686 91177308-0d34-0410-b5e6-96231b3b80d8
* random tidyChris Lattner2009-11-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86511 91177308-0d34-0410-b5e6-96231b3b80d8
* Prune #includes from llvm/Linker.h and llvm/System/Path.h,Chris Lattner2009-08-23
| | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79869 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 the private linkage.Rafael Espindola2009-01-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62279 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix thinko: alias always defines new symbol. Even is aliasee itself is ↵Anton Korobeynikov2008-03-11
| | | | | | undefined. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48203 91177308-0d34-0410-b5e6-96231b3b80d8
* Properly populate lists of defined/undefined symbols in presence of aliasesAnton Korobeynikov2008-03-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47900 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45418 91177308-0d34-0410-b5e6-96231b3b80d8
* Report an error if one occurs in releaseModule.Reid Spencer2007-07-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40405 91177308-0d34-0410-b5e6-96231b3b80d8
* Here is the bulk of the sanitizing.Gabor Greif2007-07-05
| | | | | | | Almost all occurrences of "bytecode" in the sources have been eliminated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37913 91177308-0d34-0410-b5e6-96231b3b80d8
* switch this to bitcode instead of bytecodeChris Lattner2007-05-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36867 91177308-0d34-0410-b5e6-96231b3b80d8
* add bitcode supportChris Lattner2007-05-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36855 91177308-0d34-0410-b5e6-96231b3b80d8
* If an archive is not recognized as an LLVM bytecode archive then declareReid Spencer2007-04-30
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36584 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR411:Reid Spencer2007-02-05
| | | | | | | | | Adjust to changes in Module interface: getMainFunction() -> getFunction("main") getNamedFunction(X) -> getFunction(X) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33922 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1136: Rename GlobalVariable::isExternal as isDeclaration to avoidReid Spencer2007-01-30
| | | | | | | confusion with external linkage types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33663 91177308-0d34-0410-b5e6-96231b3b80d8
* Remvoe a do-nothing else block.Reid Spencer2006-11-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31687 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR998:Reid Spencer2006-11-11
| | | | | | | | | Fix an infinite loop in the Linker and a few other assorted link problems. Patch contributed by Scott Michel. Thanks, Scott! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31680 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR786:Reid Spencer2006-11-02
| | | | | | | | | | | Turn on -Wunused and -Wno-unused-parameter. Clean up most of the resulting fall out by removing unused variables. Remaining warnings have to do with unused functions (I didn't want to delete code without review) and unused variables in generated code. Maintainers should clean up the remaining issues when they see them. All changes pass DejaGnu tests and Olden. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31380 91177308-0d34-0410-b5e6-96231b3b80d8
* Adding dllimport, dllexport and external weak linkage types.Anton Korobeynikov2006-09-14
| | | | | | | | | | DLL* linkages got full (I hope) codegeneration support in C & both x86 assembler backends. External weak linkage added for future use, we don't provide any codegeneration, etc. support for it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30374 91177308-0d34-0410-b5e6-96231b3b80d8
* Finish removal of EH usage from the Archive library. The REQUIRES_EH flagReid Spencer2006-07-07
| | | | | | | | in lib/Bytecode/Archive/Makefile is now removed. One small step closer to a smaller LLVM. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29067 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove trailing whitespaceMisha Brukman2005-04-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21422 91177308-0d34-0410-b5e6-96231b3b80d8
* fix some 80 column violationsChris Lattner2005-03-15
| | | | | | | Add support for programs that define main in a .a file, such as f2c'd programs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20631 91177308-0d34-0410-b5e6-96231b3b80d8
* This mega patch converts us from using Function::a{iterator|begin|end} toChris Lattner2005-03-15
| | | | | | | | | using Function::arg_{iterator|begin|end}. Likewise Module::g* -> Module::global_*. This patch is contributed by Gabor Greif, thanks! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20597 91177308-0d34-0410-b5e6-96231b3b80d8
* Minor cleanup. No need to explicitly tell the compiler the template arguments.Chris Lattner2005-02-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20153 91177308-0d34-0410-b5e6-96231b3b80d8
* Print something useful for gccld -v with an archive.Chris Lattner2005-02-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20148 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove un-needed #includes.Reid Spencer2004-12-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19061 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR351: \Reid Spencer2004-12-13
| | | | | | | | | | * Convert functions to Linker:: methods. \ * Remove unneeded #includes \ * Utilize sys::Path utilities not FileSupport utilities \ * Move File & Library linking functions to other source files git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18855 91177308-0d34-0410-b5e6-96231b3b80d8
* PR466:Reid Spencer2004-12-02
| | | | | | | | | | | | | | | | | * Make the linker find lib*.bca files now instead of lib*.bc since those are what the makefiles now generate for bytecode archives. * Make sure the linker only links archives when LinkLibraries is called. Previously if it found a lib*.bc file and that file was a bytecode file, it would link in the entire bytecode. This could make -lc -lc fail with duplicate symbols error but it shouldn't as searching multiple libraries, even the same one more than once, is permitted. * Now that the above problems are corrected, implement the dependent libs feature. After the module is linked with all specified libraries, the LinkLibraries function will obtain the set of dependent libraries from the linked modules and attemp to find and link against those libraries. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18428 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert version 1.39. It breaks the ordering of the library processing.Reid Spencer2004-11-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18399 91177308-0d34-0410-b5e6-96231b3b80d8
* Shared library extension is now in LTDL_SHLIB_EXTReid Spencer2004-11-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18353 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement dependent library linking. It is no longer required that -lstdc++Reid Spencer2004-11-25
| | | | | | | | -lstdsup++ no -lc be passed on the command line to llvm linkers if the progam being linked was compiled with the C/C++ Front End or Stacker. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18243 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate unsightly ;;Reid Spencer2004-11-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17979 91177308-0d34-0410-b5e6-96231b3b80d8
* Reduce the amount of work in LinkInArchive by not searching the archive forReid Spencer2004-11-19
| | | | | | | symbols it has already identified as not defining. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17975 91177308-0d34-0410-b5e6-96231b3b80d8
* Per code review:\Reid Spencer2004-11-16
| | | | | | | | * Adjust indentation\ * Ensure memory do not leak if exceptions happen (std::auto_ptr use) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17885 91177308-0d34-0410-b5e6-96231b3b80d8
* use an autoptrChris Lattner2004-11-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17875 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove a forgotten debug output line.Reid Spencer2004-11-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17810 91177308-0d34-0410-b5e6-96231b3b80d8
* Linker.h has a new home.Reid Spencer2004-11-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17801 91177308-0d34-0410-b5e6-96231b3b80d8
* *Adjust prototypes for public interface. *Rewrite LinkInArchive to use ↵Reid Spencer2004-11-14
| | | | | | symbol tables. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17772 91177308-0d34-0410-b5e6-96231b3b80d8
* This file originated in tools/gccld/Linker.cpp but now lives inReid Spencer2004-11-12
| | | | | | | lib/Linker/LinkArchives.cpp git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17693 91177308-0d34-0410-b5e6-96231b3b80d8
* Output the program name (in this case, gccld) with warning about invalid filesMisha Brukman2004-11-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17638 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't silently ignore invalid files: tell the user!Misha Brukman2004-11-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17633 91177308-0d34-0410-b5e6-96231b3b80d8
* Changes For Bug 352Reid Spencer2004-09-01
| | | | | | | | | Move include/Config and include/Support into include/llvm/Config, include/llvm/ADT and include/llvm/Support. From here on out, all LLVM public header files must be under include/llvm/. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16137 91177308-0d34-0410-b5e6-96231b3b80d8
* Linker.h moved to include/llvm/SupportMisha Brukman2004-06-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14351 91177308-0d34-0410-b5e6-96231b3b80d8
* Move some functions out of gccld.cpp to GenerateCode.cpp. This allows usChris Lattner2004-06-02
| | | | | | | | to reduce the inter-file interface in the gccld tool and gets some uninteresting code out of gccld.cpp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13942 91177308-0d34-0410-b5e6-96231b3b80d8
* Header file movedChris Lattner2004-05-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13813 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use invalid HTML in a doxygen comment.Misha Brukman2004-04-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12962 91177308-0d34-0410-b5e6-96231b3b80d8
* Include Config/config.h for SHLIBEXT.Alkis Evlogimenos2004-02-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11779 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixes for PR214. Use the SHLIBEXT variable instead of hardcoding .so intoJohn Criswell2004-01-26
| | | | | | | every file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10976 91177308-0d34-0410-b5e6-96231b3b80d8
* Modified the logic so that library objects with main() are only linked inJohn Criswell2003-12-23
| | | | | | | if the program currently has main undefined. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10597 91177308-0d34-0410-b5e6-96231b3b80d8
* Modified the linker so that it always links in an object from an archiveJohn Criswell2003-12-23
| | | | | | | | | | | that defines the symbol "main." This is a hack that ensures that programs that place their main function in a library and then link it in (i.e. Apache 2.x) get their main function linked in. There is probably a more correct way to do this, but this works for now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10594 91177308-0d34-0410-b5e6-96231b3b80d8