summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Linker
Commit message (Collapse)AuthorAgeFilesLines
...
* Last batch of cleanups to Linker.h.Rafael Espindola2013-05-041-0/+4
| | | | | | | | Update comments, fix * placement, fix method names that are not used in clang, add a linkInModule that takes a Mode and put it in Linker.cpp. llvm-svn: 181099
* Don't construct or delete a module on the Linker.Rafael Espindola2013-05-041-5/+0
| | | | | | | The linker is now responsible only for actually linking the modules, it is up to the clients to create and destroy them. llvm-svn: 181098
* Don't store the context in the Linker.Rafael Espindola2013-05-041-2/+0
| | | | llvm-svn: 181097
* Remove unused members and constructor arguments.Rafael Espindola2013-05-041-11/+5
| | | | llvm-svn: 181096
* Delete dead code from the linker.Rafael Espindola2013-05-041-31/+0
| | | | llvm-svn: 181094
* This patch breaks up Wrap.h so that it does not have to include all of Filip Pizlo2013-05-011-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | the things, and renames it to CBindingWrapping.h. I also moved CBindingWrapping.h into Support/. This new file just contains the macros for defining different wrap/unwrap methods. The calls to those macros, as well as any custom wrap/unwrap definitions (like for array of Values for example), are put into corresponding C++ headers. Doing this required some #include surgery, since some .cpp files relied on the fact that including Wrap.h implicitly caused the inclusion of a bunch of other things. This also now means that the C++ headers will include their corresponding C API headers; for example Value.h must include llvm-c/Core.h. I think this is harmless, since the C API headers contain just external function declarations and some C types, so I don't believe there should be any nasty dependency issues here. llvm-svn: 180881
* Move C++ code out of the C headers and into either C++ headersEric Christopher2013-04-221-0/+1
| | | | | | | or the C++ files themselves. This enables people to use just a C compiler to interoperate with LLVM. llvm-svn: 180063
* Specutively revert r178130.Bill Wendling2013-03-271-44/+29
| | | | | | | | | | | | | | | | | | | This may be causing a failure on some buildbots: Referencing function in another module! tail call fastcc void @_ZL11EvaluateOpstPtRj(i16 zeroext %17, i16* %Vals, i32* %NumVals), !dbg !219 Referencing function in another module! tail call fastcc void @_ZL11EvaluateOpstPtRj(i16 zeroext %19, i16* %Vals, i32* %NumVals), !dbg !221 Broken module found, compilation aborted! Stack dump: 0. Running pass 'Function Pass Manager' on module 'ld-temp.o'. 1. Running pass 'Module Verifier' on function '@_ZL11EvaluateOpstPtRj' clang: error: unable to execute command: Illegal instruction: 4 clang: error: linker command failed due to signal (use -v to see invocation) <rdar://problem/13516485> llvm-svn: 178156
* Improve performance of LinkModules when linking with modules with large ↵James Molloy2013-03-271-29/+44
| | | | | | numbers of functions which link lazily. Instead of creating and destroying function prototypes irrespective of if they are used, only create them if they are used. llvm-svn: 178130
* The Linker interface has some dead code after the cleanup in r172749Eli Bendersky2013-03-192-22/+1
| | | | | | | (and possibly others). The attached patch removes it, and tries to update comments accordingly. llvm-svn: 177406
* Clean up out-of-date comments and some stray whitespaceEli Bendersky2013-03-081-1/+1
| | | | llvm-svn: 176729
* Add static cast to unsigned char whenever a character classification ↵Guy Benyei2013-02-121-1/+2
| | | | | | function is called with a signed char argument, in order to avoid assertions in Windows Debug configuration. llvm-svn: 175006
* [Linker] Kill Linker::LoadObject which is dead, and drop the BitReader ↵Daniel Dunbar2013-01-182-24/+1
| | | | | | dependency again. llvm-svn: 172838
* The IR linker still depends on the bitcode reader.Benjamin Kramer2013-01-181-1/+1
| | | | llvm-svn: 172824
* [Linker] Drop some now-dead component dependencies.Daniel Dunbar2013-01-171-1/+1
| | | | llvm-svn: 172759
* [Linker] Drop support for IR-level extended linking support (archives, etc.).Daniel Dunbar2013-01-174-482/+0
| | | | | | | | - This code is dead, and the "right" way to get this support is to use the platform-specific linker-integrated LTO mechanisms, or the forthcoming LLVM linker. llvm-svn: 172749
* [IR] Add 'Append' and 'AppendUnique' module flag behaviors.Daniel Dunbar2013-01-161-0/+28
| | | | llvm-svn: 172659
* [Linker] Change module flag linking to be more extensible.Daniel Dunbar2013-01-161-133/+97
| | | | | | | | | | - Instead of computing a bunch of buckets of different flag types, just do an incremental link resolving conflicts as they arise. - This also has the advantage of making the link result deterministic and not dependent on map iteration order. llvm-svn: 172634
* [Linker] Drop asserts that are embedded in cast<> and now checked by the ↵Daniel Dunbar2013-01-151-11/+0
| | | | | | verifier. llvm-svn: 172550
* Fix a copy/paste error in the IR Linker, casting an ArrayType instead of a ↵Joey Gouly2013-01-101-1/+1
| | | | | | VectorType. llvm-svn: 172054
* Move TypeFinder.h into the IR tree, it clearly belongs with the IR library.Chandler Carruth2013-01-071-1/+1
| | | | llvm-svn: 171749
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-024-7/+7
| | | | | | | | | | | | | | | | | | | | | into their new header subdirectory: include/llvm/IR. This matches the directory structure of lib, and begins to correct a long standing point of file layout clutter in LLVM. There are still more header files to move here, but I wanted to handle them in separate commits to make tracking what files make sense at each layer easier. The only really questionable files here are the target intrinsic tablegen files. But that's a battle I'd rather not fight today. I've updated both CMake and Makefile build systems (I think, and my tests think, but I may have missed something). I've also re-sorted the includes throughout the project. I'll be committing updates to Clang, DragonEgg, and Polly momentarily. llvm-svn: 171366
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-034-11/+11
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
* Remove the dependent libraries feature.Bill Wendling2012-11-272-38/+0
| | | | | | The dependent libraries feature was never used and has bit-rotted. Remove it. llvm-svn: 168694
* Move the "findUsedStructTypes" functionality outside of the Module class.Bill Wendling2012-08-031-4/+5
| | | | | | | | | The "findUsedStructTypes" method is very expensive to run. It needs to be optimized so that LTO can run faster. Splitting this method out of the Module class will help this occur. For instance, it can keep a list of seen objects so that it doesn't process them over and over again. llvm-svn: 161228
* Extend the IL for selecting TLS models (PR9788)Hans Wennborg2012-06-231-2/+2
| | | | | | | | | | | | | | | This allows the user/front-end to specify a model that is better than what LLVM would choose by default. For example, a variable might be declared as @x = thread_local(initialexec) global i32 42 if it will not be used in a shared library that is dlopen'ed. If the specified model isn't supported by the target, or if LLVM can make a better choice, a different model may be used. llvm-svn: 159077
* Supply a C interface to the "LinkModules" method.Bill Wendling2012-05-091-0/+15
| | | | | | Patch by Andrew Wilkins! llvm-svn: 156469
* Add a flag to the struct type finder to collect only those types which haveBill Wendling2012-04-211-2/+2
| | | | | | names. This saves collecting types we normally don't care about. llvm-svn: 155300
* It's possible for two types, which are isomorphic, to be added to theBill Wendling2012-03-231-6/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | destination module, but one of them isn't used in the destination module. If another module comes along and the uses the unused type, there could be type conflicts when the modules are finally linked together. (This happened when building LLVM.) The test that was reduced is: Module A: %Z = type { %A } %A = type { %B.1, [7 x x86_fp80] } %B.1 = type { %C } %C = type { i8* } declare void @func_x(%C*, i64, i64) declare void @func_z(%Z* nocapture) Module B: %B = type { %C.1 } %C.1 = type { i8* } %A.2 = type { %B.3, [5 x x86_fp80] } %B.3 = type { %C.1 } define void @func_z() { %x = alloca %A.2, align 16 %y = getelementptr inbounds %A.2* %x, i64 0, i32 0, i32 0 call void @func_x(%C.1* %y, i64 37, i64 927) nounwind ret void } declare void @func_x(%C.1*, i64, i64) declare void @func_y(%B* nocapture) (Unfortunately, this test doesn't fail under llvm-link, only during an LTO linking.) The '%C' and '%C.1' clash. The destination module gets the '%C' declaration. When merging Module B, it looks at the '%C.1' subtype of the '%B' structure. It adds that in, because that's cool. And when '%B.3' is processed, it uses the '%C.1'. But the '%B' has used '%C' and we prefer to use '%C'. So the '@func_x' type is changed to 'void (%C*, i64, i64)', but the type of '%x' in '@func_z' remains '%A.2'. The GEP resolves to a '%C.1', which conflicts with the '@func_x' signature. We can resolve this situation by making sure that the type is used in the destination before saying that it should be used in the module being merged in. With this fix, LLVM and Clang both compile under LTO. <rdar://problem/10913281> llvm-svn: 153351
* Ignore the last message.Bill Wendling2012-03-231-1/+3
| | | | llvm-svn: 153315
* Revert patch. It broke the build.Bill Wendling2012-03-231-3/+1
| | | | llvm-svn: 153314
* Dematerialize the source functions after we're done with them. This saves a bitBill Wendling2012-03-231-1/+3
| | | | | | of memory during LTO. llvm-svn: 153313
* Some whitespace and comment cleanup.Bill Wendling2012-03-221-5/+0
| | | | llvm-svn: 153278
* Remove unneeded #ifdefs.Bill Wendling2012-03-221-3/+1
| | | | llvm-svn: 153277
* Add a 'dump' method to the type map. Doxygenify some of the comments and add aBill Wendling2012-03-221-23/+36
| | | | | | | | few comments where none existed before. Also change a function's name to match the current coding standard. No functionality change. llvm-svn: 153276
* Include cctype for isdigit. Patch by Stephen Hines.Duncan Sands2012-03-031-0/+1
| | | | llvm-svn: 151973
* Oops...Don't commit the other stuff..Bill Wendling2012-02-281-44/+29
| | | | llvm-svn: 151618
* Modify comment to reflect the importance of this code.Bill Wendling2012-02-281-29/+44
| | | | llvm-svn: 151617
* Add back removed code. It still causes LLVM to miscompile. But not having it ↵Bill Wendling2012-02-271-0/+30
| | | | | | breaks other things. llvm-svn: 151594
* Don't use #if 0. Just remove until I can address this.Bill Wendling2012-02-271-35/+0
| | | | llvm-svn: 151580
* The code that cleans up multiple, isomorphic types has a subtle error thatBill Wendling2012-02-271-3/+7
| | | | | | | manifests itself when building LLVM with LTO. <rdar://problem/10913281> llvm-svn: 151576
* Capitalize messages so that they appear nicely with the linker's error messages.Bill Wendling2012-02-141-9/+9
| | | | llvm-svn: 150466
* [WIP] Initial code for module flags.Bill Wendling2012-02-111-5/+186
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Module flags are key-value pairs associated with the module. They include a 'behavior' value, indicating how module flags react when mergine two files. Normally, it's just the union of the two module flags. But if two module flags have the same key, then the resulting flags are dictated by the behaviors. Allowable behaviors are: Error Emits an error if two values disagree. Warning Emits a warning if two values disagree. Require Emits an error when the specified value is not present or doesn't have the specified value. It is an error for two (or more) llvm.module.flags with the same ID to have the Require behavior but different values. There may be multiple Require flags per ID. Override Uses the specified value if the two values disagree. It is an error for two (or more) llvm.module.flags with the same ID to have the Override behavior but different values. llvm-svn: 150300
* Convert assert(0) to llvm_unreachableCraig Topper2012-02-071-1/+1
| | | | llvm-svn: 149967
* use Constant::getAggregateElement to simplify a bunch of code.Chris Lattner2012-01-251-15/+4
| | | | llvm-svn: 148934
* add more support for ConstantDataSequentialChris Lattner2012-01-241-18/+21
| | | | llvm-svn: 148802
* The iteration order over a std::set<Module*> depends on the addresses of theRafael Espindola2012-01-231-2/+2
| | | | | | modules. Avoid that to make the order the linker sees the modules deterministic. llvm-svn: 148676
* Link symbols with different visibilities according to the rules in theRafael Espindola2012-01-051-24/+54
| | | | | | | | System V Application Binary Interface. This lets us use -fvisibility-inlines-hidden with LTO. Fixes PR11697. llvm-svn: 147624
* When not destroying the source, the linker is not remapping the types. Added ↵Mon P Wang2011-12-231-1/+1
| | | | | | | | support to CloneFunctionInto to allow remapping for this case. llvm-svn: 147217
* drop unneeded config.h includesDylan Noblesmith2011-12-222-2/+0
| | | | llvm-svn: 147197
OpenPOWER on IntegriCloud