summaryrefslogtreecommitdiff
path: root/tools
Commit message (Collapse)AuthorAge
* Don't mix the plain and keyword signatures of target_link_libraries.Rafael Espindola2014-02-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202299 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-symbolizer: use dynamic symbol table if the regular one is stripped.Alexey Samsonov2014-02-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202265 91177308-0d34-0410-b5e6-96231b3b80d8
* Move getELFDynamicSymbolIterators to a public header.Alexey Samsonov2014-02-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202264 91177308-0d34-0410-b5e6-96231b3b80d8
* Use DataLayout from the module when easily available.Rafael Espindola2014-02-25
| | | | | | | | | | | | | | | | | Eventually DataLayoutPass should go away, but for now that is the only easy way to get a DataLayout in some APIs. This patch only changes the ones that have easy access to a Module. One interesting issue with sometimes using DataLayoutPass and sometimes fetching it from the Module is that we have to make sure they are equivalent. We can get most of the way there by always constructing the pass with a Module. In fact, the pass could be changed to point to an external DataLayout instead of owning one to make this stricter. Unfortunately, the C api passes a DataLayout, so it has to be up to the caller to make sure the pass and the module are in sync. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202204 91177308-0d34-0410-b5e6-96231b3b80d8
* Store a DataLayout in Module.Rafael Espindola2014-02-25
| | | | | | | | | | | | | | Now that DataLayout is not a pass, store one in Module. Since the C API expects to be able to get a char* to the datalayout description, we have to keep a std::string somewhere. This patch keeps it in Module and also uses it to represent modules without a DataLayout. Once DataLayout is mandatory, we should probably move the string to DataLayout itself since it won't be necessary anymore to represent the special case of a module without a DataLayout. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202190 91177308-0d34-0410-b5e6-96231b3b80d8
* Make DataLayout a plain object, not a pass.Rafael Espindola2014-02-25
| | | | | | | Instead, have a DataLayoutPass that holds one. This will allow parts of LLVM don't don't handle passes to also use DataLayout. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202168 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-dwarfdump: Support for debug_line.dwo section for file names for type ↵David Blaikie2014-02-24
| | | | | | units under fission. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202091 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-objdump: Do not attempt to disassemble symbols outside of sectionSimon Atanasyan2014-02-24
| | | | | | | | | | | | | | boundaries. It is possible to create an ELF executable where symbol from say .text section 'points' to the address outside the section boundaries. It does not have a sense to disassemble something outside the section. Without this fix llvm-objdump prints finite or infinite (depends on the executable file architecture) number of 'invalid instruction encoding' warnings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202083 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace the F_Binary flag with a F_Text one.Rafael Espindola2014-02-24
| | | | | | | | | After this I will set the default back to F_None. The advantage is that before this patch forgetting to set F_Binary would corrupt a file on windows. Forgetting to set F_Text produces one that cannot be read in notepad, which is a better failure mode :-) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202052 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't make F_None the default.Rafael Espindola2014-02-24
| | | | | | This will make it easier to switch the default to being binary files. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202042 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify linking to system librariesNAKAMURA Takumi2014-02-23
| | | | | | | | | | | | | | | | | | | | | | | | | The LLVMSupport library implementation consolidates all dependencies on system libraries. Move the logic gathering system libraries out of 'cmake/modules/LLVM-Config.cmake' and into 'lib/Support/CMakeLists.txt'. Use the target_link_libraries() command there to tell CMake about the link dependencies of the LLVMSupport implementation. CMake will automatically propagate this to all targets that link LLVMSupport directly or indirectly. We still need to build knowledge of system library dependencies into 'llvm-config'. Store the list of libraries needed in a property on LLVMSupport and teach 'tools/llvm-config/CMakeLists.txt' to retrieve it from there. Drop all calls to 'link_system_libs' and 'get_system_libs' from our CMake code. Replace their implementations with a warning that explains the calls are no longer necessary. Also drop from 'LLVMConfig.cmake' the HAVE_* and related variables that were published there only to allow 'get_system_libs' to run outside our build process. Contributed by Brad King. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201969 91177308-0d34-0410-b5e6-96231b3b80d8
* [CodeGenPrepare] Move CodeGenPrepare into lib/CodeGen.Quentin Colombet2014-02-22
| | | | | | | | | | | | | CodeGenPrepare uses extensively TargetLowering which is part of libLLVMCodeGen. This is a layer violation which would introduce eventually a dependence on CodeGen in ScalarOpts. Move CodeGenPrepare into libLLVMCodeGen to avoid that. Follow-up of <rdar://problem/15519855> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201912 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-objdump/COFF: LoadConfiguration does not exist in object file.Rui Ueyama2014-02-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201883 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a SymbolicFile interface between Binary and ObjectFile.Rafael Espindola2014-02-21
| | | | | | | | | | | This interface allows IRObjectFile to be implemented without having dummy methods for all section and segment related methods. Both llvm-ar and llvm-nm are changed to use it. Unfortunately the mangler is still not plugged in since it requires some refactoring to make a Module hold a DataLayout. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201881 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] llvm-c/lto.h should be installed if libLTO.a is built.NAKAMURA Takumi2014-02-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201859 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] libLTO: Use (SHARED|STATIC) to build both shared LTO and LTO_static.NAKAMURA Takumi2014-02-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201856 91177308-0d34-0410-b5e6-96231b3b80d8
* Make DisableIntegratedAS a TargetOption.Rafael Espindola2014-02-21
| | | | | | | This replaces the old NoIntegratedAssembler with at TargetOption. This is more flexible and will be used to forward clang's -no-integrated-as option. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201836 91177308-0d34-0410-b5e6-96231b3b80d8
* One last pass of DataLayout variable renaming.Rafael Espindola2014-02-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201834 91177308-0d34-0410-b5e6-96231b3b80d8
* Set the SuppressWarnings option on tool level and propagate to the library.Eli Bendersky2014-02-20
| | | | | | | | | | | | | | | The SuppressWarnings flag, unfortunately, isn't very useful for custom tools that want to use the LLVM module linker. So I'm changing it to a parameter of the Linker, and the flag itself moves to the llvm-link tool. For the time being as SuppressWarnings is pretty much the only "option" it seems reasonable to propagate it to Linker objects. If we end up with more options in the future, some sort of "struct collecting options" may be a better idea. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201819 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-objdump/COFF: Print SEH table addresses.Rui Ueyama2014-02-20
| | | | | | | SEH table addresses are VA in COFF file. In this patch we convert VA to RVA before printing it, because dumpbin prints them as RVAs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201760 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typoTobias Grosser2014-02-19
| | | | | | Found by: Duncan P. N. Exon Smith <dexonsmith@apple.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201726 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor TargetOptions initialization into a single place.Eli Bendersky2014-02-19
| | | | | | | | | | | | | | The same code (~20 lines) for initializing a TargetOptions object from CodeGen cmdline flags is duplicated 4 times in 4 different tools. This patch moves it into a utility function. Since the CodeGen/CommandFlags.h file defines cl::opt flags in a header, it's a bit of a touchy situation because we should only link them into tools. So this patch puts the init function in the header. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201699 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-objdump/COFF: Print load configuration table.Rui Ueyama2014-02-19
| | | | | | | | | | | | Load Configuration Table may contain a pointer to SEH table. This patch is to print the offset to the table. Printing SEH table contents is a TODO. The layout of Layout Configuration Table is described in Microsoft PE/COFF Object File Format Spec, but the table's offset/size descriptions seems to be totally wrong, at least in revision 8.3 of the spec. I believe the table in this patch is the correct one. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201638 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Support gcov's extermely lenient treatment of -oJustin Bogner2014-02-18
| | | | | | | | | | | | In gcov, the -o flag can accept either a directory or a file name. When given a directory, the gcda and gcno files are expected to be in that directory. When given a file, the gcda and gcno files are expected to be named based on the stem of that file. Non-existent paths are treated as files. This implements compatible behaviour. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201555 91177308-0d34-0410-b5e6-96231b3b80d8
* PGO: llvm-profdata: tool for merging profilesDuncan P. N. Exon Smith2014-02-17
| | | | | | | | | | | | | | | | | | | Introducing llvm-profdata, a tool for merging profile data generated by PGO instrumentation in clang. - The name indicates a file extension of <name>.profdata. Eventually profile data output by clang should be changed to that extension. - llvm-profdata merges two profiles. However, the name is more general, since it will likely pick up more tasks (such as summarizing a single profile). - llvm-profdata parses the current text-based format, but will be updated once we settle on a binary format. <rdar://problem/15949645> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201535 91177308-0d34-0410-b5e6-96231b3b80d8
* MSBuild integration: get the LibraryPath right (PR18707)Hans Wennborg2014-02-13
| | | | | | | It was pointing to lib\clang\3.4, but now we're on 3.5. Make CMake insert the right version automatically. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201363 91177308-0d34-0410-b5e6-96231b3b80d8
* VS Integration: install toolsets for x64 too (PR18738)Hans Wennborg2014-02-12
| | | | | | | | | This does exactly the same thing as for Win32, except it passes -m64 to the compiler and the files go in a different directory. Differential Revision: http://llvm-reviews.chandlerc.com/D2749 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201269 91177308-0d34-0410-b5e6-96231b3b80d8
* Move more self-contained functionality away from tools/opt/opt.cppEli Bendersky2014-02-12
| | | | | | | BreakpointPrinter moves to its own module. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201242 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve the declaration when LDPO_PIE is not available.Sylvestre Ledru2014-02-11
| | | | | | | | Thanks to İsmail Dönmez for the better declaration. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201163 91177308-0d34-0410-b5e6-96231b3b80d8
* If LDPO_PIE is not defined (before binutils 2.23 version), Sylvestre Ledru2014-02-11
| | | | | | | | | use the hardcoded declaration 3 See r201110 for the initial change git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201161 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the *PassPrinter into their own module.Eli Bendersky2014-02-10
| | | | | | | | | | | | These are self-contained in functionality so it makes sense to separate them, as opt.cpp has grown quite big already. Following Eric's suggestions, if this code is ever deemed useful outside of tools/opt, it will make sense to move it to one of the LLVM libraries like IR. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201116 91177308-0d34-0410-b5e6-96231b3b80d8
* LTO API: add lto_module_create_from_memory_with_path.Manman Ren2014-02-10
| | | | | | | | | | | | | | This function adds an extra path argument to lto_module_create_from_memory. The path argument will be passed to makeBuffer to make sure the MemoryBuffer has a name and the created module has a module identifier. This is mainly for emitting warning messages from the linker. When we emit warning message on a module, we can use the module identifier. rdar://15985737 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201114 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an old FIXME. LDPO_PIE is available since 2.23, realeased 2012-10-22.Rafael Espindola2014-02-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201110 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the begin and end methods in ObjectFile to match the style guide.Rafael Espindola2014-02-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201108 91177308-0d34-0410-b5e6-96231b3b80d8
* tools: cast the right operandSaleem Abdulrasool2014-02-09
| | | | | | Properly apply the fix intended by SVN r201032. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201036 91177308-0d34-0410-b5e6-96231b3b80d8
* tools: explicitly cast to avoid a warningSaleem Abdulrasool2014-02-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201032 91177308-0d34-0410-b5e6-96231b3b80d8
* tools: handle out-of-line personality 0 decodingSaleem Abdulrasool2014-02-08
| | | | | | | | In some cases it is possible to have a personality 0 unwinding opcodes in the extab (such as when .handlerdata is used in the assembly). Simply decode the 3 opcodes for that case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201030 91177308-0d34-0410-b5e6-96231b3b80d8
* [PM] Add a new "lazy" call graph analysis pass for the new pass manager.Chandler Carruth2014-02-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The primary motivation for this pass is to separate the call graph analysis used by the new pass manager's CGSCC pass management from the existing call graph analysis pass. That analysis pass is (somewhat unfortunately) over-constrained by the existing CallGraphSCCPassManager requirements. Those requirements make it *really* hard to cleanly layer the needed functionality for the new pass manager on top of the existing analysis. However, there are also a bunch of things that the pass manager would specifically benefit from doing differently from the existing call graph analysis, and this new implementation tries to address several of them: - Be lazy about scanning function definitions. The existing pass eagerly scans the entire module to build the initial graph. This new pass is significantly more lazy, and I plan to push this even further to maximize locality during CGSCC walks. - Don't use a single synthetic node to partition functions with an indirect call from functions whose address is taken. This node creates a huge choke-point which would preclude good parallelization across the fanout of the SCC graph when we got to the point of looking at such changes to LLVM. - Use a memory dense and lightweight representation of the call graph rather than value handles and tracking call instructions. This will require explicit update calls instead of some updates working transparently, but should end up being significantly more efficient. The explicit update calls ended up being needed in many cases for the existing call graph so we don't really lose anything. - Doesn't explicitly model SCCs and thus doesn't provide an "identity" for an SCC which is stable across updates. This is essential for the new pass manager to work correctly. - Only form the graph necessary for traversing all of the functions in an SCC friendly order. This is a much simpler graph structure and should be more memory dense. It does limit the ways in which it is appropriate to use this analysis. I wish I had a better name than "call graph". I've commented extensively this aspect. This is still very much a WIP, in fact it is really just the initial bits. But it is about the fourth version of the initial bits that I've implemented with each of the others running into really frustrating problms. This looks like it will actually work and I'd like to split the actual complexity across commits for the sake of my reviewers. =] The rest of the implementation along with lots of wiring will follow somewhat more rapidly now that there is a good path forward. Naturally, this doesn't impact any of the existing optimizer. This code is specific to the new pass manager. A bunch of thanks are deserved for the various folks that have helped with the design of this, especially Nick Lewycky who actually sat with me to go through the fundamentals of the final version here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200903 91177308-0d34-0410-b5e6-96231b3b80d8
* [PM] Back out one hunk of the patch in r200901 that was *supposed* to goChandler Carruth2014-02-06
| | | | | | in my next patch. Sorry for the breakage. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200902 91177308-0d34-0410-b5e6-96231b3b80d8
* [PM] Wire up the analysis managers in the opt driver. This isn't reallyChandler Carruth2014-02-06
| | | | | | | | | necessary until we add analyses to the driver, but I have such an analysis ready and wanted to split this out. This is actually exercised by the existing tests of the new pass manager as the analysis managers are cross-checked and validated by the function and module managers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200901 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove support for not using .loc directives.Rafael Espindola2014-02-05
| | | | | | Clang itself was not using this. The only way to access it was via llc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200862 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the information provided by getFlags to unify some code in llvm-nm.Rafael Espindola2014-02-05
| | | | | | | | | | It is not clear how much we should try to expose in getFlags. For example, should there be a SF_Object and a SF_Text? But for information that is already being exposed, we may as well use it in llvm-nm. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200820 91177308-0d34-0410-b5e6-96231b3b80d8
* Small fix for llvm-nm handling of weak symbols on ELF (print 'v').Rafael Espindola2014-02-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200808 91177308-0d34-0410-b5e6-96231b3b80d8
* cleanup: scc_iterator consumers should use isAtEndDuncan P. N. Exon Smith2014-02-04
| | | | | | | | | | | | | | No functional change. Updated loops from: for (I = scc_begin(), E = scc_end(); I != E; ++I) to: for (I = scc_begin(); !I.isAtEnd(); ++I) for teh win. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200789 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Implement the preserve-paths flagJustin Bogner2014-02-04
| | | | | | | | | | | | | | | | Until now, when a path in a gcno file included a directory, we would emit our .gcov file in that directory, whereas gcov always emits the file in the current directory. In doing so, this implements gcov's strange name-mangling -p flag, which is needed to avoid clobbering files when two with the same name exist in different directories. The path mangling is a bit ugly and only handles unix-like paths, but it's simple, and it doesn't make any guesses as to how it should behave outside of what gcov documents. If we decide this should be cross platform later, we can consider the compatibility implications then. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200754 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Implement the object-directory flagJustin Bogner2014-02-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200741 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Ignore missing .gcda filesJustin Bogner2014-02-04
| | | | | | | | When gcov is run without gcda data, it acts as if the counts are all zero and labels the file as - to indicate that there was no data. We should do the same. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200740 91177308-0d34-0410-b5e6-96231b3b80d8
* Move error handling down to getSymbolNMTypeChar.Rafael Espindola2014-02-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200727 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify getSymbolFlags.Rafael Espindola2014-01-31
| | | | | | | None of the object formats require extra parsing to compute these flags, so the method cannot fail. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200574 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r200560, "LTO itself hasn't depended on MCDisassembler any more."NAKAMURA Takumi2014-01-31
| | | | | | Oh sorry, I missed LTO.exports, ... I checked just only *.cpp(s). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200562 91177308-0d34-0410-b5e6-96231b3b80d8