aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools
AgeCommit message (Collapse)AuthorFilesLines
2015-01-08Run clang-format on tools/llvm-objdump/MachODump.cpp again as some of myKevin Enderby1-27/+28
previous changes got in with incorrect formatting. No functional change. llvm-svn: 225417
2015-01-07Fix uninitialized memory read in llvm-dsymutil for the second time.Alexey Samsonov1-1/+2
This was already fixed by r224481, but apparently was accidentally reverted in r225207. llvm-svn: 225386
2015-01-07Slightly refactor things for llvm-objdump and the -macho option so it can be ↵Kevin Enderby3-47/+98
used with options other than just -disassemble so that universal files can be used with other options combined with -arch options. No functional change to existing options and use. One test case added for the additional functionality with a universal file an a -arch option. llvm-svn: 225383
2015-01-07Manually specify the folder that llvm-ranlib should reside in for ↵Aaron Ballman1-0/+2
CMake-produced solutions that care about such things (like MSVC). This takes llvm-ranlib out of the root solution folder and places it into the Tools folder where it belongs. llvm-svn: 225353
2015-01-07[PM] Give slightly less horrible names to the utility pass templates forChandler Carruth1-6/+6
requiring and invalidating specific analyses. Also make their printed names match their class names. Writing these out as prose really doesn't make sense to me any more. llvm-svn: 225346
2015-01-06Don't loop endlessly for MachO files with 0 ncmdsFilipe Cabecinhas1-0/+2
llvm-svn: 225271
2015-01-06[PM] Hide a function we only use in an assert behind NDEBUG.Chandler Carruth1-0/+2
llvm-svn: 225258
2015-01-06[PM] Introduce a utility pass that preserves no analyses.Chandler Carruth1-0/+3
Use this to test that path of invalidation. This test actually shows redundant invalidation here that is really bad. I'm going to work on fixing that next, but wanted to commit the test harness now that its all working. llvm-svn: 225257
2015-01-06[PM] Simplify how we parse the outer layer of the pass pipeline text andChandler Carruth1-25/+14
remove an extra, redundant pass manager wrapping every run. I had kept seeing these when manually testing, but it was getting really annoying and was going to cause problems with overly eager invalidation. The root cause was an overly complex and unnecessary pile of code for parsing the outer layer of the pass pipeline. We can instead delegate most of this to the recursive pipeline parsing. I've added some somewhat more basic and precise tests to catch this. llvm-svn: 225253
2015-01-06[PM] Add a utility pass template that synthesizes the invalidation ofChandler Carruth1-3/+15
a specific analysis result. This is quite handy to test things, and will also likely be very useful for debugging issues. You could narrow down pass validation failures by walking these invalidate pass runs up and down the pass pipeline, etc. I've added support to the pass pipeline parsing to be able to create one of these for any analysis pass desired. Just adding this class uncovered one latent bug where the AnalysisManager CRTP base class had a hard-coded Module type rather than using IRUnitT. I've also added tests for invalidation and caching of analyses in a basic way across all the pass managers. These in turn uncovered two more bugs where we failed to correctly invalidate an analysis -- its results were invalidated but the key for re-running the pass was never cleared and so it was never re-run. Quite nasty. I'm very glad to debug this here rather than with a full system. Also, yes, the naming here is horrid. I'm going to update some of the names to be slightly less awful shortly. But really, I've no "good" ideas for naming. I'll be satisfied if I can get it to "not bad". llvm-svn: 225246
2015-01-06[PM] Simplify how we use the registry by including it only once. StillChandler Carruth1-18/+0
more verbose than I'd like, but the code really isn't that interesting, and this still seems vastly simpler than any other solutions I've come up with. =] Maybe if we get to the 10th IR unit, this will be a problem in practice. llvm-svn: 225245
2015-01-06[PM] Add a collection of no-op analysis passes and switch the new passChandler Carruth2-0/+39
manager tests to use them and be significantly more comprehensive. This, naturally, uncovered a bug where the CGSCC pass manager wasn't printing analyses when they were run. The only remaining core manipulator is I think an invalidate pass similar to the require pass. That'll be next. =] llvm-svn: 225240
2015-01-06[PM] Sink the no-op pass parsing logic into the .def-based registry toChandler Carruth2-21/+3
simplify things. This will become more important as I add no-op analyses that want to re-use the logic we already have for analyses in the registry. For now, no functionality changed. llvm-svn: 225238
2015-01-06[PM] Move the analysis registry into the Passes.cpp file and provideChandler Carruth3-12/+46
a normal interface for it in Passes.h. This gives us essentially a single interface for running pass managers which are provided from the bottom of the LLVM stack through interfaces at the top of the LLVM stack that populate them with all of the different analyses available throughout. It also means there is a single blob of code that needs to include all of the pass headers and needs to deal with the registry of passes and parsing names. No functionality changed intended, should just be cleanup. llvm-svn: 225237
2015-01-06[PM] Add a utility to the new pass manager for generating a pass whichChandler Carruth1-0/+42
is a no-op other than requiring some analysis results be available. This can be used in real pass pipelines to force the usually lazy analysis running to eagerly compute something at a specific point, and it can be used to test the pass manager infrastructure (my primary use at the moment). I've also added bit of pipeline parsing magic to support generating these directly from the opt command so that you can directly use these when debugging your analysis. The syntax is: require<analysis-name> This can be used at any level of the pass manager. For example: cgscc(function(require<my-analysis>,no-op-function)) This would produce a no-op function pass requiring my-analysis, followed by a fully no-op function pass, both of these in a function pass manager which is nested inside of a bottom-up CGSCC pass manager which is in the top-level (implicit) module pass manager. I have zero attachment to the particular syntax I'm using here. Consider it a straw man for use while I'm testing and fleshing things out. Suggestions for better syntax welcome, and I'll update everything based on any consensus that develops. I've used this new functionality to more directly test the analysis printing rather than relying on the cgscc pass manager running an analysis for me. This is still minimally tested because I need to have analyses to run first! ;] That patch is next, but wanted to keep this one separate for easier review and discussion. llvm-svn: 225236
2015-01-05[dsymutil] Implement the BinaryHolder object and gain archive support.Frederic Riss4-34/+233
This object is meant to own the ObjectFiles and their underlying MemoryBuffer. It is basically the equivalent of an OwningBinary except that it efficiently handles Archives. It is optimized for efficiently providing mappings of members of the same archive when they are opened successively (which is standard in Darwin debug maps, objects from the same archive will be contiguous). Of course, the BinaryHolder will also be used by the DWARF linker once it is commited, but for now only the debug map parser uses it. With this change, you can run llvm-dsymutil on your Darwin debug build of clang and get a complete debug map for it. Differential Revision: http://reviews.llvm.org/D6690 llvm-svn: 225207
2015-01-05[PM] Switch the new pass manager to use a reference-based API for IRChandler Carruth2-4/+4
units. This was debated back and forth a bunch, but using references is now clearly cleaner. Of all the code written using pointers thus far, in only one place did it really make more sense to have a pointer. In most cases, this just removes immediate dereferencing from the code. I think it is much better to get errors on null IR units earlier, potentially at compile time, than to delay it. Most notably, the legacy pass manager uses references for its routines and so as more and more code works with both, the use of pointers was likely to become really annoying. I noticed this when I ported the domtree analysis over and wrote the entire thing with references only to have it fail to compile. =/ It seemed better to switch now than to delay. We can, of course, revisit this is we learn that references are really problematic in the API. llvm-svn: 225145
2015-01-05[PM] Wire up support for explicitly running the verifier pass.Chandler Carruth1-0/+2
The required functionality has been there for some time, but I never managed to actually wire it into the command line registry of passes. Let's do that. llvm-svn: 225144
2015-01-03llvm-readobj: add support to dump COFF export tablesSaleem Abdulrasool3-0/+28
This enhances llvm-readobj to print out the COFF export table, similar to the -coff-import option. This is useful for testing in lld. llvm-svn: 225120
2014-12-29[cmake] Teach the llvm-config program to respect LLVM_LIBDIR_SUFFIX.Chandler Carruth3-4/+9
For this to work, we have to encode it in the build variables and use it from llvm-config.cpp. I've tried to do this reasonably cleanly, but the code for llvm-config.cpp is pretty strange. However, with this, llvm-config stops giving the wrong answer when using LLVM_LIBDIR_SUFFIX. Note that the configure+make build just sets this to an empty string as that build system has zero support for multilib of any form. I'm not planning to add support there either, but this should leave a path for anyone that wanted to. llvm-svn: 224921
2014-12-29[cmake] Start making LLVM_LIBDIR_SUFFIX effective by adding it toChandler Carruth1-1/+1
*numerous* places where it was missing in the CMake build. The primary change here is that the suffix is now actually used for all of the lib directories in the LLVM project's CMake. The various subprojects still need similar treatment. This is the first of a series of commits to try to make LLVM's cmake effective in a multilib Linux installation. I don't think many people are seriously using this variable so I'm hoping the fallout will be minimal. A somewhat unfortunate consequence of the nature of these commits is that until I land all of them, they will in part make the brokenness of our multilib support more apparant. At the end, things should actually work. llvm-svn: 224919
2014-12-24Another attempt to fix the LLVM Windows build bot lld-x86_64-win7, one last ↵Kevin Enderby1-1/+1
place to fix I think. llvm-svn: 224794
2014-12-23Attempt to fix the LLVM Windows build bot lld-x86_64-win7.Kevin Enderby1-1/+1
llvm-svn: 224793
2014-12-23Add printing the LC_THREAD load commands with llvm-objdump’s -private-headers.Kevin Enderby1-0/+352
llvm-svn: 224792
2014-12-23Fix a leak found by asan.Rafael Espindola1-5/+12
llvm-svn: 224776
2014-12-20strnlen isn't available on some platforms, use StringRef insteadDavid Majnemer1-1/+2
llvm-svn: 224679
2014-12-20Unbreak cmake build with shared libraries enabled.Matthias Braun1-0/+1
llvm-svn: 224661
2014-12-19Add printing the LC_ROUTINES load commands with llvm-objdump’s ↵Kevin Enderby1-0/+40
-private-headers. llvm-svn: 224627
2014-12-19Add printing the LC_SUB_CLIENT load command with llvm-objdump’s ↵Kevin Enderby1-0/+18
-private-headers. llvm-svn: 224616
2014-12-19Add printing the LC_SUB_LIBRARY load command with llvm-objdump’s ↵Kevin Enderby1-0/+20
-private-headers. llvm-svn: 224607
2014-12-19LTO: Export local context symbolsDuncan P. N. Exon Smith2-2/+16
Export symbols in libLTO.dylib for the local context-related functions added in r221733 (`LTO_API_VERSION=11`)... and add the missing definition for `lto_codegen_create_in_local_context()`. llvm-svn: 224567
2014-12-18Add printing the LC_SUB_UMBRELLA load command with llvm-objdump’s ↵Kevin Enderby1-0/+19
-private-headers. llvm-svn: 224548
2014-12-18Have llvm-c-test only use libLLVM if libLLVM has all the right components.Chris Bieneman1-3/+21
Summary: We should only have llvm-c-test use libLLVM if the library is built with the default set of components or if LLVM_DYLIB_COMPONENTS includes all the LLVM_LINK_COMPONENTS required for llvm-c-test. Making libLLVM always used causes build failures if libLLVM doesn't include all Reviewers: chapuni, ributzka Reviewed By: ributzka Subscribers: ributzka, llvm-commits Differential Revision: http://reviews.llvm.org/D6668 llvm-svn: 224541
2014-12-18Add printing the LC_SUB_FRAMEWORK load command with llvm-objdump’s ↵Kevin Enderby1-0/+19
-private-headers. llvm-svn: 224534
2014-12-18Modernize the getStreamedBitcodeModule interface a bit. NFC.Rafael Espindola1-4/+8
llvm-svn: 224499
2014-12-18Add printing the LC_LINKER_OPTION load command with llvm-objdump’s ↵Kevin Enderby2-4/+37
-private-headers. Also corrected the name of the load command to not end in an ’S’ as well as corrected the name of the MachO::linker_option_command struct and other places that had the word option as plural which did not match the Mac OS X headers. llvm-svn: 224485
2014-12-18[dsymutil] Fix missing member initializer.Alexey Samsonov1-1/+2
This bug was found by the MSan bootstrap bot: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/5330/steps/check-llvm%20msan/logs/stdio llvm-svn: 224481
2014-12-17Remove unused includes and out of date comment. NFC.Rafael Espindola6-6/+0
llvm-svn: 224413
2014-12-17llvm-lto: Add testing coverage for local contextsDuncan P. N. Exon Smith1-0/+47
Add coverage in `llvm-lto` for the API exposed by libLTO to create modules in local contexts. The goal here isn't to test the symbol-related API extensively, just to confirm that these modules work at all. (I'll be shifting code around soon that should be NFC and I realized there was no test coverage.) llvm-svn: 224408
2014-12-17Add printing the LC_ENCRYPTION_INFO_64 load command with llvm-objdump’s ↵Kevin Enderby1-1/+26
-private-headers and add tests for the two AArch64 binaries. llvm-svn: 224400
2014-12-16Add printing the LC_ENCRYPTION_INFO load command with llvm-objdump’s ↵Kevin Enderby1-0/+24
-private-headers. llvm-svn: 224390
2014-12-16Fix a bug in llvm-objdump’s -private-headers for the LC_VERSION_MIN_IPHONEOSKevin Enderby1-1/+2
load command not getting printed. llvm-svn: 224376
2014-12-16Fix another use of PRIx32 that should have been PRIx64.Kevin Enderby1-2/+2
llvm-svn: 224368
2014-12-16[dsymutil] Pass the verbosity flag down to the processing. NFC for now.Frederic Riss4-6/+9
llvm-svn: 224361
2014-12-16[dsymutil] Avoid calling getStringTableData() for each symbol. NFC.Frederic Riss1-2/+3
llvm-svn: 224360
2014-12-16Fix the arm build bots for a test that was added. A printing routine was ↵Kevin Enderby1-2/+2
incorrectly using PRIx32 when it should have been using PRIx64 for the value that was passed as uint64_t . llvm-svn: 224350
2014-12-16Fix a bug in llvm-objdump’s -private-headers for 32-bit Mach-O filesKevin Enderby1-1/+1
printing the section header. And add some tests for this for 32-bit files. llvm-svn: 224302
2014-12-15Fix line mapping information in LLVM JIT profiling with VtuneAlexey Bataev1-1/+1
The line mapping information for dynamic code is reported incorrectly. It causes VTune to map LLVM generated code to source lines incorrectly. This patch fix this issue. Patch by Denis Pravdin. Differential Revision: http://reviews.llvm.org/D6603 llvm-svn: 224229
2014-12-13Fix Doxygen command misspellings.Benjamin Kramer1-1/+1
Found by -Wdocumentation. llvm-svn: 224197
2014-12-12Initial dsymutil tool commit.Frederic Riss12-2/+640
The goal of this tool is to replicate Darwin's dsymutil functionality based on LLVM. dsymutil is a DWARF linker. Darwin's linker (ld64) does not link the debug information, it leaves it in the object files in relocatable form, but embbeds a `debug map` into the executable that describes where to find the debug information and how to relocate it. When releasing/archiving a binary, dsymutil is called to link all the DWARF information into a `dsym bundle` that can distributed/stored along with the binary. With this commit, the LLVM based dsymutil is just able to parse the STABS debug maps embedded by ld64 in linked binaries (and not all of them, for example archives aren't supported yet). Note that the tool directory is called dsymutil, but the executable is currently called llvm-dsymutil. This discrepancy will disappear once the tool will be feature complete. At this point the executable will be renamed to dsymutil, but until then you do not want it to override the system one. Differential Revision: http://reviews.llvm.org/D6242 llvm-svn: 224134