summaryrefslogtreecommitdiff
path: root/tools
Commit message (Collapse)AuthorAge
* [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
* [yaml2obj][ELF] Rename class SectionNameToIdxMap => NameToIdxMap. It canSimon Atanasyan2014-04-06
| | | | | | | | be used for indexing not only section's names. No functional changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205687 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Fix a nomenclature error in llvm-nm."Rafael Espindola2014-04-03
| | | | | | | | | | | | | | | | This reverts commit r205479. It turns out that nm does use addresses, it is just that every reasonable relocatable ELF object has sections with address 0. I have no idea if those exist in reality, but it at least it shows that llvm-nm should use the name address. The added test was includes an unusual .o file with non 0 section addresses. I created it by hacking ELFObjectWriter.cpp. Really sorry for the churn. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205493 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a nomenclature error in llvm-nm.Rafael Espindola2014-04-02
| | | | | | | | | | | What llvm-nm prints depends on the file format. On ELF for example, if the file is relocatable, it prints offsets. If it is not, it prints addresses. Since it doesn't really need to care what it is that it is printing, use the generic term value. Fix or implement getSymbolValue to keep llvm-nm working. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205479 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Reapply "LTO: add API to set strategy for -internalize""Duncan P. N. Exon Smith2014-04-02
| | | | | | | | | | | This reverts commit r199244. Conflicts: include/llvm-c/lto.h include/llvm/LTO/LTOCodeGenerator.h lib/LTO/LTOCodeGenerator.cpp git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205471 91177308-0d34-0410-b5e6-96231b3b80d8
* [yaml2obj][ELF] Convert some static functions into class members toSimon Atanasyan2014-04-02
| | | | | | | | reduce number of arguments. No functional changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205434 91177308-0d34-0410-b5e6-96231b3b80d8
* [yaml2obj][ELF] Remove unused typedef.Simon Atanasyan2014-04-02
| | | | | | No functional changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205433 91177308-0d34-0410-b5e6-96231b3b80d8
* [yaml2obj][ELF] Move section index to the ELFState class.Simon Atanasyan2014-04-02
| | | | | | No functional changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205432 91177308-0d34-0410-b5e6-96231b3b80d8
* [yaml2obj][ELF] Remove relationship between ELFStateSimon Atanasyan2014-04-02
| | | | | | | | | and ContiguousBlobAccumulator classes. Pass ContiguousBlobAccumulator to the handleSymtabSectionHeader function directly. No functional changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205431 91177308-0d34-0410-b5e6-96231b3b80d8
* [yaml2obj] Add support for ELF e_flags.Daniel Sanders2014-03-31
| | | | | | | | | | | | | | | | Summary: The FileHeader mapping now accepts an optional Flags sequence that accepts the EF_<arch>_<flag> constants. When not given, Flags defaults to zero. Reviewers: atanasyan Reviewed By: atanasyan CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3213 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205173 91177308-0d34-0410-b5e6-96231b3b80d8
* Windows: canonicalise the default windows tripleSaleem Abdulrasool2014-03-29
| | | | | | | Canonicalise the default triple that is used on Windows. This should hopefully fix the MSVC buildbots. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205070 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing include (for r205050)David Blaikie2014-03-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205053 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: error when -compress-debug-sections is requested and zlib is not linkedDavid Blaikie2014-03-28
| | | | | | | | | | This is a bit of a stab in the dark, since I have zlib on my machine. Just going to bounce it off the bots & see if it sticks. Do we have some convention for negative REQUIRES: checks? Or do I just need to add a feature like I've done here? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205050 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Support for compressed debug info sectionsDavid Blaikie2014-03-27
| | | | | | | | | | | | | | | | | | | 1) When creating a .debug_* section and instead create a .zdebug_ section. 2) When creating a fragment in a .zdebug_* section, make it a compressed fragment. 3) When computing the size of a compressed section, compress the data and use the size of the compressed data. 4) Emit the compressed bytes. Also, check that only if a section has a compressed fragment, then that is the only fragment in the section. Assert-fail if the fragment's data is modified after it is compressed. Initial review on llvm-commits by Eric Christopher and Rafael Espindola. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204958 91177308-0d34-0410-b5e6-96231b3b80d8
* Update MCSymbolizer and its subclasses' constructors to reflect the fact thatLang Hames2014-03-27
| | | | | | | | they take ownership of the RelocationInfo they're constructed with. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204891 91177308-0d34-0410-b5e6-96231b3b80d8
* Create .symtab_shndxr only when needed.Rafael Espindola2014-03-25
| | | | | | | | | | | | | | | | | | | | | | | We need .symtab_shndxr if and only if a symbol references a section with an index >= 0xff00. The old code was trying to figure out if the section was needed ahead of time, making it a fairly dependent on the code actually writing the table. It was also somewhat conservative and would create the section in cases where it was not needed. If I remember correctly, the old structure was there so that the sections were created in the same order gas creates them. That was valuable when MC's support for ELF was new and we tested with elf-dump.py. This patch refactors the symbol table creation to another class and makes it obvious that .symtab_shndxr is really only created when we are about to output a reference to a section index >= 0xff00. While here, also improve the tests to use macros. One file is one section short of needing .symtab_shndxr, the second one has just the right number. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204769 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Support debug_loc under fissionDavid Blaikie2014-03-25
| | | | | | | | | | | | | | | | | | | | | | Implement debug_loc.dwo, as well as llvm-dwarfdump support for dumping this section. Outlined in the DWARF5 spec and http://gcc.gnu.org/wiki/DebugFission the debug_loc.dwo section has more variation than the standard debug_loc, allowing 3 different forms of entry (plus the end of list entry). GCC seems to, and Clang certainly, only use one form, so I've just implemented dumping support for that for now. It wasn't immediately obvious that there was a good refactoring to share the implementation of dumping support between debug_loc and debug_loc.dwo, so they're separate for now - ideas welcome or I may come back to it at some point. As per a comment in the code, we could choose different forms that may reduce the number of debug_addr entries we emit, but that will require further study. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204697 91177308-0d34-0410-b5e6-96231b3b80d8
* VS integration installer: set SUCCESS=1 if we find VS 2013Hans Wennborg2014-03-24
| | | | | | | | | | Previously we would print an error message on machines where the only VS version we find is 2013, even though we successfully install the integration files for it. Also, we shouldn't have two END labels. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204629 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach llvm-readobj to print human friendly description of reserved sections.Rafael Espindola2014-03-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204584 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-profdata: Check for bad data in the show commandJustin Bogner2014-03-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204573 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-profdata: Use Format.h instead of handrolling a formatterJustin Bogner2014-03-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204571 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-profdata doesn't require LLVMCore.NAKAMURA Takumi2014-03-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204552 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-profdata: Avoid F_Text in "merge" for now, since "llvm-profdata show" ↵NAKAMURA Takumi2014-03-22
| | | | | | | | is confused with CRLF. FIXME: line_iterator should be tolerant of CR. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204540 91177308-0d34-0410-b5e6-96231b3b80d8
* ProfileData: Introduce InstrProfWriter using the naive text formatJustin Bogner2014-03-21
| | | | | | | | | | | This isn't a format we'll want to write out in practice, but moving it to the writer library simplifies llvm-profdata and isolates it from further changes to the format. This also allows us to update the tests to not rely on the text output format. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204489 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-profdata: Implement show commandJustin Bogner2014-03-21
| | | | | | | The `llvm-profdata show` command summarizes a profdata file's contents in a human readable format. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204485 91177308-0d34-0410-b5e6-96231b3b80d8
* ProfileData: Introduce the InstrProfReader interface and a text readerJustin Bogner2014-03-21
| | | | | | | | | | This introduces the ProfileData library and updates llvm-profdata to use this library for reading profiles. InstrProfReader is an abstract base class that will be subclassed for both the raw instrprof data from compiler-rt and the efficient instrprof format that will be used for PGO. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204482 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-objdump output hex to match binutils' objdumpGreg Fitzgerald2014-03-20
| | | | | | Patch by Ted Woodward git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204409 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove llvm-mc's disable-cfi option.Rafael Espindola2014-03-20
| | | | | | It was dead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204404 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-profdata: Remove an empty commentJustin Bogner2014-03-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204370 91177308-0d34-0410-b5e6-96231b3b80d8
* Object: Output .file symbols properlyDavid Majnemer2014-03-20
| | | | | | | obj2yaml would emit the NUL bytes padding the auxiliary file symbol records. Trimming them looks nicer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204314 91177308-0d34-0410-b5e6-96231b3b80d8
* Object: Abstract out the determination of function line symbolsDavid Majnemer2014-03-20
| | | | | | No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204313 91177308-0d34-0410-b5e6-96231b3b80d8