summaryrefslogtreecommitdiff
path: root/tools/lto/LTOModule.cpp
Commit message (Collapse)AuthorAge
* lto/addAsmGlobalSymbols: fast path when no module level asm is present.Ivan Krasin2011-09-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139284 91177308-0d34-0410-b5e6-96231b3b80d8
* lto/addAsmGlobalSymbols: fail fracefully when the target does not define ↵Ivan Krasin2011-09-08
| | | | | | AsmParser. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139283 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't drop alignment info on local common symbols.Benjamin Kramer2011-09-01
| | | | | | | | | | | - On COFF the .lcomm directive has an alignment argument. - On ELF we fall back to .local + .comm Based on a patch by NAKAMURA Takumi. Fixes PR9337, PR9483 and PR10128. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138976 91177308-0d34-0410-b5e6-96231b3b80d8
* Move TargetRegistry and TargetSelect from Target to Support where they belong.Evan Cheng2011-08-24
| | | | | | | These are strictly utilities for registering targets and components. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138450 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused Target argument from AsmParser construction methods.Jim Grosbach2011-08-16
| | | | | | | The argument is unused, and is a layering violation in any case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137735 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename TargetAsmParser to MCTargetAsmParser and TargetAsmLexer to ↵Evan Cheng2011-07-26
| | | | | | MCTargetAsmLexer; rename createAsmLexer to createMCAsmLexer and createAsmParser to createMCAsmParser. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136027 91177308-0d34-0410-b5e6-96231b3b80d8
* Move TargetAsmParser.h TargetAsmBackend.h and TargetAsmLexer.h to MC where ↵Evan Cheng2011-07-23
| | | | | | they belong. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135833 91177308-0d34-0410-b5e6-96231b3b80d8
* Combine all MC initialization routines into one. e.g. InitializeX86MCAsmInfo,Evan Cheng2011-07-22
| | | | | | | InitializeX86MCInstrInfo, etc. are combined into InitializeX86TargetMC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135812 91177308-0d34-0410-b5e6-96231b3b80d8
* Goodbye TargetAsmInfo. This eliminate last bit of CodeGen and Target in llvm-mc.Evan Cheng2011-07-20
| | | | | | | | There is still a bit more refactoring left to do in Targets. But we are now very close to fixing all the layering issues in MC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135611 91177308-0d34-0410-b5e6-96231b3b80d8
* Add MCObjectFileInfo and sink the MCSections initialization code fromEvan Cheng2011-07-20
| | | | | | | | | TargetLoweringObjectFileImpl down to MCObjectFileInfo. TargetAsmInfo is done to one last method. It's *almost* gone! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135569 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce MCCodeGenInfo, which keeps information that can affect codegenEvan Cheng2011-07-19
| | | | | | | | (including compilation, assembly). Move relocation model Reloc::Model from TargetMachine to MCCodeGenInfo so it's accessible even without TargetMachine. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135468 91177308-0d34-0410-b5e6-96231b3b80d8
* Sink getDwarfRegNum, getLLVMRegNum, getSEHRegNum from TargetRegisterInfo downEvan Cheng2011-07-18
| | | | | | | | | | to MCRegisterInfo. Also initialize the mapping at construction time. This patch eliminate TargetRegisterInfo from TargetAsmInfo. It's another step towards fixing the layering violation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135424 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename createAsmInfo to createMCAsmInfo and move registration code to ↵Evan Cheng2011-07-14
| | | | | | MCTargetDesc to prepare for next round of changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135219 91177308-0d34-0410-b5e6-96231b3b80d8
* Unfortunately several files in MC are badly violating layering rule by usingEvan Cheng2011-07-14
| | | | | | | | | | TargetAsmInfo, which in turn pulls in TargetRegisterInfo, etc. :-( There are other cases of violations, but this is probably the worst. This patch is but one small step towards fixing this. 500 more steps to go. :-( git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135131 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix LTO after the recent MC subtarget refactoring.Cameron Zwarich2011-07-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134930 91177308-0d34-0410-b5e6-96231b3b80d8
* Change createAsmParser to take a MCSubtargetInfo instead of triple,Evan Cheng2011-07-09
| | | | | | | | | | CPU, and feature string. Parsing some asm directives can change subtarget state (e.g. .code 16) and it must be reflected in other modules (e.g. MCCodeEmitter). That is, the MCSubtargetInfo instance must be shared. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134795 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate asm parser's dependency on TargetMachine:Evan Cheng2011-07-08
| | | | | | | | | | | - Each target asm parser now creates its own MCSubtatgetInfo (if needed). - Changed AssemblerPredicate to take subtarget features which tablegen uses to generate asm matcher subtarget feature queries. e.g. "ModeThumb,FeatureThumb2" is translated to "(Bits & ModeThumb) != 0 && (Bits & FeatureThumb2) != 0". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134678 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the ridiculous SubtargetFeatures API where it implicitly expects CPU name toEvan Cheng2011-06-30
| | | | | | | | | | | be the first encoded as the first feature. It then uses the CPU name to look up features / scheduling itineray even though clients know full well the CPU name being used to query these properties. The fix is to just have the clients explictly pass the CPU name! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134127 91177308-0d34-0410-b5e6-96231b3b80d8
* Sink SubtargetFeature and TargetInstrItineraries (renamed ↵Evan Cheng2011-06-29
| | | | | | MCInstrItineraries) into MC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134049 91177308-0d34-0410-b5e6-96231b3b80d8
* Reinstate r133516 "Remove some unnecessary uses of c_str()." A trailing nullChad Rosier2011-06-28
| | | | | | | | | | character in std::string was causing failures for a few ObjC and Obj-C++ tests when -flto was enabled. Revision 133999 resolved this issue. Thanks Jay! rdar://9685235 PR10210 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134017 91177308-0d34-0410-b5e6-96231b3b80d8
* PR10210: New method ConstantArray::getAsCString(). Use it in LTO toJay Foad2011-06-28
| | | | | | | avoid getting embedded trailing null bytes in std::strings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133999 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r133516 "Remove some unnecessary uses of c_str()."Chad Rosier2011-06-27
| | | | | | | | This was causing compile-time failures for some of the Objc and Obj-C++ benchmarks. The specific errors were of the form: "ld: duplicate symbol …" rdar://9660124 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133955 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove some unnecessary uses of c_str().Jay Foad2011-06-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133516 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify the handling of pcrel relocations on ELF. Now we do the right thingRafael Espindola2011-05-01
| | | | | | | | | | for all symbol differences and can drop the old EmitPCRelSymbolValue method. This also make getExprForFDESymbol on ELF equal to the one on MachO, and it can be made non-virtual. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130634 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused argument.Rafael Espindola2011-04-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129955 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typo in comment.Nick Lewycky2011-04-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129902 91177308-0d34-0410-b5e6-96231b3b80d8
* Use lazy parsing in LTO. Unfortunately this is only a 3% time saving forRafael Espindola2011-03-18
| | | | | | 'ar'. Have to figure out how to make libLTO even lazier. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127901 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify the computation of undefined symbols. Instead of walkingRafael Espindola2011-03-18
| | | | | | | | | | | | | | | | | | | | | | | functions and initializers, just report the declarations present in the module. The motivation is to open the way for using the lazy module parsing, which should speed up clients that just want a symbol list (nm, ar). This is slightly less precise, but since both -strip-dead-prototypes and -globaldce are part of the standard pipeline, this shouldn't change the result for clang/dragonegg produced binaries. Any decl in an IL file was also put there because a FE expected it to be necessary, so this should not be a problem for "-O0 -emit-llvm". As a sanity check, I have bootstrapped clang on linux and built firefox on both linux and darwin. A clang bootstrap on darwin with LTO fails with or without this patch because, ironically, the linker doesn't like the combination of dead_strip and LTO when building libLTO.so :-) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127870 91177308-0d34-0410-b5e6-96231b3b80d8
* tools/lto/LTOModule.cpp: Eliminate an unused variable.NAKAMURA Takumi2011-03-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127859 91177308-0d34-0410-b5e6-96231b3b80d8
* Use RequiresNullTerminator to create buffers without a null terminatorRafael Espindola2011-03-17
| | | | | | instead of copying. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127835 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support in the LTO library for loading an object from the middleRafael Espindola2011-03-17
| | | | | | of an file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127781 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a special streamer to libLTO that just records symbols definitions andRafael Espindola2011-03-02
| | | | | | | | | | | uses. The result produced by the streamer is used to give the linker more accurate information and to add to llvm.compiler.used. The second improvement removes the need for the user to add __attribute__((used)) to functions only used in inline asm. The first one lets us build firefox with LTO on Darwin :-) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126830 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix some memory leaks and avoid looking in the hash tables twice.Rafael Espindola2011-02-20
| | | | | | libxul links in 7m0.403s. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126085 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove std::string version of getNameWithPrefix.Rafael Espindola2011-02-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125363 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't open the file again in the gold plugin. To be able to do this, updateRafael Espindola2011-02-08
| | | | | | MemoryBuffer::getOpenFile to not close the file descriptor. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125128 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't tell the linker about available_externally definitions. If we do, it willRafael Espindola2011-02-01
| | | | | | complain about duplicated definitions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124634 91177308-0d34-0410-b5e6-96231b3b80d8
* MemoryBuffer now return an error_code and returns a OwningPtr<MemoryBuffer> ↵Michael J. Spencer2010-12-16
| | | | | | via an out parm. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121958 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed version of 121434 with no new memory leaks.Rafael Espindola2010-12-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121471 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert my previous patch to make the valgrind bots happy.Rafael Espindola2010-12-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121461 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial support for the cfi directives. This is just enough to getRafael Espindola2010-12-09
| | | | | | | | | | | f: .cfi_startproc nop .cfi_endproc assembled (on ELF). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121434 91177308-0d34-0410-b5e6-96231b3b80d8
* More code not compiled by CMake. :(.Michael J. Spencer2010-12-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121387 91177308-0d34-0410-b5e6-96231b3b80d8
* I swear I did a make clean and make before committing all this...Michael J. Spencer2010-11-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120304 91177308-0d34-0410-b5e6-96231b3b80d8
* Record sysbols created by aliases. Fixes PR8414.Rafael Espindola2010-10-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116910 91177308-0d34-0410-b5e6-96231b3b80d8
* Provide a fast "get me the target triple from the module" API. This canBill Wendling2010-10-06
| | | | | | | | | drastically reduce the linking time during LTO. Patch by Shantonu Sen! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115728 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new scope type "LTO_SYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDEN" for theBill Wendling2010-09-27
| | | | | | | "linker_private_weak_auto_def" linkage type for LTO. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114868 91177308-0d34-0410-b5e6-96231b3b80d8
* The "linker_private_weak*" linkages should set the LTO_SYMBOL_DEFINITION_WEAKBill Wendling2010-09-27
| | | | | | | during LTO. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114850 91177308-0d34-0410-b5e6-96231b3b80d8
* lto: Fix an inverted conditional which prevented the addition of symbols scrapedDaniel Dunbar2010-08-11
| | | | | | | | from inline assembly, except in cases where they had already been seen (in which case they would get added twice). - I can't see how this ever worked... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110757 91177308-0d34-0410-b5e6-96231b3b80d8
* lto: Fix gratuitous memory leaks.Daniel Dunbar2010-08-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110756 91177308-0d34-0410-b5e6-96231b3b80d8
* lto: Reduce nesting.Daniel Dunbar2010-08-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110752 91177308-0d34-0410-b5e6-96231b3b80d8
* LTOModule.cpp: Fix numerous style issues.Daniel Dunbar2010-08-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110751 91177308-0d34-0410-b5e6-96231b3b80d8