summaryrefslogtreecommitdiff
path: root/tools
Commit message (Collapse)AuthorAge
* [Object] Split the ELF interface into 3 parts.Michael J. Spencer2013-08-08
| | | | | | | | * ELFTypes.h contains template magic for defining types based on endianess, size, and alignment. * ELFFile.h defines the ELFFile class which provides low level ELF specific access. * ELFObjectFile.h contains ELFObjectFile which uses ELFFile to implement the ObjectFile interface. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188022 91177308-0d34-0410-b5e6-96231b3b80d8
* Change public functions of LTOCodeGenerator from ret-false-on-succ to ↵Shuxin Yang2013-08-07
| | | | | | | | | | | | ret-true-on-succ. As of this revision, all functions of LTOCodeGenerator are consistent in ret-true-on-succ. Tested on multiple OSes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187864 91177308-0d34-0410-b5e6-96231b3b80d8
* Change private functions of LTOCodeGenerator from ret-false-on-succ to ↵Shuxin Yang2013-08-06
| | | | | | ret-true-on-succ. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187819 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor FlattenCFG out from SimplifyCFGTom Stellard2013-08-06
| | | | | | Patch by: Mei Ye git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187764 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some comment to LTOCodeGenerator classShuxin Yang2013-08-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187761 91177308-0d34-0410-b5e6-96231b3b80d8
* [bugpoint] Allow the user to specify the path to opt on the commandline.Michael Gottesman2013-08-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187739 91177308-0d34-0410-b5e6-96231b3b80d8
* Unbreak llvm-rtdyld build.Benjamin Kramer2013-08-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187699 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-rtdyld: Don't leak memory managers.Benjamin Kramer2013-08-03
| | | | | | Dyld never outlives MemMgr, just put both on the stack. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187697 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix invalid function pointers in bugpoint ExtractLoopsHal Finkel2013-08-02
| | | | | | | | | | | | | | | | | | | | | | | The ExtractLoops function tries to reduce the failing test case by extracting one or more loops from the misoptimized piece of the program. In doing this, ExtractLoops must keep the MiscompiledFunctions vector up-to-date by ensuring that the pointers refer to functions in the current failing program. Unfortunately, this is not trivial because: - ExtractLoops is iterative, and there are several early exits (and the MiscompiledFunctions vector must be consistent with the current program at every non-fatal exit point). - Several of the utility functions used by ExtractLoops (such as TestOptimizer, some of which are called through the TestFn callback parameter, and Linker::LinkModules) delete their inputs upon success. This change adds several updates of the MiscompiledFunctions vector at different points. The first is after the initial call to TestMergedProgram which checks that the loop-extracted program still works. The second is after the call to TestFn (TestOptimizer, for example). This function will delete its inputs (which is why the existing ExtractLoops logic cloned the inputs first). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187674 91177308-0d34-0410-b5e6-96231b3b80d8
* Use @rpath for libraries rather than @executable_path on OSX.Eric Christopher2013-08-02
| | | | | | Patch by Benjamin Scarlet! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187641 91177308-0d34-0410-b5e6-96231b3b80d8
* Use function attributes to indicate that we don't want to realign the stack.Bill Wendling2013-08-01
| | | | | | | | | Function attributes are the future! So just query whether we want to realign the stack directly from the function instead of through a random target options structure. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187618 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for the 's' operation to llvm-ar.Rafael Espindola2013-07-29
| | | | | | | | | | | | If no other operation is specified, 's' becomes an operation instead of an modifier. The s operation just creates a symbol table. It is the same as running ranlib. We assume the archive was created by a sane ar (like llvm-ar or gnu ar) and if the symbol table is present, then it is current. We use that to optimize the most common case: a broken build system that thinks it has to run ranlib. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187353 91177308-0d34-0410-b5e6-96231b3b80d8
* SimplifyCFG: Use parallel-and and parallel-or mode to consolidate branch ↵Tom Stellard2013-07-27
| | | | | | | | | | | | | | conditions Merge consecutive if-regions if they contain identical statements. Both transformations reduce number of branches. The transformation is guarded by a target-hook, and is currently enabled only for +R600, but the correctness has been tested on X86 target using a variety of CPU benchmarks. Patch by: Mei Ye git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187278 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the mblaze backend from llvm.Rafael Espindola2013-07-25
| | | | | | Approval in here http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-July/064169.html git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187145 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace the "NoFramePointerElimNonLeaf" target option with a function attribute.Bill Wendling2013-07-25
| | | | | | | | | There's no need to specify a flag to omit frame pointer elimination on non-leaf nodes...(Honestly, I can't parse that option out.) Use the function attribute stuff instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187093 91177308-0d34-0410-b5e6-96231b3b80d8
* Split getOpenFile into getOpenFile and getOpenFileSlice.Rafael Espindola2013-07-23
| | | | | | | | | | | | | | | | The main observation is that we never need both the filesize and the map size. When mapping a slice of a file, it doesn't make sense to request a null terminator and that would be the only case where the filesize would be used. There are other cleanups that should be done in this area: * A client should not have to pass the size (even an explicit -1) to say if it wants a null terminator or not, so we should probably swap the argument order. * The default should be to not require a null terminator. Very few clients require this, but many end up asking for it just because it is the default. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186984 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix use of the getOpenFile api.Rafael Espindola2013-07-23
| | | | | | | | | | | | | | | | The gold plugin was passing the desired map size as the file size. This was working for two reasons: * Recent version of gold provide the get_view callback, so this code was not used. * In older versions, getOpenFile was called, but the file size is never used if we don't require null terminated buffers and map size defaults to the file size. Thanks to Eli Bendersky for noticing this. I will try to make this api a bit less error prone. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186978 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the build in c++03 mode.Rafael Espindola2013-07-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186935 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an initial implementation of archive symbol table generation.Rafael Espindola2013-07-23
| | | | | | | | | | | The symbol table has forward references in the file. Instead of allocating a temporary buffer or counting the size and then writing, this implementation writes a dummy value first and patches it once the final value is known. There is room for performance improvement. I will implement them as soon as I get some other features (like a ranlib mode) in. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186934 91177308-0d34-0410-b5e6-96231b3b80d8
* remove unnecessary spaceShuxin Yang2013-07-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186931 91177308-0d34-0410-b5e6-96231b3b80d8
* Recommit r186217 with testcase fix:Bill Wendling2013-07-22
| | | | | | | | | | | Use the function attributes to pass along the stack protector buffer size. Now that we have robust function attributes, don't use a command line option to specify the stack protecto buffer size. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186863 91177308-0d34-0410-b5e6-96231b3b80d8
* Initialize/Register LTO passes to enable flags like -print-after=<lto-pass>Shuxin Yang2013-07-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | There already have two "dead" functions, initialize{IPO|IPA}, defined for similar purpose. I decide not to call these two functions for two reasons: o. they don't cover all LTO passes (which will soon be separated into IPO and post-IPO passes) o. We have not yet figured out the right passes and the ordering for IPO and post-IPO stages, meaning this change is only for the time being. Since LTO passes are registered, we are now able to print IR before and after particular point. For OSX users: -------------- "...-Wl,-mllvm -Wl,-print-after=<pass-name>" will print IR after the specified pass. For Other UNIX with GNU gold linker: ------------------------------------ "-Wl,-plugin-opt=-print-after=<pass-name>" should work. (NOTE: no need for "-Wl,-mllvm") Strip "-Wl," if flags are fed directly to linker instead of clang/clang++. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186853 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace archive members in the old position.Rafael Espindola2013-07-22
| | | | | | | | | | | | This matches gnu archive behavior and since archive member order can change which member is used, not changing the order on replacement looks like the right thing to do. This patch also refactors the logic for which archive member to keep and whether to move it to a helper function (computeInsertAction). The nesting in computeNewArchiveMembers was getting a bit confusing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186829 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle replacement into a position past the original member.Rafael Espindola2013-07-21
| | | | | | | We were incorrectly computing where to insert a member if it was replacing a previous member that was before the insert point. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186792 91177308-0d34-0410-b5e6-96231b3b80d8
* Retry submitting r186623: COFFDumper: Dump data directory entries.Rui Ueyama2013-07-19
| | | | | | | | The original change was rolled back in r186627 because of test failures on the big endian machine. I believe I fixed the issue so re-submitting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186734 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix inserting new elements in a specified location.Rafael Espindola2013-07-19
| | | | | | We were only handling the 'a' and 'b' options during moves before. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186721 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve llvm-mc disassembler mode and refactor ARM tests to use itTim Northover2013-07-19
| | | | | | | | | | | | | | | | | | This allows "llvm-mc -disassemble" to accept two new features: + Using comma as a byte separator + Grouping bytes with '[' and ']' pairs. The behaviour outside a [...] group is unchanged. But within the group once llvm-mc encounters a true error, it stops rather than trying to resynchronise the stream at the next byte. This is more useful for disassembly tests, where we have an almost-instruction in mind and don't care what the misaligned interpretation would be. Particularly if it means llvm-mc won't actually see the next intended almost-instruction. As a side effect, this means llvm-mc can disassemble its own -show-encoding output if copy-pasted. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186661 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "COFFDumper: Dump data directory entries."Rui Ueyama2013-07-18
| | | | | | Because it broke s390x and ppc64-linux buildbots. This reverts commit r186623. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186627 91177308-0d34-0410-b5e6-96231b3b80d8
* COFFDumper: Dump data directory entries.Rui Ueyama2013-07-18
| | | | | | | | | | | | | | | | | Summary: Dump optional data directory entries in the PE/COFF header, so that we can test the output of LLD linker. This patch updates the test binary file, but the source of the binary is the same. I just re-linked the file. I don't know how the previous file was linked, but the previous file did not have any data directory entries for some reason. Reviewers: rafael CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1148 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186623 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-ar: doExtract(): Write extracted files with F_Binary. It should fix ↵NAKAMURA Takumi2013-07-17
| | | | | | llvm/test/Object/extract.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186503 91177308-0d34-0410-b5e6-96231b3b80d8
* LLVMSymbolize.cpp: Fix build. Triple::ArchType is not a namespace.NAKAMURA Takumi2013-07-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186494 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-symbolizer: be more careful with colons in file namesAlexey Samsonov2013-07-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186493 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a wrapper for open.Rafael Espindola2013-07-16
| | | | | | | This centralizes the handling of O_BINARY and opens the way for hiding more differences (like how open behaves with directories). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186447 91177308-0d34-0410-b5e6-96231b3b80d8
* On error, close the temporary file descriptor.Rafael Espindola2013-07-16
| | | | | | With this change llvm-ar can remove the temporary file on windows too. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186423 91177308-0d34-0410-b5e6-96231b3b80d8
* Use open+fstat instead of stat+open.Rafael Espindola2013-07-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186381 91177308-0d34-0410-b5e6-96231b3b80d8
* Remember that we have a null terminated string.Rafael Espindola2013-07-16
| | | | | | | This is a micro optimization. Instead of going char*->StringRef->Twine->char*, go char*->Twine->char* and avoid having to copy the filename on the stack. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186380 91177308-0d34-0410-b5e6-96231b3b80d8
* Try to open the file before use data from stat.Rafael Espindola2013-07-13
| | | | | | | Looks like on mingw we get bogus last modification times on directories. Should fix the mingw bots. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186240 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused file. Thanks to Sean Silva for noticing it.Rafael Espindola2013-07-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186239 91177308-0d34-0410-b5e6-96231b3b80d8
* Add r186216 back, but make the test tolerant of different uids and gids.Rafael Espindola2013-07-13
| | | | | | | original message: Fix a off by one error about which members need to use the string table. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186238 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert commit r186217 -- this is breaking bots:Chandler Carruth2013-07-13
| | | | | | | | | | http://lab.llvm.org:8013/builders/clang-x86_64-darwin11-nobootstrap-RAincremental/builds/4328 Original commit log: Use the function attributes to pass along the stack protector buffer size. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186234 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert commit r186216 -- it's breaking bots:Chandler Carruth2013-07-13
| | | | | | | | | | http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/6897/steps/check-all/logs/LLVM%3A%3Aarchive-format.test Original commit log: Fix a off by one error about which members need to use the string table. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186232 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the function attributes to pass along the stack protector buffer size.Bill Wendling2013-07-12
| | | | | | | | Now that we have robust function attributes, don't use a command line option to specify the stack protecto buffer size. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186217 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a off by one error about which members need to use the string table.Rafael Espindola2013-07-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186216 91177308-0d34-0410-b5e6-96231b3b80d8
* fix autoconf buildRafael Espindola2013-07-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186200 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the build with c++03.Rafael Espindola2013-07-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186198 91177308-0d34-0410-b5e6-96231b3b80d8
* Change llvm-ar to use lib/Object.Rafael Espindola2013-07-12
| | | | | | | | | | | | | | | | | | | | | | This fixes two bugs is lib/Object that the use in llvm-ar found: * In OS X created archives, the name can be padded with nulls. Strip them. * In the constructor, remember the first non special member and use that in begin_children. This makes sure we skip all special members, not just the first one. The change to llvm-ar itself consist of * Using lib/Object for reading archives instead of ArchiveReader.cpp. * Writing the modified archive directly, instead of creating an in memory representation. The old Archive library was way more general than what is needed, as can be seen by the diffstat of this patch. Having llvm-ar using lib/Object now opens the way for creating regular symbol tables for both native objects and bitcode files so that we can use those archives for LTO. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186197 91177308-0d34-0410-b5e6-96231b3b80d8
* Add static.Rafael Espindola2013-07-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186170 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-ar: Clean up memory management with OwningPtr.Benjamin Kramer2013-07-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186131 91177308-0d34-0410-b5e6-96231b3b80d8
* Use %llu to print a 64 bit number. Should fix the ARM bots.Rafael Espindola2013-07-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186113 91177308-0d34-0410-b5e6-96231b3b80d8
* InsertBefore is the same as AddBefore. Delete it.Rafael Espindola2013-07-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186094 91177308-0d34-0410-b5e6-96231b3b80d8