summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
* Replace string GNU Triples with llvm::Triple in InitMCObjectFileInfo. NFC.Daniel Sanders2015-06-152-3/+5
| | | | | | | | | | | | | | | | | | | | | Summary: This affects other tools so the previous C++ API has been retained as a deprecated function for the moment. Clang has been updated with a trivial patch (not covered by the pre-commit review) to avoid breaking -Werror builds. Other in-tree tools will be fixed with similar trivial patches. This continues the patch series to eliminate StringRef forms of GNU triples from the internals of LLVM that began in r239036. Reviewers: rengolin Reviewed By: rengolin Subscribers: llvm-commits, rengolin Differential Revision: http://reviews.llvm.org/D10366 llvm-svn: 239721
* [Orc] Tidy up initialization based on review feedback for r239561 from dblaikie.Lang Hames2015-06-121-20/+19
| | | | | | NFC. llvm-svn: 239645
* [Orc] Fix a bug in the CompileOnDemand layer where stub decls were not clonedLang Hames2015-06-121-1/+1
| | | | | | | | | | | into partitions. Also, add an option to clone stub definitions (not just decls) into partitions: these definitions could be inlined in some places to avoid the overhead of calling via the stub. Found by inspection - no test case yet, although I plan to add a unit test for this once the CompileOnDemand layer refactoring settles down. llvm-svn: 239640
* Wrap some long lines in LLVMBuild files. NFCDouglas Katzman2015-06-125-8/+71
| | | | | | | As suggested by jroelofs in a prior review (D9752), it makes sense to generally prefer multi-line format. llvm-svn: 239632
* Have the ELF symbol predicates match more directly the spec.Rafael Espindola2015-06-121-2/+2
| | | | | | | | | | | | | | | | The underlaying issues is that this code can't really know if an OS specific or processor specific section number should return true or false. One option would be to assert or return an error, but that looks like over engineering since extensions are not that common. It seems better to have these be direct implementation of the ELF spec so that they are natural for someone familiar with ELF reading the code. Code that does have to handle OS/Architecture specific values can do it at a higher level. llvm-svn: 239618
* [Orc] Remove some unnecesary includes and whitespace that slipped in to r239561.Lang Hames2015-06-111-2/+1
| | | | | | NFC. llvm-svn: 239564
* [Orc] Make partition identification in the CompileOnDemand layer lazy.Lang Hames2015-06-111-16/+20
| | | | | | This also breaks out the logical dylib symbol resolution logic. llvm-svn: 239561
* LibDriver, llvm-lib: introduce.Peter Collingbourne2015-06-094-7/+31
| | | | | | | | | | llvm-lib is intended to be a lib.exe compatible utility that also understands bitcode. The implementation lives in a library so that lld can use it to implement /lib. Differential Revision: http://reviews.llvm.org/D10297 llvm-svn: 239434
* Remove object_error::success and use std::error_code() insteadRui Ueyama2015-06-096-12/+12
| | | | | | | | | | | | make_error_code(object_error) is slow because object::object_category() uses a ManagedStatic variable. But the real problem is that the function is called too frequently. This patch uses std::error_code() instead of object_error::success. In most cases, we return "success", so this patch reduces number of function calls to that function. http://reviews.llvm.org/D10333 llvm-svn: 239409
* [lli] Make the OptLevel (-O=<char>) option accessible to the lazy JIT.Lang Hames2015-06-092-13/+20
| | | | | | No test case - this only affects generated code performance. llvm-svn: 239383
* [llvm-readobj] Use the new symbol API.Davide Italiano2015-06-081-7/+7
| | | | llvm-svn: 239286
* Do not build LLD from tools/Makefile, as LLD no longer has a Makefile build.Peter Collingbourne2015-06-081-2/+1
| | | | llvm-svn: 239283
* llvm-ar: Move archive writer to Object.Peter Collingbourne2015-06-081-326/+6
| | | | | | | | | No functional change intended, other than some minor changes to certain diagnostics. Differential Revision: http://reviews.llvm.org/D10296 llvm-svn: 239278
* [objdump] Moving PrintImmHex out of MachODump and in to llvm-objdump and ↵Colin LeMahieu2015-06-073-4/+6
| | | | | | setting instprinter appropriately. llvm-svn: 239265
* Teaching llvm-mc how to understand the defsym command line option. This ↵Colin LeMahieu2015-06-071-0/+26
| | | | | | allows integer-constant symbols to be defined on the command line and used during assembly. llvm-svn: 239240
* [dsymutil] Add support for linking the debug_frame section.Frederic Riss2015-06-051-1/+137
| | | | | | | | | | | Linking the debug frame section is actually very easy as we just have to patch the start address in the FDE header and then copy the rest of the FDE without even looking at it. The only small complexity comes from the handling of the CIEs that we should unique across object file. This is also really easy by using a StringMap keyed on the raw contents of the CIE. llvm-svn: 239198
* [dsymutil] Rename a variable to appease some bots.Frederic Riss2015-06-051-3/+3
| | | | | | | Anyway having the type and the name of the member being the same thing wasn't the wisest of the choices. llvm-svn: 239190
* [dsymutil] Have the YAML deserialization rewrite the object address of symbols.Frederic Riss2015-06-051-6/+46
| | | | | | | | | | | The main use of the YAML debug map format is for testing inside LLVM. If we have IR files in the tests used to generate object files, then we obviously don't know the addresses of the symbols inside the object files beforehand. This change lets the YAML import lookup the addresses in the object files and rewrite them. This will allow to have test that really don't need any binary input. llvm-svn: 239189
* [dsymutil] Apply clang-format. NFCFrederic Riss2015-06-055-19/+20
| | | | llvm-svn: 239186
* [dsymutil] Out-line the YAML serialization code. NFCFrederic Riss2015-06-053-95/+130
| | | | | | | | | | | It will get a bit bigger in an upcoming commit. No need to have all of that in the header. Also move parseYAMLDebugMap() to the same place as the serialization code. This way it will be able to share a private Context object with it. llvm-svn: 239185
* [dsymutil] Handle the -oso-prepend-path option when the input is a YAML ↵Frederic Riss2015-06-052-5/+10
| | | | | | | | debug map All the tests using a YAML debug map will need this. llvm-svn: 239163
* llvm-objdump: return non-zero exit code for certain cases of invalid inputAlexey Samsonov2015-06-041-7/+12
| | | | | | | | * If the input file is missing; * If the type of input object file can't be recognized; * If the object file can't be parsed correctly. llvm-svn: 239065
* Disassemble the start of sections even if there is no symbol there.Rafael Espindola2015-06-041-5/+3
| | | | | | | We already handled a section with no symbols, extend that to also handle a section with symbols that don't include the section start. llvm-svn: 239039
* [Object, MachO] Introduce MachOObjectFile::load_commands() range iterator.Alexey Samsonov2015-06-033-91/+25
| | | | | | | | | | | | | | | | | | Summary: Now users don't have to manually deal with getFirstLoadCommandInfo() / getNextLoadCommandInfo(), calculate the number of load segments, etc. No functionality change. Test Plan: regression test suite Reviewers: rafael, lhames, loladiro Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10144 llvm-svn: 238983
* Reapply r238941 - [dsymutil] Accept a YAML debug map as input instead of a ↵Frederic Riss2015-06-034-25/+75
| | | | | | | | | | | | | | | | | | | | | binary. With a couple more constructors that GCC thinks are necessary. Original commit message: [dsymutil] Accept a YAML debug map as input instead of a binary. To do this, the user needs to pass the new -y flag. As it wasn't tested before, the debug map YAML deserialization was completely buggy (mainly because the DebugMapObject has a dual mapping that allows to search by name and by address, but only the StringMap got populated). It's fixed and tested in this commit by augmenting some test with a 2 stage dwarf link: a frist llvm-dsymutil reads the debug map and pipes it in a second instance that does the actual link without touching the initial binary. llvm-svn: 238959
* add missing dependency on Target lib for toolsSanjay Patel2015-06-035-0/+5
| | | | | | | This was exposed by r238842 (which was reverted by r238900) when doing a CMake build with -DBUILD_SHARED_LIBS=ON. llvm-svn: 238953
* RuntimeDyld: override EH frame registration with trivial version.Tim Northover2015-06-031-0/+5
| | | | | | | | | llvm-rtdyld was relying on the default memory manager's EH frame registration, which is host-dependent rather than target-dependent. As a result, big-endian ELF Mips EH frames were being registered on OS X (and elsewhere). This is a really bad idea. llvm-svn: 238951
* Revert "[dsymutil] Accept a YAML debug map as input instead of a binary."Frederic Riss2015-06-034-63/+25
| | | | | | This reverts commit r238941 while I figure out the bot issues. llvm-svn: 238943
* [dsymutil] Accept a YAML debug map as input instead of a binary.Frederic Riss2015-06-034-25/+63
| | | | | | | | | | | | | To do this, the user needs to pass the new -y flag. As it wasn't tested before, the debug map YAML deserialization was completely buggy (mainly because the DebugMapObject has a dual mapping that allows to search by name and by address, but only the StringMap got populated). It's fixed and tested in this commit by augmenting some test with a 2 stage dwarf link: a frist llvm-dsymutil reads the debug map and pipes it in a second instance that does the actual link without touching the initial binary. llvm-svn: 238941
* [dsymutil] Replace -parse-only option with -dump-debug-mapFrederic Riss2015-06-031-6/+7
| | | | | | | | | | As the serialized debug map is becoming a first class citizen, a way to cleanly dump it is required. We used -parse-only combined with -v for that purpose before, but it dumps a lot of unrelated debug stuff. Dumping the debug map was the only use of the -parse-only flag anyway, so replace it with a more useful option. llvm-svn: 238940
* [dsymutil] Reflow option declarations to be more readable.Frederic Riss2015-06-031-12/+13
| | | | llvm-svn: 238939
* Fix the interpretation of a 0 st_name.Rafael Espindola2015-06-032-20/+37
| | | | | | | | | | | | | | The ELF spec is very clear: ----------------------------------------------------------------------------- If the value is non-zero, it represents a string table index that gives the symbol name. Otherwise, the symbol table entry has no name. -------------------------------------------------------------------------- In particular, a st_name of 0 most certainly doesn't mean that the symbol has the same name as the section. llvm-svn: 238899
* Move to llvm-objdump a large amount of code to that is only used there.Rafael Espindola2015-06-031-3/+382
| | | | llvm-svn: 238898
* llvm-cov: Make llvm-cov --version DTRTJustin Bogner2015-06-031-0/+8
| | | | | | | | In r233132 we started requiring a subcommand in llvm-cov, but this made `llvm-cov --version` invalid, which is kind of silly. Print version information in this case, as most people would expect. llvm-svn: 238897
* Simplify now that we always use an alignment of 2 for ELF files.Rafael Espindola2015-06-022-9/+7
| | | | | | This saves 123144 bytes out of llvm-nm on powerpc64le. llvm-svn: 238824
* [dsymutil] Remove extraneous std::move of local in return statement.Frederic Riss2015-06-011-1/+1
| | | | llvm-svn: 238790
* [dsymutil] Remove unnecessary ';'Frederic Riss2015-06-011-1/+1
| | | | llvm-svn: 238783
* [dsymutil] Use YAMLIO to dump debug map.Frederic Riss2015-06-013-15/+124
| | | | | | | | | | | Doing so will allow us to also accept a YAML debug map in input as using YAMLIO gives us the parsing for free. Being able to have textual debug maps will in turn allow much more control over the tests, because 1/ no need to check-in a binary containing the debug map and 2/ it will allow to use the same objects/IR files with made-up debug-maps to test different scenari. llvm-svn: 238781
* Make the C++ LTO API easier to use from C++ clients.Peter Collingbourne2015-06-012-15/+36
| | | | | | | | | | | Start using C++ types such as StringRef and MemoryBuffer in the C++ LTO API. In doing so, clarify the ownership of the native object file: the caller now owns it, not the LTOCodeGenerator. The C libLTO library has been modified to use a derived class of LTOCodeGenerator that owns the object file. Differential Revision: http://reviews.llvm.org/D10114 llvm-svn: 238776
* Simplify another function that doesn't fail.Rafael Espindola2015-06-015-12/+11
| | | | llvm-svn: 238703
* Simplify interface of function that doesn't fail.Rafael Espindola2015-05-311-3/+1
| | | | llvm-svn: 238700
* For COFF and MachO, compute the gap between to symbols.Rafael Espindola2015-05-311-3/+45
| | | | | | Before r238028 we used to do this in O(N^2), now we do it in O(N log N). llvm-svn: 238698
* Use a range loop. NFC.Rafael Espindola2015-05-311-8/+10
| | | | llvm-svn: 238693
* Add RelocVisitor support for MachOKeno Fischer2015-05-301-2/+7
| | | | | | | | | | | | This commit adds partial support for MachO relocations to RelocVisitor. A simple test case is added to show that relocations are indeed being applied and that using llvm-dwarfdump on MachO files no longer errors. Correctness is not yet tested, due to an unrelated bug in DebugInfo, which will be fixed with appropriate testcase in a followup commit. Differential Revision: http://reviews.llvm.org/D8148 llvm-svn: 238663
* Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial typesBenjamin Kramer2015-05-295-15/+8
| | | | | | | | | | | | | | | | | | | | If the type isn't trivially moveable emplace can skip a potentially expensive move. It also saves a couple of characters. Call sites were found with the ASTMatcher + some semi-automated cleanup. memberCallExpr( argumentCountIs(1), callee(methodDecl(hasName("push_back"))), on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))), hasArgument(0, bindTemporaryExpr( hasType(recordDecl(hasNonTrivialDestructor())), has(constructExpr()))), unless(isInTemplateInstantiation())) No functional change intended. llvm-svn: 238602
* [Objdump] Removing unused parameter.Colin LeMahieu2015-05-291-2/+2
| | | | llvm-svn: 238557
* [Hexagon] Disassembling, printing, and emitting instructions a whole-bundle ↵Colin LeMahieu2015-05-291-3/+61
| | | | | | at a time which is the semantic unit for Hexagon. Fixing tests to use the new format. Disabling tests in the direct object emission path for a followup patch. llvm-svn: 238556
* Removing a switch statement that only contains a default; NFC.Aaron Ballman2015-05-291-4/+1
| | | | llvm-svn: 238552
* [llvm] Adding vdtor to fix warning.Colin LeMahieu2015-05-281-0/+1
| | | | llvm-svn: 238494
* [Objdump] Allow instruction pretty printing to be specialized by the target ↵Colin LeMahieu2015-05-281-6/+28
| | | | | | | | triple. Differential Revision: http://reviews.llvm.org/D8427 llvm-svn: 238457
OpenPOWER on IntegriCloud