summaryrefslogtreecommitdiff
path: root/tools
Commit message (Collapse)AuthorAge
* Move the *PassPrinter into their own module.Eli Bendersky2014-02-10
| | | | | | | | | | | | These are self-contained in functionality so it makes sense to separate them, as opt.cpp has grown quite big already. Following Eric's suggestions, if this code is ever deemed useful outside of tools/opt, it will make sense to move it to one of the LLVM libraries like IR. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201116 91177308-0d34-0410-b5e6-96231b3b80d8
* LTO API: add lto_module_create_from_memory_with_path.Manman Ren2014-02-10
| | | | | | | | | | | | | | This function adds an extra path argument to lto_module_create_from_memory. The path argument will be passed to makeBuffer to make sure the MemoryBuffer has a name and the created module has a module identifier. This is mainly for emitting warning messages from the linker. When we emit warning message on a module, we can use the module identifier. rdar://15985737 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201114 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an old FIXME. LDPO_PIE is available since 2.23, realeased 2012-10-22.Rafael Espindola2014-02-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201110 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the begin and end methods in ObjectFile to match the style guide.Rafael Espindola2014-02-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201108 91177308-0d34-0410-b5e6-96231b3b80d8
* tools: cast the right operandSaleem Abdulrasool2014-02-09
| | | | | | Properly apply the fix intended by SVN r201032. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201036 91177308-0d34-0410-b5e6-96231b3b80d8
* tools: explicitly cast to avoid a warningSaleem Abdulrasool2014-02-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201032 91177308-0d34-0410-b5e6-96231b3b80d8
* tools: handle out-of-line personality 0 decodingSaleem Abdulrasool2014-02-08
| | | | | | | | In some cases it is possible to have a personality 0 unwinding opcodes in the extab (such as when .handlerdata is used in the assembly). Simply decode the 3 opcodes for that case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201030 91177308-0d34-0410-b5e6-96231b3b80d8
* [PM] Add a new "lazy" call graph analysis pass for the new pass manager.Chandler Carruth2014-02-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The primary motivation for this pass is to separate the call graph analysis used by the new pass manager's CGSCC pass management from the existing call graph analysis pass. That analysis pass is (somewhat unfortunately) over-constrained by the existing CallGraphSCCPassManager requirements. Those requirements make it *really* hard to cleanly layer the needed functionality for the new pass manager on top of the existing analysis. However, there are also a bunch of things that the pass manager would specifically benefit from doing differently from the existing call graph analysis, and this new implementation tries to address several of them: - Be lazy about scanning function definitions. The existing pass eagerly scans the entire module to build the initial graph. This new pass is significantly more lazy, and I plan to push this even further to maximize locality during CGSCC walks. - Don't use a single synthetic node to partition functions with an indirect call from functions whose address is taken. This node creates a huge choke-point which would preclude good parallelization across the fanout of the SCC graph when we got to the point of looking at such changes to LLVM. - Use a memory dense and lightweight representation of the call graph rather than value handles and tracking call instructions. This will require explicit update calls instead of some updates working transparently, but should end up being significantly more efficient. The explicit update calls ended up being needed in many cases for the existing call graph so we don't really lose anything. - Doesn't explicitly model SCCs and thus doesn't provide an "identity" for an SCC which is stable across updates. This is essential for the new pass manager to work correctly. - Only form the graph necessary for traversing all of the functions in an SCC friendly order. This is a much simpler graph structure and should be more memory dense. It does limit the ways in which it is appropriate to use this analysis. I wish I had a better name than "call graph". I've commented extensively this aspect. This is still very much a WIP, in fact it is really just the initial bits. But it is about the fourth version of the initial bits that I've implemented with each of the others running into really frustrating problms. This looks like it will actually work and I'd like to split the actual complexity across commits for the sake of my reviewers. =] The rest of the implementation along with lots of wiring will follow somewhat more rapidly now that there is a good path forward. Naturally, this doesn't impact any of the existing optimizer. This code is specific to the new pass manager. A bunch of thanks are deserved for the various folks that have helped with the design of this, especially Nick Lewycky who actually sat with me to go through the fundamentals of the final version here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200903 91177308-0d34-0410-b5e6-96231b3b80d8
* [PM] Back out one hunk of the patch in r200901 that was *supposed* to goChandler Carruth2014-02-06
| | | | | | in my next patch. Sorry for the breakage. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200902 91177308-0d34-0410-b5e6-96231b3b80d8
* [PM] Wire up the analysis managers in the opt driver. This isn't reallyChandler Carruth2014-02-06
| | | | | | | | | necessary until we add analyses to the driver, but I have such an analysis ready and wanted to split this out. This is actually exercised by the existing tests of the new pass manager as the analysis managers are cross-checked and validated by the function and module managers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200901 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove support for not using .loc directives.Rafael Espindola2014-02-05
| | | | | | Clang itself was not using this. The only way to access it was via llc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200862 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the information provided by getFlags to unify some code in llvm-nm.Rafael Espindola2014-02-05
| | | | | | | | | | It is not clear how much we should try to expose in getFlags. For example, should there be a SF_Object and a SF_Text? But for information that is already being exposed, we may as well use it in llvm-nm. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200820 91177308-0d34-0410-b5e6-96231b3b80d8
* Small fix for llvm-nm handling of weak symbols on ELF (print 'v').Rafael Espindola2014-02-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200808 91177308-0d34-0410-b5e6-96231b3b80d8
* cleanup: scc_iterator consumers should use isAtEndDuncan P. N. Exon Smith2014-02-04
| | | | | | | | | | | | | | No functional change. Updated loops from: for (I = scc_begin(), E = scc_end(); I != E; ++I) to: for (I = scc_begin(); !I.isAtEnd(); ++I) for teh win. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200789 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Implement the preserve-paths flagJustin Bogner2014-02-04
| | | | | | | | | | | | | | | | Until now, when a path in a gcno file included a directory, we would emit our .gcov file in that directory, whereas gcov always emits the file in the current directory. In doing so, this implements gcov's strange name-mangling -p flag, which is needed to avoid clobbering files when two with the same name exist in different directories. The path mangling is a bit ugly and only handles unix-like paths, but it's simple, and it doesn't make any guesses as to how it should behave outside of what gcov documents. If we decide this should be cross platform later, we can consider the compatibility implications then. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200754 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Implement the object-directory flagJustin Bogner2014-02-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200741 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Ignore missing .gcda filesJustin Bogner2014-02-04
| | | | | | | | When gcov is run without gcda data, it acts as if the counts are all zero and labels the file as - to indicate that there was no data. We should do the same. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200740 91177308-0d34-0410-b5e6-96231b3b80d8
* Move error handling down to getSymbolNMTypeChar.Rafael Espindola2014-02-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200727 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify getSymbolFlags.Rafael Espindola2014-01-31
| | | | | | | None of the object formats require extra parsing to compute these flags, so the method cannot fail. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200574 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r200560, "LTO itself hasn't depended on MCDisassembler any more."NAKAMURA Takumi2014-01-31
| | | | | | Oh sorry, I missed LTO.exports, ... I checked just only *.cpp(s). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200562 91177308-0d34-0410-b5e6-96231b3b80d8
* LTO itself hasn't depended on MCDisassembler any more.NAKAMURA Takumi2014-01-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200560 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm/tools: Prune redundant target_link_libraries.NAKAMURA Takumi2014-01-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200559 91177308-0d34-0410-b5e6-96231b3b80d8
* This file already has a "using namespace object;", use it.Rafael Espindola2014-01-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200493 91177308-0d34-0410-b5e6-96231b3b80d8
* Only ELF has a dynamic symbol table. Remove it from ObjectFile.Rafael Espindola2014-01-30
| | | | | | | | | COFF has only one symbol table. MachO has a LC_DYSYMTAB, but that is not a symbol table, just extra info about the one symbol table (LC_SYMTAB). IR (coming soon) also has only one table. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200488 91177308-0d34-0410-b5e6-96231b3b80d8
* Use early returns and factor the object::Binary creation.Rafael Espindola2014-01-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200484 91177308-0d34-0410-b5e6-96231b3b80d8
* tools: fix Twine abuseSaleem Abdulrasool2014-01-30
| | | | | | | utohexstr provides a temporary string, making it unsafe to use with the Twine interface which will not copy the string. Switch to using std::string. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200457 91177308-0d34-0410-b5e6-96231b3b80d8
* tools: remove unnecessary typenameSaleem Abdulrasool2014-01-30
| | | | | | | This is acceptted by clang and gcc, but MSVC seems to balk at it. As it is unneeded, simply drop it. Fixes MSVC buildbots. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200456 91177308-0d34-0410-b5e6-96231b3b80d8
* tools: repair Windows buildSaleem Abdulrasool2014-01-30
| | | | | | | | | exp2 is not available on Windows. Fortunately, we are calculating powers of 2 with expontents within the range of [4,12]. Simply use an equivalent bitshift operation to repair compilation with MSVC which does not provide this standard function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200454 91177308-0d34-0410-b5e6-96231b3b80d8
* tools: add support for decoding ARM attributesSaleem Abdulrasool2014-01-30
| | | | | | | | Enhance the ARM specific parsing support in llvm-readobj to support attributes. This allows for simpler tests to validate encoding of the build attributes as specified in the ARM ELF specification. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200450 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify the handling of iterators in ObjectFile.Rafael Espindola2014-01-30
| | | | | | | | | | | | None of the object file formats reported error on iterator increment. In retrospect, that is not too surprising: no object format stores symbols or sections in a linked list or other structure that requires chasing pointers. As a consequence, all error checking can be done on begin() and end(). This reduces the text segment of bin/llvm-readobj in my machine from 521233 to 518526 bytes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200442 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix TLS handling in ELF's getAddress and llvm-nm to print 'D' for it.Rafael Espindola2014-01-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200433 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Accept the long forms of gcov optionsJustin Bogner2014-01-29
| | | | | | | | | This is a bit imperfect, as these options don't show up in the help as is and single dash variants are accepted, which differs from gcov. Unfortunately, this seems to be as good as it gets with the cl::opt machinery, so it'll do as an incremental step. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200419 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Improve help message textJustin Bogner2014-01-29
| | | | | | | | This Properly capitalizes and clarifies the help output from llvm-cov. It also puts the llvm-only / non-gcov-compatible options in their own category. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200418 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Expect a source file as a positional parameterJustin Bogner2014-01-29
| | | | | | | | | | | Currently, llvm-cov isn't command-line compatible with gcov, which accepts a source file name as its first parameter and infers the gcno and gcda file names from that. This change keeps our -gcda and -gcno options available for convenience in overriding this behaviour, but adds the required parameter and inference behaviour as a compatible default. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200417 91177308-0d34-0410-b5e6-96231b3b80d8
* Normalize the style in llvm-nm.cpp.Rafael Espindola2014-01-29
| | | | | | | It had grown fairly inconsistent. I am about to change it quite a bit to also use the object api when handling IR files. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200374 91177308-0d34-0410-b5e6-96231b3b80d8
* Make createObjectFile's signature a bit less error prone.Rafael Espindola2014-01-29
| | | | | | | This will be better with c++11, but right now file_magic converts to bool, which makes the api really easy to misuse. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200357 91177308-0d34-0410-b5e6-96231b3b80d8
* Change MCStreamer EmitInstruction interface to take subtarget infoDavid Woodhouse2014-01-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200345 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Put lli-child-target into the Folder "Misc".NAKAMURA Takumi2014-01-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200297 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not reference llvm-gcc from bugpointTobias Grosser2014-01-27
| | | | | | Reiterating: llvm-gcc is dead since a long time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200220 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA.Rui Ueyama2014-01-27
| | | | | | | editbin.exe and link.exe both accepts /highentropyva option to set this bit, so doing s/VIRTUAL_ADDRESS/VA/ should make sense. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200191 91177308-0d34-0410-b5e6-96231b3b80d8
* Pass a MCSubtargetInfo down to the TargetStreamer creation.Rafael Espindola2014-01-26
| | | | | | | With this the target streamers will be able to know the target features that are in use. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200135 91177308-0d34-0410-b5e6-96231b3b80d8
* COFF: Add a missing enum value for high entropy ASLR.Rui Ueyama2014-01-26
| | | | | | | | | That bit is not documented in the PE/COFF spec published by Microsoft, so we don't know the official name of it. I named this bit IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VIRTUAL_ADDRESS because the bit is reported as "high entropy virtual address" by dumpbin.exe, git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200121 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-readobj: add support for PE32+ (Windows 64 bit executable).Rui Ueyama2014-01-26
| | | | | | | | | | | | PE32+ supports 64 bit address space, but the file format remains 32 bit. So its file format is pretty similar to PE32 (32 bit executable). The differences compared to PE32 are (1) the lack of "BaseOfData" field and (2) some of its data members are 64 bit. In this patch, I added a new member function to get a PE32+ Header object to COFFObjectFile class and made llvm-readobj to use it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200117 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix "llvm-objdump -d -r" to show relocations inline for ELF filesMark Seaborn2014-01-25
| | | | | | | | | | | | | | | | | | | This fixes a regression introduced by r182908, which broke llvm-objdump's ability to display relocations inline in a disassembly dump for ELF object files. That change removed a SectionRelocMap from Object/ELF.h, which we recreate in llvm-objdump.cpp. I discovered this regression via an out-of-tree test (test/NaCl/X86/pnacl-hides-sandbox-x86-64.ll) which used llvm-objdump. Note that the "Unknown" string in the test output on i386 isn't quite right, but this appears to be a pre-existing bug. Differential Revision: http://llvm-reviews.chandlerc.com/D2559 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200090 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-objdump: Some style cleanups to follow LLVM coding styleMark Seaborn2014-01-25
| | | | | | | | | | | | Rename "ec" to "EC", and rename some iterators. Then fix whitespace using clang-format-diff. (As requested in http://llvm-reviews.chandlerc.com/D2559) Differential Revision: http://llvm-reviews.chandlerc.com/D2594 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200053 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix c++03 build.Rafael Espindola2014-01-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200042 91177308-0d34-0410-b5e6-96231b3b80d8
* Make ObjectFile ownership of the MemoryBuffer optional.Rafael Espindola2014-01-24
| | | | | | This allows llvm-ar to mmap the input files only once. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200040 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix known typosAlp Toker2014-01-24
| | | | | | | Sweep the codebase for common typos. Includes some changes to visible function names that were misspelt. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200018 91177308-0d34-0410-b5e6-96231b3b80d8
* Report lli remote IO errors consistentlyAlp Toker2014-01-24
| | | | | | | | | This enables IO error reports in both the child and server processes. The scheme still isn't entirely satisfactory and output is jumbled but it beats having no output at all. This will hopefully unblock ARM support (PR18057). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200017 91177308-0d34-0410-b5e6-96231b3b80d8
* lli: Factor portable messaging into a new RPCChannel facilityAlp Toker2014-01-23
| | | | | | | The client and server now use a single unified low-level RPC core built around LLVM's existing cross-platform abstractions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199947 91177308-0d34-0410-b5e6-96231b3b80d8