summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
* Replace the F_Binary flag with a F_Text one.Rafael Espindola2014-02-2414-17/+17
| | | | | | | | | 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 :-) llvm-svn: 202052
* Don't make F_None the default.Rafael Espindola2014-02-242-3/+3
| | | | | | This will make it easier to switch the default to being binary files. llvm-svn: 202042
* Simplify linking to system librariesNAKAMURA Takumi2014-02-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 201969
* [CodeGenPrepare] Move CodeGenPrepare into lib/CodeGen.Quentin Colombet2014-02-227-4/+10
| | | | | | | | | | | | 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> llvm-svn: 201912
* llvm-objdump/COFF: LoadConfiguration does not exist in object file.Rui Ueyama2014-02-211-0/+7
| | | | llvm-svn: 201883
* Add a SymbolicFile interface between Binary and ObjectFile.Rafael Espindola2014-02-213-134/+94
| | | | | | | | | | | 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. llvm-svn: 201881
* [CMake] llvm-c/lto.h should be installed if libLTO.a is built.NAKAMURA Takumi2014-02-211-4/+2
| | | | llvm-svn: 201859
* [CMake] libLTO: Use (SHARED|STATIC) to build both shared LTO and LTO_static.NAKAMURA Takumi2014-02-211-15/+3
| | | | llvm-svn: 201856
* Make DisableIntegratedAS a TargetOption.Rafael Espindola2014-02-211-0/+5
| | | | | | | This replaces the old NoIntegratedAssembler with at TargetOption. This is more flexible and will be used to forward clang's -no-integrated-as option. llvm-svn: 201836
* One last pass of DataLayout variable renaming.Rafael Espindola2014-02-212-9/+9
| | | | llvm-svn: 201834
* Set the SuppressWarnings option on tool level and propagate to the library.Eli Bendersky2014-02-201-1/+5
| | | | | | | | | | | | | 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. llvm-svn: 201819
* llvm-objdump/COFF: Print SEH table addresses.Rui Ueyama2014-02-201-0/+22
| | | | | | | 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. llvm-svn: 201760
* Fix typoTobias Grosser2014-02-191-3/+3
| | | | | | Found by: Duncan P. N. Exon Smith <dexonsmith@apple.com> llvm-svn: 201726
* Refactor TargetOptions initialization into a single place.Eli Bendersky2014-02-194-98/+10
| | | | | | | | | | | | 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. llvm-svn: 201699
* llvm-objdump/COFF: Print load configuration table.Rui Ueyama2014-02-191-0/+41
| | | | | | | | | | | | 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. llvm-svn: 201638
* llvm-cov: Support gcov's extermely lenient treatment of -oJustin Bogner2014-02-181-4/+14
| | | | | | | | | | | | 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. llvm-svn: 201555
* PGO: llvm-profdata: tool for merging profilesDuncan P. N. Exon Smith2014-02-177-2/+225
| | | | | | | | | | | | | | | | | | | 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> llvm-svn: 201535
* MSBuild integration: get the LibraryPath right (PR18707)Hans Wennborg2014-02-132-1/+3
| | | | | | | It was pointing to lib\clang\3.4, but now we're on 3.5. Make CMake insert the right version automatically. llvm-svn: 201363
* VS Integration: install toolsets for x64 too (PR18738)Hans Wennborg2014-02-124-66/+97
| | | | | | | | | 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 llvm-svn: 201269
* Move more self-contained functionality away from tools/opt/opt.cppEli Bendersky2014-02-124-61/+110
| | | | | | BreakpointPrinter moves to its own module. llvm-svn: 201242
* Improve the declaration when LDPO_PIE is not available.Sylvestre Ledru2014-02-111-7/+6
| | | | | | Thanks to İsmail Dönmez for the better declaration. llvm-svn: 201163
* If LDPO_PIE is not defined (before binutils 2.23 version), Sylvestre Ledru2014-02-111-0/+7
| | | | | | | use the hardcoded declaration 3 See r201110 for the initial change llvm-svn: 201161
* Move the *PassPrinter into their own module.Eli Bendersky2014-02-104-206/+315
| | | | | | | | | | 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. llvm-svn: 201116
* LTO API: add lto_module_create_from_memory_with_path.Manman Ren2014-02-102-0/+12
| | | | | | | | | | | | | 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 llvm-svn: 201114
* Fix an old FIXME. LDPO_PIE is available since 2.23, realeased 2012-10-22.Rafael Espindola2014-02-101-2/+1
| | | | llvm-svn: 201110
* Change the begin and end methods in ObjectFile to match the style guide.Rafael Espindola2014-02-1011-83/+83
| | | | llvm-svn: 201108
* tools: cast the right operandSaleem Abdulrasool2014-02-091-1/+1
| | | | | | Properly apply the fix intended by SVN r201032. llvm-svn: 201036
* tools: explicitly cast to avoid a warningSaleem Abdulrasool2014-02-091-1/+1
| | | | llvm-svn: 201032
* tools: handle out-of-line personality 0 decodingSaleem Abdulrasool2014-02-081-1/+1
| | | | | | | | 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. llvm-svn: 201030
* [PM] Add a new "lazy" call graph analysis pass for the new pass manager.Chandler Carruth2014-02-062-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 200903
* [PM] Back out one hunk of the patch in r200901 that was *supposed* to goChandler Carruth2014-02-061-4/+0
| | | | | | in my next patch. Sorry for the breakage. llvm-svn: 200902
* [PM] Wire up the analysis managers in the opt driver. This isn't reallyChandler Carruth2014-02-061-2/+12
| | | | | | | | | 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. llvm-svn: 200901
* Remove support for not using .loc directives.Rafael Espindola2014-02-052-13/+3
| | | | | | Clang itself was not using this. The only way to access it was via llc. llvm-svn: 200862
* Use the information provided by getFlags to unify some code in llvm-nm.Rafael Espindola2014-02-051-90/+73
| | | | | | | | | | 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. llvm-svn: 200820
* Small fix for llvm-nm handling of weak symbols on ELF (print 'v').Rafael Espindola2014-02-041-2/+6
| | | | llvm-svn: 200808
* cleanup: scc_iterator consumers should use isAtEndDuncan P. N. Exon Smith2014-02-041-4/+3
| | | | | | | | | | | | | | 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. llvm-svn: 200789
* llvm-cov: Implement the preserve-paths flagJustin Bogner2014-02-041-1/+5
| | | | | | | | | | | | | | | | 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. llvm-svn: 200754
* llvm-cov: Implement the object-directory flagJustin Bogner2014-02-041-2/+13
| | | | llvm-svn: 200741
* llvm-cov: Ignore missing .gcda filesJustin Bogner2014-02-041-7/+12
| | | | | | | | 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. llvm-svn: 200740
* Move error handling down to getSymbolNMTypeChar.Rafael Espindola2014-02-041-54/+30
| | | | llvm-svn: 200727
* Simplify getSymbolFlags.Rafael Espindola2014-01-313-7/+3
| | | | | | | None of the object formats require extra parsing to compute these flags, so the method cannot fail. llvm-svn: 200574
* Revert r200560, "LTO itself hasn't depended on MCDisassembler any more."NAKAMURA Takumi2014-01-312-1/+2
| | | | | | Oh sorry, I missed LTO.exports, ... I checked just only *.cpp(s). llvm-svn: 200562
* LTO itself hasn't depended on MCDisassembler any more.NAKAMURA Takumi2014-01-312-3/+1
| | | | llvm-svn: 200560
* llvm/tools: Prune redundant target_link_libraries.NAKAMURA Takumi2014-01-312-4/+0
| | | | llvm-svn: 200559
* This file already has a "using namespace object;", use it.Rafael Espindola2014-01-301-22/+20
| | | | llvm-svn: 200493
* Only ELF has a dynamic symbol table. Remove it from ObjectFile.Rafael Espindola2014-01-301-2/+28
| | | | | | | | | COFF has only one symbol table. MachO has a LC_DYSYMTAB, but that is not a symbol table, just extra info about the one symbol table (LC_SYMTAB). IR (coming soon) also has only one table. llvm-svn: 200488
* Use early returns and factor the object::Binary creation.Rafael Espindola2014-01-301-69/+59
| | | | llvm-svn: 200484
* tools: fix Twine abuseSaleem Abdulrasool2014-01-301-10/+10
| | | | | | | utohexstr provides a temporary string, making it unsafe to use with the Twine interface which will not copy the string. Switch to using std::string. llvm-svn: 200457
* tools: remove unnecessary typenameSaleem Abdulrasool2014-01-301-2/+2
| | | | | | | This is acceptted by clang and gcc, but MSVC seems to balk at it. As it is unneeded, simply drop it. Fixes MSVC buildbots. llvm-svn: 200456
* tools: repair Windows buildSaleem Abdulrasool2014-01-301-2/+2
| | | | | | | | | exp2 is not available on Windows. Fortunately, we are calculating powers of 2 with expontents within the range of [4,12]. Simply use an equivalent bitshift operation to repair compilation with MSVC which does not provide this standard function. llvm-svn: 200454
OpenPOWER on IntegriCloud