summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
* [yaml2obj][ELF] Add an optional `Size` field to the YAML section declaration.Simon Atanasyan2014-05-162-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now the only method to configure ELF section's content and size is to assign a hexadecimal string to the `Content` field. Unfortunately this way is completely useless when you need to declare a really large section. To solve this problem this patch adds one more optional field `Size` to the `RawContentSection` structure. When yaml2obj generates an ELF file it uses the following algorithm: 1. If both `Content` and `Size` fields are missed create an empty section. 2. If only `Content` field is missed take section length from the `Size` field and fill the section by zero. 3. If only `Size` field is missed create a section using data from the `Content` field. 4. If both `Content` and `Size` fields are provided validate that the `Size` value is not less than size of `Content` data. Than take section length from the `Size`, fill beginning of the section by `Content` and the rest by zero. Examples -------- * Create a section 0x10000 bytes long filled by zero Name: .data Type: SHT_PROGBITS Flags: [ SHF_ALLOC ] Size: 0x10000 * Create a section 0x10000 bytes long starting from 'CA' 'FE' 'BA' 'BE' Name: .data Type: SHT_PROGBITS Flags: [ SHF_ALLOC ] Content: CAFEBABE Size: 0x10000 The patch reviewed by Michael Spencer. llvm-svn: 208995
* [DWARF parser] Use enums instead of bitfields in DILineInfoSpecifier.Alexey Samsonov2014-05-152-15/+14
| | | | | | | | | | | | It is more appropriate than the current situation, when one flag (AbsoluteFilePath) is relevant only if another flag is set. This refactoring would also simplify fetching the short function name (stored in DW_AT_name) instead of a linkage name returned currently. No functionality change. llvm-svn: 208921
* [yaml2obj] Add "-o" command line option to specify an output file name.Simon Atanasyan2014-05-152-11/+31
| | | | llvm-svn: 208900
* Unify command line handling of MCTargetOptions and remove extraEric Christopher2014-05-152-18/+3
| | | | | | options and code. No functional change. llvm-svn: 208833
* Teach llvm-nm to know about fat archives (aka MachOUniversal filesKevin Enderby2014-05-141-0/+14
| | | | | | containing archives). First step as other tools will be updated next. llvm-svn: 208812
* [obj2yaml] Support ELF input format in the obj2yaml tool.Simon Atanasyan2014-05-144-1/+294
| | | | | | | | | | The ELF header e_flags field in the MIPS related test cases handled incorrectly. The obj2yaml prints too many flags. I will fix that in the next patches. The patch reviewed by Michael Spencer and Sean Silva. llvm-svn: 208752
* [tools][llvm-rtdyld] Add a '-dylib <file>' option to llvm-rtdyld to load sharedLang Hames2014-05-131-0/+25
| | | | | | | | | libraries before linking and executing the target objects. This allows programs that use external calls (e.g. to libc) to be run under llvm-rtdyld. llvm-svn: 208739
* autoconf: Fix soname for libLLVM-Major.Minor.so (2nd try)Tom Stellard2014-05-131-2/+2
| | | | | | | | | | | | | We were using libLLVM-Major.Minor.Patch.so for the soname, but we need the soname to stay consistent for all Major.Minor.* releases otherwise operating system distributors will need to rebuild all packages that link with LLVM every time there is a new point release. This patch also reverses the compatibility symlink, so libLLVM-Major.Minor.Patch.so is now a symlink that points to libLLVM-Major-Minor.so. llvm-svn: 208721
* Revert "autoconf: Fix soname for libLLVM-Major.Minor.so"Tom Stellard2014-05-131-2/+2
| | | | | | | | | This reverts commit r208708. I forgot to run make clean before testing this and it broke tools linking. llvm-svn: 208709
* autoconf: Fix soname for libLLVM-Major.Minor.soTom Stellard2014-05-131-2/+2
| | | | | | | | | | | | | We were using libLLVM-Major.Minor.Patch.so for the soname, but we need the soname to stay consistent for all Major.Minor.* releases otherwise operating system distributors will need to rebuild all packages that link with LLVM every time there is a new point release. This patch also reverses the compatibility symlink, so libLLVM-Major.Minor.Patch.so is now a symlink that points to libLLVM-Major-Minor.so. llvm-svn: 208708
* Suggested improvement by Rafael Espindola to use isa<> in a few placesKevin Enderby2014-05-121-6/+6
| | | | | | instead of dyn_cast<>. llvm-svn: 208628
* [llvm-readobj] Print values of FLAGS and MIPS_FLAGS dynamic table tagsSimon Atanasyan2014-05-111-1/+61
| | | | | | in a human readable form. llvm-svn: 208489
* Fix llvm-nm to print the full 64-bit address for symbols in 64-bit object files.Kevin Enderby2014-05-091-8/+36
| | | | | | | | | | | | | | The implementation might be better to have a method is64Bit() in the class SymbolicFile instead of having the static routine isSymbolList64Bit() in llvm-nm.cpp . But this is very much in the sprit of isObject() and getNMTypeChar() in llvm-nm.cpp that has a series of if else statements based on the specific class of the SymbolicFile. I can update this if folks would like. Also the tests were updated to be explicit about checking the address for 64-bits or 32-bits from object files. llvm-svn: 208463
* Use range loops.Rafael Espindola2014-05-081-13/+9
| | | | llvm-svn: 208353
* Remove the UseCFI option from createAsmStreamer.Rafael Espindola2014-05-071-3/+2
| | | | | | We were already always passing true, this just removes the option. llvm-svn: 208205
* [obj2yaml] Recognize input file format using llvm::object::ObjectFileSimon Atanasyan2014-05-076-25/+126
| | | | | | | | | | | interface methods isCOFF(). The '-coff' command line option has been removed. It was not used in any test cases. The patch reviewed by Michael Spencer. llvm-svn: 208157
* llvm-cov: Implement --no-outputJustin Bogner2014-05-071-1/+5
| | | | | | | | In gcov, there's a -n/--no-output option, which disables the writing of any .gcov files, so that it emits only the summary info on stdout. This implements the same behaviour in llvm-cov. llvm-svn: 208148
* Have the SubtargetFeature help routine just not return a number andEric Christopher2014-05-061-1/+8
| | | | | | | | fall back to the normal path without a cpu. While doing this fix llc to just exit when we don't have a module to process instead of asserting. llvm-svn: 208102
* Remove the -disable-cfi option.Rafael Espindola2014-05-051-3/+0
| | | | | | | This also add a release note about it. If this stays I will cleanup MC next week. llvm-svn: 207977
* Fix gcc -pedantic warning in lto.cpp.Patrik Hagglund2014-05-051-2/+2
| | | | llvm-svn: 207959
* Move LTOModule and LTOCodeGenerator to the llvm namespace.Rafael Espindola2014-05-031-39/+41
| | | | llvm-svn: 207911
* Style update: don't duplicate comments, they were getting out of sync.Rafael Espindola2014-05-031-73/+0
| | | | llvm-svn: 207909
* [llvm-readobj] Transform 'switch' with the only 'case' statementSimon Atanasyan2014-05-011-5/+2
| | | | | | | | to 'if' statement. No functional changes, llvm-svn: 207748
* [llvm-readobj] Add support for Mips specific ELF header e_flags.Simon Atanasyan2014-05-011-1/+29
| | | | llvm-svn: 207744
* Record the DWARF version in MCContextOliver Stannard2014-05-011-0/+9
| | | | | | | Record the DWARF version in MCContext, and use it when emitting the dwarf version into the debug info. llvm-svn: 207739
* Use the new StringTableBuilder in yaml2elfHans Wennborg2014-04-301-45/+27
| | | | | | http://reviews.llvm.org/D3574 llvm-svn: 207694
* ELFObjectWriter: deduplicate suffices in strtabHans Wennborg2014-04-301-4/+2
| | | | | | | | | | | | | | | We already do this for shstrtab, so might as well do it for strtab. This extracts the string table building code into a separate class. The idea is to use it for other object formats too. I mostly wanted to do this for the general principle, but it does save a little bit on object file size. I tried this on a clang bootstrap and saved 0.54% on the sum of object file sizes (1.14 MB out of 212 MB for a release build). Differential Revision: http://reviews.llvm.org/D3533 llvm-svn: 207670
* raw_ostream: Forward declare OpenFlags and include FileSystem.h only where ↵Benjamin Kramer2014-04-299-0/+9
| | | | | | necessary. llvm-svn: 207593
* PR19553: Memory leak in RuntimeDyldELF::createObjectImageFromFileDavid Blaikie2014-04-291-1/+1
| | | | | | | | | | | | | | | | This starts in MCJIT::getSymbolAddress where the unique_ptr<object::Binary> is release()d and (after a cast) passed to a single caller, MCJIT::addObjectFile. addObjectFile calls RuntimeDyld::loadObject. RuntimeDld::loadObject calls RuntimeDyldELF::createObjectFromFile And the pointer is never owned at this point. I say this point, because the alternative codepath, RuntimeDyldMachO::createObjectFile certainly does take ownership, so this seemed like a good hint that this was a/the right place to take ownership. llvm-svn: 207580
* [C++] Use 'nullptr'.Craig Topper2014-04-287-16/+18
| | | | llvm-svn: 207394
* Add an -mattr option to the gold plugin to support subtarget features in LTOTom Roeder2014-04-252-0/+32
| | | | | | | | | | This adds support for an -mattr option to the gold plugin and to llvm-lto. This allows the caller to specify details of the subtarget architecture, like +aes, or +ssse3 on x86. Note that this requires a change to the include/llvm-c/lto.h interface: it adds a function lto_codegen_set_attr and it increments the version of the interface. llvm-svn: 207279
* BugPoint: Fix some memory leaks.David Blaikie2014-04-251-0/+4
| | | | | | | | | Patch by Kostya Serebryany. unique_ptr would be nice, but it's a bit too much work for an area I'm not familiar with, nor invested in, unfortunately. llvm-svn: 207265
* SCC: Change clients to use const, NFCDuncan P. N. Exon Smith2014-04-251-1/+1
| | | | | | | | | | It's fishy to be changing the `std::vector<>` owned by the iterator, and no one actual does it, so I'm going to remove the ability in a subsequent commit. First, update the users. <rdar://problem/14292693> llvm-svn: 207252
* [C++] Use 'nullptr'. Tools edition.Craig Topper2014-04-2536-177/+179
| | | | llvm-svn: 207176
* ProfileData: Treat missing function counts as malformedJustin Bogner2014-04-251-0/+1
| | | | llvm-svn: 207172
* Change llvm-config --ldflags to report ${CMAKE_CXX_LINK_FLAGS}Reid Kleckner2014-04-251-1/+2
| | | | | | | | | | | | | Should fix PR19526. When Oscar added this code in the intial CMake build system port, he had a TODO saying that ${CMAKE_SHARED_LINKER_FLAGS} was probably wrong. I agree. I'm using ${CMAKE_CXX_LINK_FLAGS} to point LLVM at my custom installation of gcc 4.recent, so that seems more correct. With this change, I can build creduce against an installed clang, and it picks up the write flags from --ldflags. llvm-svn: 207171
* llvm-cov: Add support for gcov's --long-file-names optionJustin Bogner2014-04-231-2/+6
| | | | | | | | GCOV provides an option to prepend output file names with the source file name, to disambiguate between covered data that's included from multiple sources. Add a flag to llvm-cov that does the same. llvm-svn: 207035
* llvm-cov: Allow short options to be groupedJustin Bogner2014-04-231-6/+6
| | | | llvm-svn: 207034
* Create MCTargetOptions.Evgeniy Stepanov2014-04-231-2/+5
| | | | | | | | | For now it contains a single flag, SanitizeAddress, which enables AddressSanitizer instrumentation of inline assembly. Patch by Yuri Gorshenin. llvm-svn: 206971
* Use unique_ptr to manage ParsedBinariesAndObjects in LLVMSymbolizerDavid Blaikie2014-04-222-8/+8
| | | | llvm-svn: 206866
* [Modules] Fix potential ODR violations by sinking the DEBUG_TYPEChandler Carruth2014-04-223-3/+6
| | | | | | definition below all of the header #include lines, tools edition. llvm-svn: 206848
* [Modules] Make Support/Debug.h modular. This requires it to not changeChandler Carruth2014-04-213-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | behavior based on other files defining DEBUG_TYPE, which means it cannot define DEBUG_TYPE at all. This is actually better IMO as it forces folks to define relevant DEBUG_TYPEs for their files. However, it requires all files that currently use DEBUG(...) to define a DEBUG_TYPE if they don't already. I've updated all such files in LLVM and will do the same for other upstream projects. This still leaves one important change in how LLVM uses the DEBUG_TYPE macro going forward: we need to only define the macro *after* header files have been #include-ed. Previously, this wasn't possible because Debug.h required the macro to be pre-defined. This commit removes that. By defining DEBUG_TYPE after the includes two things are fixed: - Header files that need to provide a DEBUG_TYPE for some inline code can do so by defining the macro before their inline code and undef-ing it afterward so the macro does not escape. - We no longer have rampant ODR violations due to including headers with different DEBUG_TYPE definitions. This may be mostly an academic violation today, but with modules these types of violations are easy to check for and potentially very relevant. Where necessary to suppor headers with DEBUG_TYPE, I have moved the definitions below the includes in this commit. I plan to move the rest of the DEBUG_TYPE macros in LLVM in subsequent commits; this one is big enough. The comments in Debug.h, which were hilariously out of date already, have been updated to reflect the recommended practice going forward. llvm-svn: 206822
* Convert getFileOffset to getOffset and move it to its only user.Rafael Espindola2014-04-211-3/+2
| | | | | | | | | | | | | We normally don't drop functions from the C API's, but in this case I think we can: * The old implementation of getFileOffset was fairly broken * The introduction of LLVMGetSymbolFileOffset was itself a C api breaking change as it removed LLVMGetSymbolOffset. * It is an incredibly specialized use case. The only reason MCJIT needs it is because of its odd position of being a dynamic linker of .o files. llvm-svn: 206750
* [PM] Add a new-PM-style CGSCC pass manager using the newly addedChandler Carruth2014-04-213-0/+134
| | | | | | | | | | | | | | | | | | | | | | | LazyCallGraph analysis framework. Wire it up all the way through the opt driver and add some very basic testing that we can build pass pipelines including these components. Still a lot more to do in terms of testing that all of this works, but the basic pieces are here. There is a *lot* of boiler plate here. It's something I'm going to actively look at reducing, but I don't have any immediate ideas that don't end up making the code terribly complex in order to fold away the boilerplate. Until I figure out something to minimize the boilerplate, almost all of this is based on the code for the existing pass managers, copied and heavily adjusted to suit the needs of the CGSCC pass management layer. The actual CG management still has a bunch of FIXMEs in it. Notably, we don't do *any* updating of the CG as it is potentially invalidated. I wanted to get this in place to motivate the new analysis, and add update APIs to the analysis and the pass management layers in concert to make sure that the *right* APIs are present. llvm-svn: 206745
* [PM] Wire the analysis passes (such as they are) into the registry, andChandler Carruth2014-04-212-3/+18
| | | | | | teach the opt driver to use it rather than a manual list. llvm-svn: 206739
* [PM] Add a nice low-tech registry of passes as a boring macro expansionChandler Carruth2014-04-212-15/+50
| | | | | | | | file. This will make it easy to scale up the number of passes supported. Currently, it just supports the function and module transformation passes that were already supported in the opt tool explicitly. llvm-svn: 206737
* [C++11] Range-based loop simplification.Simon Atanasyan2014-04-201-16/+13
| | | | llvm-svn: 206715
* ProfileData: Add support for the indexed instrprof formatJustin Bogner2014-04-181-5/+4
| | | | | | | | This adds support for an indexed instrumentation based profiling format, which is just a small header and an on disk hash table. This format will be used by clang's -fprofile-instr-use= for PGO. llvm-svn: 206656
* [DWARF parser] Turn DILineInfo into a struct.Alexey Samsonov2014-04-184-22/+11
| | | | | | | | | | Immutable DILineInfo doesn't bring any benefits and complicates code. Also, use std::string instead of SmallString<16> for file and function names - their length can vary significantly. No functionality change. llvm-svn: 206654
* Atomics: promote ARM's IR-based atomics pass to CodeGen.Tim Northover2014-04-171-1/+2
| | | | | | | | | | | | Still only 32-bit ARM using it at this stage, but the promotion allows direct testing via opt and is a reasonably self-contained patch on the way to switching ARM64. At this point, other targets should be able to make use of it without too much difficulty if they want. (See ARM64 commit coming soon for an example). llvm-svn: 206485
OpenPOWER on IntegriCloud