summaryrefslogtreecommitdiff
path: root/tools
Commit message (Collapse)AuthorAge
* Reduce indentation. No functionality change.Rafael Espindola2014-06-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211318 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the output of llvm-nm and llvm-size for Mach-O universal files (akaKevin Enderby2014-06-19
| | | | | | | | | | | fat files) to print “ (for architecture XYZ)” for fat files with more than one architecture to be like what the darwin tools do for fat files. Also clean up the Mach-O printing of archive membernames in llvm-nm to use the darwin form of "libx.a(foo.o)". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211316 91177308-0d34-0410-b5e6-96231b3b80d8
* Use lib/LTO directly in the gold plugin.Rafael Espindola2014-06-19
| | | | | | | | | | | | | | | | | | | | The tools/lto API is not the best choice for implementing a gold plugin. Among other issues: * It is an stable ABI. Old errors stay and we have to be really careful before adding new features. * It has to support two fairly different linkers: gold and ld64. * We end up with a plugin that depends on a shared lib, something quiet unusual in LLVM land. * It hides LLVM. For some features in the gold plugin it would be really nice to be able to just get a Module or a GlobalValue. This change is intended to be a very direct translation from the C API. It will just enable other fixes and cleanups. Tested with a LTO bootstrap on linux. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211315 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove an incorrect fixme.Rafael Espindola2014-06-19
| | | | | | | dynamic-no-pic is just another output type. If gnu ld gets support for MachO, it should also add something like LDPO_DYN_NO_PIC to the plugin interface. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211305 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused includes following r211294Alp Toker2014-06-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211297 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the c++ APIs.Rafael Espindola2014-06-19
| | | | | | No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211294 91177308-0d34-0410-b5e6-96231b3b80d8
* Move -dwarf-version to an MC level command line option so it'sEric Christopher2014-06-19
| | | | | | | used by all of the MC level tools and codegen. Fix up all uses in the compiler to use this and set it on the context accordingly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211257 91177308-0d34-0410-b5e6-96231b3b80d8
* 80-column fixups.Eric Christopher2014-06-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211255 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach llvm-size to know about Mach-O universal files (aka fat files) andKevin Enderby2014-06-18
| | | | | | | | | | | fat files containing archives. Also fix a bug in MachOUniversalBinary::ObjectForArch::ObjectForArch() where it needed a >= when comparing the Index with the number of objects in a fat file. As the index starts at 0. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211230 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a symbols() range and use a range loop.Rafael Espindola2014-06-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211222 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify code.Rafael Espindola2014-06-18
| | | | | | We can delete the objects earlier now that we are copying the names to a buffer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211221 91177308-0d34-0410-b5e6-96231b3b80d8
* [llvm-readobj] Fix member functions name style.Simon Atanasyan2014-06-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211152 91177308-0d34-0410-b5e6-96231b3b80d8
* [llvm-readobj] Fix compile error.Simon Atanasyan2014-06-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211151 91177308-0d34-0410-b5e6-96231b3b80d8
* [llvm-readobj][ELF] New `-mips-plt-got` command line option to outputSimon Atanasyan2014-06-18
| | | | | | | | MIPS GOT section. Patch reviewed by Rafael Espindola. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211150 91177308-0d34-0410-b5e6-96231b3b80d8
* Add "-format darwin" to llvm-size to be like darwin's size(1) -m output, andKevin Enderby2014-06-17
| | | | | | | | | | | | | | | | and the -l option for the long format. Also when the object is a Mach-O file and the format is berkeley produce output like darwin’s default size(1) summary berkeley derived output. Like System V format, there are also some small changes in how and where the file names and archive member names are printed for darwin and Mach-O. Like the changes to llvm-nm these are the first steps in seeing if it is possible to make llvm-size produce the same output as darwin's size(1). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211117 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert the Archive API to use ErrorOr.Rafael Espindola2014-06-16
| | | | | | | | | Now that we have c++11, even things like ErrorOr<std::unique_ptr<...>> are easy to use. No intended functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211033 91177308-0d34-0410-b5e6-96231b3b80d8
* Finishing touch for the std::error_code transition.Rafael Espindola2014-06-13
| | | | | | | | | | | While std::error_code itself seems to work OK in all platforms, there are few annoying differences with regards to the std::errc enumeration. This patch adds a simple llvm enumeration, which will hopefully avoid build breakages in other platforms and surprises as we get more uses of std::error_code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210920 91177308-0d34-0410-b5e6-96231b3b80d8
* opt: Initialize asm printersTobias Grosser2014-06-13
| | | | | | | | | | | | | | Without initializing the assembly printers a shared library build of opt is linked with these libraries whereas for a static build these libraries are dead code eliminated. This is unfortunate for plugins in case they want to use them, as they neither can rely on opt to provide this functionality nor can they link the printers in themselves as this breaks with a shared object build of opt. This patch calls InitializeAllAsmPrinters() from opt, which increases the static binary size from 50MB -> 52MB on my system (all backends compiled) and causes no measurable increase in the time needed to run 'make check'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210914 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused and odd code.Rafael Espindola2014-06-13
| | | | | | | | This code was never being used and any use of it would look fairly strange. For example, it would try to map a object_error::parse_failed to std::errc::invalid_argument. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210912 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove 'using std::error_code' from tools.Rafael Espindola2014-06-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210876 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove all uses of 'using std::error_code' from headers.Rafael Espindola2014-06-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210866 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use 'using std::error_code' in include/llvm.Rafael Espindola2014-06-12
| | | | | | This should make sure that most new uses use the std prefix. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210835 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove system_error.h.Rafael Espindola2014-06-12
| | | | | | | This is a minimal change to remove the header. I will remove the occurrences of "using std::error_code" in a followup patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210803 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace llvm::error_code with std::error_code.Rafael Espindola2014-06-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210783 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't import make_error_code into the llvm namespace.Rafael Espindola2014-06-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210772 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't import error_category into the llvm namespace.Rafael Espindola2014-06-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210733 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't import error_condition into the llvm namespace.Rafael Espindola2014-06-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210731 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Add option for prefering hex format disassembly.Jim Grosbach2014-06-11
| | | | | | | | | Previously there was a separate mode entirely (--hdis vs. --disassemble). It makes a bit more sense for the immediate printing style to be a flag for --disassmeble rather than an entirely different thing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210700 91177308-0d34-0410-b5e6-96231b3b80d8
* Use std::error_code instead of llvm::error_code.Rafael Espindola2014-06-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea of this patch is to turn llvm/Support/system_error.h into a transitional header that just brings in the erorr_code api to the llvm namespace. I will remove it shortly afterwards. The cases where the general idea needed some tweaking: * std::errc is a namespace in msvc, so we cannot use "using std::errc". I could add an #ifdef, but there were not that many uses, so I just added std:: to them in this patch. * Template specialization had to be moved to the std namespace in this patch set already. * The msvc implementation of default_error_condition doesn't seem to provide the same transformations as we need. Not too surprising since the standard doesn't actually say what "equivalent" means. I fixed the problem by keeping our old mapping and using it at error_code construction time. Despite these shortcomings I think this is still a good thing. Some reasons: * The different implementations of system_error might improve over time. * It removes 925 lines of code from llvm already. * It removes 6313 bytes from the text segment of the clang binary when it is built with gcc and 2816 bytes when building with clang and libstdc++. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210687 91177308-0d34-0410-b5e6-96231b3b80d8
* Use an enum class.Rafael Espindola2014-06-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210623 91177308-0d34-0410-b5e6-96231b3b80d8
* Use an enum class.Rafael Espindola2014-06-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210620 91177308-0d34-0410-b5e6-96231b3b80d8
* Mark a few functions noexcept.Rafael Espindola2014-06-10
| | | | | | This reduces the difference between std::error_code and llvm::error_code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210591 91177308-0d34-0410-b5e6-96231b3b80d8
* [llvm-readobj][ELF] Factor out the code retrieve ELF symbol informationSimon Atanasyan2014-06-10
| | | | | | | | (section name, section index, full name) into the separate functions. No functional changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210509 91177308-0d34-0410-b5e6-96231b3b80d8
* tools: add a high level explanation for WoA EH dataSaleem Abdulrasool2014-06-07
| | | | | | | | | | | | Add a brief explanation of the data section layout for the unwind data that the Windows on ARM EH models. This is simply to provide a rough idea of the layout of the code involved in the decoding of the unwinding. Details on the involved data structures are available in the associated support header. The bulk of it is related to printing out the byte-code to help validate generation of WoA EH. No functional change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210397 91177308-0d34-0410-b5e6-96231b3b80d8
* [yaml2obj][obj2yaml] Support ELF symbol's visibility flags ↵Simon Atanasyan2014-06-06
| | | | | | (default/hidden/protected). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210316 91177308-0d34-0410-b5e6-96231b3b80d8
* Add "-format darwin" to llvm-nm to be like darwin's nm(1) -m output.Kevin Enderby2014-06-05
| | | | | | | | | | | | | | | | This is a first step in seeing if it is possible to make llvm-nm produce the same output as darwin's nm(1). Darwin's default format is bsd but its -m output prints the longer Mach-O specific details. For now I added the "-format darwin" to do this (whos name may need to change in the future). As there are other Mach-O specific flags to nm(1) which I'm hoping to add some how in the future. But I wanted to see if I could get the correct output for -m flag using llvm-nm and the libObject interfaces. I got this working but would love to hear what others think about this approach to getting object/format specific details printed with llvm-nm. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210285 91177308-0d34-0410-b5e6-96231b3b80d8
* lld (build with configur and make) Enable buildIain Sandoe2014-06-05
| | | | | | | | | r210177 added Makefiles to the lld project. This revision enables the automatic build of lld when the sources are found in tools/lld. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210245 91177308-0d34-0410-b5e6-96231b3b80d8
* tools: fix parenthesis warning from GCCSaleem Abdulrasool2014-06-04
| | | | | | Add parenthesis as suggested by GCC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210194 91177308-0d34-0410-b5e6-96231b3b80d8
* tools: fix silly typo in llvm-readobjSaleem Abdulrasool2014-06-04
| | | | | | | Case insensitive case preserving file systems are not a good choice for development. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210193 91177308-0d34-0410-b5e6-96231b3b80d8
* tools: initial implementation of WoA EH decodingSaleem Abdulrasool2014-06-04
| | | | | | | | | | | | | Add support to llvm-readobj to decode Windows ARM Exception Handling data. This uses the previously added datastructures to decode the information into a format that can be used by tests. This is a necessary step to add support for emitting Windows on ARM exception handling information. A fair amount of formatting inspiration is drawn from the Win64 EH printer as well as the ARM EHABI printer. This allows for a reasonably thorough look into the encoded data. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210192 91177308-0d34-0410-b5e6-96231b3b80d8
* tools: introduce StreamWriter::printBooleanSaleem Abdulrasool2014-06-04
| | | | | | | Add a helper print method to print a boolean value as "Yes" or "No". This is intended to be used by the Windows ARM EH printer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210191 91177308-0d34-0410-b5e6-96231b3b80d8
* [Object][ELF] Range-based loop simplification.Simon Atanasyan2014-06-04
| | | | | | No functional changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210164 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow alias to point to an arbitrary ConstantExpr.Rafael Espindola2014-06-03
| | | | | | | | | | | | | | | | | | | | | This patch changes GlobalAlias to point to an arbitrary ConstantExpr and it is up to MC (or the system assembler) to decide if that expression is valid or not. This reduces our ability to diagnose invalid uses and how early we can spot them, but it also lets us do things like @test5 = alias inttoptr(i32 sub (i32 ptrtoint (i32* @test2 to i32), i32 ptrtoint (i32* @bar to i32)) to i32*) An important implication of this patch is that the notion of aliased global doesn't exist any more. The alias has to encode the information needed to access it in its metadata (linkage, visibility, type, etc). Another consequence to notice is that getSection has to return a "const char *". It could return a NullTerminatedStringRef if there was such a thing, but when that was proposed the decision was to just uses "const char*" for that. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210062 91177308-0d34-0410-b5e6-96231b3b80d8
* [yaml2obj] Add new command line option `-docnum`.Simon Atanasyan2014-05-31
| | | | | | | | | | Input YAML file might contain multiple object file definitions. New option `-docnum` allows to specify an ordinal number (starting from 1) of definition used for an object file generation. Patch reviewed by Sean Silva. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209967 91177308-0d34-0410-b5e6-96231b3b80d8
* There is no std::errc::success, remove the llvm one.Rafael Espindola2014-05-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209960 91177308-0d34-0410-b5e6-96231b3b80d8
* Turn errc and windows_error into enum classes.Rafael Espindola2014-05-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209957 91177308-0d34-0410-b5e6-96231b3b80d8
* MachO: support N_INDR aliases in assembly files.Tim Northover2014-05-30
| | | | | | | | | This makes LLVM create N_INDR aliases (to be resolved by the linker) when appropriate. rdar://problem/15125513 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209894 91177308-0d34-0410-b5e6-96231b3b80d8
* [elf2yaml][ELF] Move Info field to the RelocationSection structure. ThisSimon Atanasyan2014-05-29
| | | | | | | field represents ELF section header sh_info field and does not have any sense for regular sections. Its interpretation depends on section type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209801 91177308-0d34-0410-b5e6-96231b3b80d8
* tools: avoid use of std::functionSaleem Abdulrasool2014-05-25
| | | | | | | | | | | Remove the use of the std::function and replace the capturing lambda with a non-capturing one, opting to pass the user data down to the context. This is needed as std::function is not yet available on all hosted platforms (it requires RTTI, which breaks on Windows). Thanks to Nico Rieck for pointing this out! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209607 91177308-0d34-0410-b5e6-96231b3b80d8
* tools: split out Win64EHDumper from COFFDumperSaleem Abdulrasool2014-05-25
| | | | | | | | | | Move the implementation of the Win64 EH printer from the COFFDumper into its own class. This is in preparation for adding support to print ARM EH information. The only real change here is in printUnwindInfo where we now lambda lift the implicit this parameter for the resolveFunction. Also setup the printing to handle ARM. This now has set the stage to introduce ARM EH printing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209606 91177308-0d34-0410-b5e6-96231b3b80d8