summaryrefslogtreecommitdiff
path: root/tools
Commit message (Collapse)AuthorAge
...
* Remove the UseCFI option from createAsmStreamer.Rafael Espindola2014-05-07
| | | | | | We were already always passing true, this just removes the option. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208205 91177308-0d34-0410-b5e6-96231b3b80d8
* [obj2yaml] Recognize input file format using llvm::object::ObjectFileSimon Atanasyan2014-05-07
| | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208157 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Implement --no-outputJustin Bogner2014-05-07
| | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208148 91177308-0d34-0410-b5e6-96231b3b80d8
* Have the SubtargetFeature help routine just not return a number andEric Christopher2014-05-06
| | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208102 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the -disable-cfi option.Rafael Espindola2014-05-05
| | | | | | | This also add a release note about it. If this stays I will cleanup MC next week. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207977 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix gcc -pedantic warning in lto.cpp.Patrik Hagglund2014-05-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207959 91177308-0d34-0410-b5e6-96231b3b80d8
* Move LTOModule and LTOCodeGenerator to the llvm namespace.Rafael Espindola2014-05-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207911 91177308-0d34-0410-b5e6-96231b3b80d8
* Style update: don't duplicate comments, they were getting out of sync.Rafael Espindola2014-05-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207909 91177308-0d34-0410-b5e6-96231b3b80d8
* [llvm-readobj] Transform 'switch' with the only 'case' statementSimon Atanasyan2014-05-01
| | | | | | | | to 'if' statement. No functional changes, git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207748 91177308-0d34-0410-b5e6-96231b3b80d8
* [llvm-readobj] Add support for Mips specific ELF header e_flags.Simon Atanasyan2014-05-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207744 91177308-0d34-0410-b5e6-96231b3b80d8
* Record the DWARF version in MCContextOliver Stannard2014-05-01
| | | | | | | | | Record the DWARF version in MCContext, and use it when emitting the dwarf version into the debug info. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207739 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the new StringTableBuilder in yaml2elfHans Wennborg2014-04-30
| | | | | | http://reviews.llvm.org/D3574 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207694 91177308-0d34-0410-b5e6-96231b3b80d8
* ELFObjectWriter: deduplicate suffices in strtabHans Wennborg2014-04-30
| | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207670 91177308-0d34-0410-b5e6-96231b3b80d8
* raw_ostream: Forward declare OpenFlags and include FileSystem.h only where ↵Benjamin Kramer2014-04-29
| | | | | | necessary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207593 91177308-0d34-0410-b5e6-96231b3b80d8
* PR19553: Memory leak in RuntimeDyldELF::createObjectImageFromFileDavid Blaikie2014-04-29
| | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207580 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++] Use 'nullptr'.Craig Topper2014-04-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207394 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an -mattr option to the gold plugin to support subtarget features in LTOTom Roeder2014-04-25
| | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207279 91177308-0d34-0410-b5e6-96231b3b80d8
* BugPoint: Fix some memory leaks.David Blaikie2014-04-25
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207265 91177308-0d34-0410-b5e6-96231b3b80d8
* SCC: Change clients to use const, NFCDuncan P. N. Exon Smith2014-04-25
| | | | | | | | | | 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> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207252 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++] Use 'nullptr'. Tools edition.Craig Topper2014-04-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207176 91177308-0d34-0410-b5e6-96231b3b80d8
* ProfileData: Treat missing function counts as malformedJustin Bogner2014-04-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207172 91177308-0d34-0410-b5e6-96231b3b80d8
* Change llvm-config --ldflags to report ${CMAKE_CXX_LINK_FLAGS}Reid Kleckner2014-04-25
| | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207171 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Add support for gcov's --long-file-names optionJustin Bogner2014-04-23
| | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207035 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Allow short options to be groupedJustin Bogner2014-04-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207034 91177308-0d34-0410-b5e6-96231b3b80d8
* Create MCTargetOptions.Evgeniy Stepanov2014-04-23
| | | | | | | | | | For now it contains a single flag, SanitizeAddress, which enables AddressSanitizer instrumentation of inline assembly. Patch by Yuri Gorshenin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206971 91177308-0d34-0410-b5e6-96231b3b80d8
* Use unique_ptr to manage ParsedBinariesAndObjects in LLVMSymbolizerDavid Blaikie2014-04-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206866 91177308-0d34-0410-b5e6-96231b3b80d8
* [Modules] Fix potential ODR violations by sinking the DEBUG_TYPEChandler Carruth2014-04-22
| | | | | | definition below all of the header #include lines, tools edition. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206848 91177308-0d34-0410-b5e6-96231b3b80d8
* [Modules] Make Support/Debug.h modular. This requires it to not changeChandler Carruth2014-04-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206822 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert getFileOffset to getOffset and move it to its only user.Rafael Espindola2014-04-21
| | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206750 91177308-0d34-0410-b5e6-96231b3b80d8
* [PM] Add a new-PM-style CGSCC pass manager using the newly addedChandler Carruth2014-04-21
| | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206745 91177308-0d34-0410-b5e6-96231b3b80d8
* [PM] Wire the analysis passes (such as they are) into the registry, andChandler Carruth2014-04-21
| | | | | | teach the opt driver to use it rather than a manual list. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206739 91177308-0d34-0410-b5e6-96231b3b80d8
* [PM] Add a nice low-tech registry of passes as a boring macro expansionChandler Carruth2014-04-21
| | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206737 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Range-based loop simplification.Simon Atanasyan2014-04-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206715 91177308-0d34-0410-b5e6-96231b3b80d8
* ProfileData: Add support for the indexed instrprof formatJustin Bogner2014-04-18
| | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206656 91177308-0d34-0410-b5e6-96231b3b80d8
* [DWARF parser] Turn DILineInfo into a struct.Alexey Samsonov2014-04-18
| | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206654 91177308-0d34-0410-b5e6-96231b3b80d8
* Atomics: promote ARM's IR-based atomics pass to CodeGen.Tim Northover2014-04-17
| | | | | | | | | | | | 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). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206485 91177308-0d34-0410-b5e6-96231b3b80d8
* objdump: identify WoA WinCOFF/ARM correctlySaleem Abdulrasool2014-04-17
| | | | | | | | | | | | Since LLVM currently only supports WinCOFF, assume that the input is WinCOFF rather than another type of COFF file (ECOFF/XCOFF). If the architecture is detected as thumb (e.g. the file has a IMAGE_FILE_MACHINE_ARMNT magic) then use a triple of thumbv7-windows. This allows for objdump to properly handle WoA object files without having to specify the target triple manually. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206446 91177308-0d34-0410-b5e6-96231b3b80d8
* tools: fix invalid printing, buffer overrun in llvm-readobjSaleem Abdulrasool2014-04-16
| | | | | | All auxiliary records are consumed when accessing a File record. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206354 91177308-0d34-0410-b5e6-96231b3b80d8
* verify-di: Implement DebugInfoVerifierDuncan P. N. Exon Smith2014-04-15
| | | | | | | | | | | | | | | | | | | | | Implement DebugInfoVerifier, which steals verification relying on DebugInfoFinder from Verifier. - Adds LegacyDebugInfoVerifierPassPass, a ModulePass which wraps DebugInfoVerifier. Uses -verify-di command-line flag. - Change verifyModule() to invoke DebugInfoVerifier as well as Verifier. - Add a call to createDebugInfoVerifierPass() wherever there was a call to createVerifierPass(). This implementation as a module pass should sidestep efficiency issues, allowing us to turn debug info verification back on. <rdar://problem/15500563> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206300 91177308-0d34-0410-b5e6-96231b3b80d8
* [MC] Require an MCContext when constructing an MCDisassembler.Lang Hames2014-04-15
| | | | | | | | | | | | | | | | | | This patch re-introduces the MCContext member that was removed from MCDisassembler in r206063, and requires that an MCContext be passed in at MCDisassembler construction time. (Previously the MCContext member had been initialized in an ad-hoc fashion after construction). The MCCContext member can be used by MCDisassembler sub-classes to construct constant or target-specific MCExprs. This patch updates disassemblers for in-tree targets, and provides the MCRegisterInfo instance that some disassemblers were using through the MCContext (previously those backends were constructing their own MCRegisterInfo instances). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206241 91177308-0d34-0410-b5e6-96231b3b80d8
* tools: fix heap-buffer-overrun detected via ASANSaleem Abdulrasool2014-04-14
| | | | | | | | | | Once the auxiliary fields relating to the filename have been inspected, any following auxiliary fields need not be visited as they have been consumed (the following fields comprise the filepath as a single unit). Adjust the test to catch this even if ASAN is not enabled. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206190 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach llvm-lto to respect the given RelocModel.James Molloy2014-04-14
| | | | | | | | Patch by Nick Tomlinson! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206177 91177308-0d34-0410-b5e6-96231b3b80d8
* tools: simplify symbol handling in objdumpSaleem Abdulrasool2014-04-14
| | | | | | | | | Rather than switching behaviour on whether a previous symbol has an auxiliary symbol record for the next count of elements, simply iterate over the auxiliary symbols right after processing the current symbol entry. This makes the behaviour much simpler to follow and similar to llvm-readobj and yaml2obj. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206146 91177308-0d34-0410-b5e6-96231b3b80d8
* tools: address possible non-null terminated filenamesSaleem Abdulrasool2014-04-14
| | | | | | | | | If a filename is a multiple of 18 characters, there will be no null-terminator. This will result in an invalid access by the constructed StringRef. Add a test case to exercise this and fix that handling. Address this same vulnerability in llvm-readobj as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206145 91177308-0d34-0410-b5e6-96231b3b80d8
* tools: remove duplication of coff_aux_fileSaleem Abdulrasool2014-04-13
| | | | | | | Now that COFF::coff_aux_file is defined, use that rather than redefining the type locally. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206140 91177308-0d34-0410-b5e6-96231b3b80d8
* tools: avoid a string duplicationSaleem Abdulrasool2014-04-13
| | | | | | | | | The auxiliary file records are contiguous and only contain the filename. Construct a StringRef directly rather than copying to a temporary buffer. Suggested by majnemer on IRC! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206139 91177308-0d34-0410-b5e6-96231b3b80d8
* tools: teach objdump about FILE aux recordsSaleem Abdulrasool2014-04-13
| | | | | | | | | Add support for file auxiliary symbol entries in COFF symbol tables. A COFF symbol table with a FILE entry is followed by sizeof(__FILE__) / 18 auxiliary symbol records which contain the filename. Read them and form the original filename that the record contains. Then display the name in the output. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206126 91177308-0d34-0410-b5e6-96231b3b80d8
* tools: remove unnecessary copy of array_lengthofSaleem Abdulrasool2014-04-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206115 91177308-0d34-0410-b5e6-96231b3b80d8
* llc: Add support for -mcpu=native.Jim Grosbach2014-04-12
| | | | | | | When -mcpu=native is passed, autodetect the host CPU and pass that as the CPU name to the TargetMachine factory method. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206095 91177308-0d34-0410-b5e6-96231b3b80d8
* [yaml2obj][ELF] ELF Relocations Support.Simon Atanasyan2014-04-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch implements support for both relocation record formats: Elf_Rel and Elf_Rela. It is possible to define relocation against symbol only. Relocations against sections will be implemented later. Now yaml2obj recognizes X86_64, MIPS and Hexagon relocation types. Example of relocation section specification: Sections: - Name: .text Type: SHT_PROGBITS Content: "0000000000000000" AddressAlign: 16 Flags: [SHF_ALLOC] - Name: .rel.text Type: SHT_REL Info: .text AddressAlign: 4 Relocations: - Offset: 0x1 Symbol: glob1 Type: R_MIPS_32 - Offset: 0x2 Symbol: glob2 Type: R_MIPS_CALL16 The patch reviewed by Michael Spencer, Sean Silva, Shankar Easwaran. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206017 91177308-0d34-0410-b5e6-96231b3b80d8