summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* tools: add support for decoding ARM attributesSaleem Abdulrasool2014-01-308-0/+834
| | | | | | | | 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. llvm-svn: 200450
* Simplify the handling of iterators in ObjectFile.Rafael Espindola2014-01-3012-165/+55
| | | | | | | | | | | | 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. llvm-svn: 200442
* Fix TLS handling in ELF's getAddress and llvm-nm to print 'D' for it.Rafael Espindola2014-01-301-0/+1
| | | | llvm-svn: 200433
* llvm-cov: Accept the long forms of gcov optionsJustin Bogner2014-01-291-0/+6
| | | | | | | | | 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. llvm-svn: 200419
* llvm-cov: Improve help message textJustin Bogner2014-01-291-22/+21
| | | | | | | | 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. llvm-svn: 200418
* llvm-cov: Expect a source file as a positional parameterJustin Bogner2014-01-291-13/+17
| | | | | | | | | | | 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. llvm-svn: 200417
* Normalize the style in llvm-nm.cpp.Rafael Espindola2014-01-291-298/+308
| | | | | | | It had grown fairly inconsistent. I am about to change it quite a bit to also use the object api when handling IR files. llvm-svn: 200374
* Make createObjectFile's signature a bit less error prone.Rafael Espindola2014-01-291-1/+2
| | | | | | | This will be better with c++11, but right now file_magic converts to bool, which makes the api really easy to misuse. llvm-svn: 200357
* Change MCStreamer EmitInstruction interface to take subtarget infoDavid Woodhouse2014-01-281-3/+4
| | | | llvm-svn: 200345
* [CMake] Put lli-child-target into the Folder "Misc".NAKAMURA Takumi2014-01-281-0/+2
| | | | llvm-svn: 200297
* Do not reference llvm-gcc from bugpointTobias Grosser2014-01-271-3/+3
| | | | | Reiterating: llvm-gcc is dead since a long time. llvm-svn: 200220
* Rename IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA.Rui Ueyama2014-01-271-2/+1
| | | | | | | editbin.exe and link.exe both accepts /highentropyva option to set this bit, so doing s/VIRTUAL_ADDRESS/VA/ should make sense. llvm-svn: 200191
* Pass a MCSubtargetInfo down to the TargetStreamer creation.Rafael Espindola2014-01-261-1/+1
| | | | | | | With this the target streamers will be able to know the target features that are in use. llvm-svn: 200135
* COFF: Add a missing enum value for high entropy ASLR.Rui Ueyama2014-01-261-0/+2
| | | | | | | | | 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, llvm-svn: 200121
* llvm-readobj: add support for PE32+ (Windows 64 bit executable).Rui Ueyama2014-01-261-48/+63
| | | | | | | | | | | | 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. llvm-svn: 200117
* Fix "llvm-objdump -d -r" to show relocations inline for ELF filesMark Seaborn2014-01-251-6/+23
| | | | | | | | | | | | | | | | | | | 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 llvm-svn: 200090
* llvm-objdump: Some style cleanups to follow LLVM coding styleMark Seaborn2014-01-251-56/+69
| | | | | | | | | | | | 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 llvm-svn: 200053
* Fix c++03 build.Rafael Espindola2014-01-241-6/+12
| | | | llvm-svn: 200042
* Make ObjectFile ownership of the MemoryBuffer optional.Rafael Espindola2014-01-241-38/+32
| | | | | | This allows llvm-ar to mmap the input files only once. llvm-svn: 200040
* Fix known typosAlp Toker2014-01-244-4/+4
| | | | | | | Sweep the codebase for common typos. Includes some changes to visible function names that were misspelt. llvm-svn: 200018
* Report lli remote IO errors consistentlyAlp Toker2014-01-245-41/+30
| | | | | | | | | 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). llvm-svn: 200017
* lli: Factor portable messaging into a new RPCChannel facilityAlp Toker2014-01-239-168/+151
| | | | | | | The client and server now use a single unified low-level RPC core built around LLVM's existing cross-platform abstractions. llvm-svn: 199947
* Remove unused include following r199929Alp Toker2014-01-231-1/+0
| | | | llvm-svn: 199930
* Replace the interim lli build fix with something cleanerAlp Toker2014-01-235-45/+15
| | | | | | | | | | Eliminates the LLI_BUILDING_CHILD build hack from r199885. Also add a FIXME to remove code that tricks the tests into passing when the feature fails to work. Please don't do stuff like this, the tests exist for a reason! llvm-svn: 199929
* Add target analysis passes to the codegen pipeline for MCJIT.Juergen Ributzka2014-01-231-3/+0
| | | | | | | | | | | This patch adds the target analysis passes (usually TargetTransformInfo) to the codgen pipeline. We also expose now the AddAnalysisPasses method through the C API, because the optimizer passes would also benefit from better target-specific cost models. Reviewed by Andrew Kaylor llvm-svn: 199926
* Windows/ChildTarget.inc: LLIChildTarget::allocate() has gone since r199881.NAKAMURA Takumi2014-01-231-4/+0
| | | | llvm-svn: 199889
* Interim build fix for MakefilesAlp Toker2014-01-233-2/+8
| | | | | | Looks like some parts still need detangling. Let's see if this holds for now. llvm-svn: 199885
* Prospective Makefile build fixAlp Toker2014-01-231-0/+2
| | | | llvm-svn: 199882
* Refactor lli-child-target to remove duplicated codeAlp Toker2014-01-236-174/+32
| | | | | | | | | | | | | | Eliminate the copies LLVM's System mmap and cache invalidation code. These were slowly drifting away from the original version, and moreover the copied code was a dead end in terms of portability. We now statically link to Support but in practice with stripping this adds next to no weight to the resultant binary. Also avoid installing lli-child-target to the user's $PATH. It's not meant to be run directly. llvm-svn: 199881
* Tweak r199835 to use can_execute() instead of exists()Alp Toker2014-01-221-2/+3
| | | | | | | The execution code path crashes if it can't execute the binary so we might as well take precautions here. llvm-svn: 199844
* Eliminate inappropriate use of FindProgramByName() from lliAlp Toker2014-01-221-11/+9
| | | | llvm-svn: 199835
* Don't open or fstat files twice in llvm-ar.Rafael Espindola2014-01-221-16/+46
| | | | | | We still read/mmap them twice, but the fix for that is a bit more complex. llvm-svn: 199815
* Pass the computed magic to createBinary and createObjectFile if available.Rafael Espindola2014-01-221-3/+3
| | | | | | | identify_magic is not free, so we should avoid calling it twice. The argument also makes it cheap for createBinary to just forward to createObjectFile. llvm-svn: 199813
* Whitespace.NAKAMURA Takumi2014-01-221-1/+1
| | | | llvm-svn: 199785
* Change createObjectFile to return an ErrorOr.Rafael Espindola2014-01-223-7/+12
| | | | llvm-svn: 199776
* Be a bit more consistent about using ErrorOr when constructing Binary objects.Rafael Espindola2014-01-211-3/+3
| | | | | | | | | | | | | | | | | | | | | | | The constructors of classes deriving from Binary normally take an error_code as an argument to the constructor. My original intent was to change them to have a trivial constructor and move the initial parsing logic to a static method returning an ErrorOr. I changed my mind because: * A constructor with an error_code out parameter is extremely convenient from the implementation side. We can incrementally construct the object and give up when we find an error. * It is very efficient when constructing on the stack or when there is no error. The only inefficient case is where heap allocating and an error is found (we have to free the memory). The result is that this is a much smaller patch. It just standardizes the create* helpers to return an ErrorOr. Almost no functionality change: The only difference is that this found that we were trying to read past the end of COFF import library but ignoring the error. llvm-svn: 199770
* Adding new LTO APIs to parse metadata nodes and extract linker options andYunzhong Gao2014-01-212-0/+26
| | | | | | | | dependent libraries from a bitcode module. Differential Revision: http://llvm-reviews.chandlerc.com/D2343 llvm-svn: 199759
* Rename these methods to match the style guide.Rafael Espindola2014-01-215-14/+14
| | | | llvm-svn: 199751
* tools: use 64-bit print specifierSaleem Abdulrasool2014-01-211-1/+1
| | | | | | | Try to repair the ARM Cortex-A15 buildbot by using a more appropriate conversion specifier. llvm-svn: 199711
* tools: support decoding ARM EHABI opcodes in readobjSaleem Abdulrasool2014-01-211-2/+288
| | | | | | | | | | | | | | Add support to llvm-readobj to decode the actual opcodes. The ARM EHABI opcodes are a variable length instruction set that describe the operations required for properly unwinding stack frames. The primary motivation for this change is to ease the creation of tests for the ARM EHABI object emission as well as the unwinding directive handling in the ARM IAS. Thanks to Logan Chien for an extra test case! llvm-svn: 199708
* Whitespace.NAKAMURA Takumi2014-01-201-3/+3
| | | | llvm-svn: 199667
* [PM] Wire up the Verifier for the new pass manager and connect it to theChandler Carruth2014-01-205-15/+47
| | | | | | | | | | | | | | | | | | | | | | various opt verifier commandline options. Mostly mechanical wiring of the verifier to the new pass manager. Exercises one of the more unusual aspects of it -- a pass can be either a module or function pass interchangably. If this is ever problematic, we can make things more constrained, but for things like the verifier where there is an "obvious" applicability at both levels, it seems convenient. This is the next-to-last piece of basic functionality left to make the opt commandline driving of the new pass manager minimally functional for testing and further development. There is still a lot to be done there (notably the factoring into .def files to kill the current boilerplate code) but it is relatively uninteresting. The only interesting bit left for minimal functionality is supporting the registration of analyses. I'm planning on doing that on top of the .def file switch mostly because the boilerplate for the analyses would be significantly worse. llvm-svn: 199646
* [PM] Make the verifier work independently of any pass manager.Chandler Carruth2014-01-191-3/+4
| | | | | | | | | | | | | | | | | | | | | | | This makes the 'verifyFunction' and 'verifyModule' functions totally independent operations on the LLVM IR. It also cleans up their API a bit by lifting the abort behavior into their clients and just using an optional raw_ostream parameter to control printing. The implementation of the verifier is now just an InstVisitor with no multiple inheritance. It also is significantly more const-correct, and hides the const violations internally. The two layers that force us to break const correctness are building a DomTree and dispatching through the InstVisitor. A new VerifierPass is used to implement the legacy pass manager interface in terms of the other pieces. The error messages produced may be slightly different now, and we may have slightly different short circuiting behavior with different usage models of the verifier, but generally everything works equivalently and this unblocks wiring the verifier up to the new pass manager. llvm-svn: 199569
* llvm-objdump/COFF: Print ordinal base number.Rui Ueyama2014-01-171-0/+4
| | | | llvm-svn: 199518
* [opt][PassInfo] Allow opt to run passes that need target machine.Quentin Colombet2014-01-161-1/+3
| | | | | | | | | | | | | | | | | | When registering a pass, a pass can now specify a second construct that takes as argument a pointer to TargetMachine. The PassInfo class has been updated to reflect that possibility. If such a constructor exists opt will use it instead of the default constructor when instantiating the pass. Since such IR passes are supposed to be rare, no specific support has been added to this commit to allow an easy registration of such a pass. In other words, for such pass, the initialization function has to be hand-written (see CodeGenPrepare for instance). Now, codegenprepare can be tested using opt: opt -codegenprepare -mtriple=mytriple input.ll llvm-svn: 199430
* Fix style issues.Rui Ueyama2014-01-161-24/+30
| | | | llvm-svn: 199423
* llvm-objdump/COFF: Print DLL name in the export table header.Rui Ueyama2014-01-161-1/+5
| | | | llvm-svn: 199422
* llvm-symbolizer: make mangled name heuristic apply to all symbolsEd Maste2014-01-162-8/+5
| | | | | | PR: http://llvm.org/pr18431 Review: http://llvm-reviews.chandlerc.com/D2552 llvm-svn: 199404
* Revert r199361: Now, the sanitizer got the changeQuentin Colombet2014-01-161-1/+0
| | | | llvm-svn: 199362
* [LTO] Modify lto.exports to force the sanitizer to rebuilt LTO.exportsQuentin Colombet2014-01-161-0/+1
| | | | llvm-svn: 199361
OpenPOWER on IntegriCloud