summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools
Commit message (Collapse)AuthorAgeFilesLines
* llvm-cov: Warn instead of error if a .gcda has arcs from an exit blockJustin Bogner2015-03-173-0/+4
| | | | | | Patch by Vanderson M. Rosario. Thanks! llvm-svn: 232443
* InstrProf: Fix CoverageMappingReader on big endianJustin Bogner2015-03-162-0/+1
| | | | | | | | This makes the reader check the endianness of the object file its given and behave appropriately. For the test I dug up a really old linker and created a ppc-apple-darwin file for llvm-cov to read. llvm-svn: 232422
* Add the options, -dylibs-used and -dylib-id to llvm-objdump used with -machoKevin Enderby2015-03-161-0/+6
| | | | | | | to print the Mach-O dynamic shared libraries used by a linked image or the library id of a shared library. llvm-svn: 232406
* InstrProf: Remove xfails for big-endian from coverage testsJustin Bogner2015-03-168-24/+0
| | | | | | | | | This still doesn't actually work correctly for big endian input files, but since these tests all use little endian input files they don't actually fail. I'll be committing a real fix for big endian soon, but I don't have proper tests for it yet. llvm-svn: 232354
* InstrProf: Do a better job of reading coverage mapping data.Justin Bogner2015-03-165-4/+15
| | | | | | | | | | | | | | | | | | | | | | This code was casting regions of a memory buffer to a couple of different structs. This is wrong in a few ways: 1. It breaks aliasing rules. 2. If the buffer isn't aligned, it hits undefined behaviour. 3. It completely ignores endianness differences. 4. The structs being defined for this aren't specifying their padding properly, so this doesn't even represent the data properly on some platforms. This commit is mostly NFC, except that it fixes reading coverage for 32 bit binaries as a side effect of getting rid of the mispadded structs. I've included a test for that. I've also baked in that we only handle little endian more explicitly, since that was true in practice already. I'll fix this to handle endianness properly in a followup commit. llvm-svn: 232346
* [dsymutil] Add support to generate .debug_pubnames and .debug_pubtypesFrederic Riss2015-03-163-1/+71
| | | | | | | | The information gathering part of the patch stores a bit more information than what is strictly necessary for these 2 sections. The rest will become useful when we start emitting __apple_* type accelerator tables. llvm-svn: 232342
* Rework r232337. Let llvm/test/tools/dsymutil/X86/basic-linking-x86.test ↵NAKAMURA Takumi2015-03-161-8/+7
| | | | | | dospath-tolerant. llvm-svn: 232339
* Suppress llvm/test/tools/dsymutil/X86/basic-linking-x86.test for now. Will ↵NAKAMURA Takumi2015-03-151-0/+1
| | | | | | fix later. llvm-svn: 232337
* llvm/test/tools/dsymutil/X86/basic-lto-*-linking-x86.test: Relax expressions ↵NAKAMURA Takumi2015-03-152-8/+8
| | | | | | to meet dos path. llvm-svn: 232336
* [dsymutil] Add support for linking line tables.Frederic Riss2015-03-153-1/+138
| | | | | | | | | | | | | | | This code comes with a lot of cruft that is meant to mimic darwin's dsymutil behavior. A much simpler approach (described in the numerous FIXMEs that I put in there) gives the right output for the vast majority of cases. The extra corner cases that are handled differently need to be investigated: they seem to correctly handle debug info that is in the input, but that info looks suspicious in the first place. Anyway, the current code needs to handle this, but I plan to revisit it as soon as the big round of validation against the classic dsymutil is over. llvm-svn: 232333
* llvm-cxxdump: Rename llvm-vtabledump to llvm-cxxdumpDavid Majnemer2015-03-155-3/+3
| | | | | | | llvm-vtabledump has grown enough functionality not related to vtables that it deserves a name which is more descriptive. llvm-svn: 232301
* [dsymutil] Add function size to the debug map.Frederic Riss2015-03-151-22/+22
| | | | | | | | | | | | The debug map embedded by ld64 in binaries conatins function sizes. These sizes are less precise than the ones given by the debug information (byte granularity vs linker atom granularity), but they might cover code that is referenced in the line table but not in the DIE tree (that might very well be a compiler bug that I need to investigate later). Anyway, extracting that information is necessary to be able to mimic dsymutil's behavior exactly. llvm-svn: 232300
* [dsymutil] Add support for debug_loc section.Frederic Riss2015-03-143-2/+36
| | | | | | | | There is no need to look into the location expressions to transfer them, the only modification to apply is to patch their base address to reflect the linked function address. llvm-svn: 232267
* [dsymutil] Generate debug_aranges section.Frederic Riss2015-03-143-0/+26
| | | | | | | | This actually shares most of its implementation with the generation of the debug_ranges (the absence of 'a' is not a typo) contribution for the unit's DW_AT_ranges attribute. llvm-svn: 232246
* [dsymutil] Implement DW_AT_ranges linking.Frederic Riss2015-03-132-1/+7
| | | | | | | Nothing fancy, just a straightforward offset to apply to the original debug_ranges entries to get them in line with the linked addresses. llvm-svn: 232232
* [dsymutil] Fix handling of cross-cu forward references.Frederic Riss2015-03-131-2/+5
| | | | | | | | | | We recorded the forward references in the CU that holds the referenced DIE, but this is wrong as those will get resoled *after* the CU that holds the reference. Record the references in their originating CU along with a pointer to the remote CU to be able to compute the fixed up offset at the right time. llvm-svn: 232193
* [dsymutil] Add relocation of compile_units low_pc/high_pc.Frederic Riss2015-03-133-0/+12
| | | | | | | They need to be handled specifically as they could vary pretty widely depending on how the linker moves functions around. llvm-svn: 232192
* [dsymutil] Fix location cloning for newer dwarf versions.Frederic Riss2015-03-133-0/+94
| | | | | | | | The typo got unnoticed because we were testing only on Dwarf 2. Add a Dwarf4 test that exercises the code path, and also tests some newer FORMs that the other test doesn't cover. llvm-svn: 232191
* [opaque pointer type] Add textual IR support for explicit type parameter to ↵David Blaikie2015-03-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gep operator Similar to gep (r230786) and load (r230794) changes. Similar migration script can be used to update test cases, which successfully migrated all of LLVM and Polly, but about 4 test cases needed manually changes in Clang. (this script will read the contents of stdin and massage it into stdout - wrap it in the 'apply.sh' script shown in previous commits + xargs to apply it over a large set of test cases) import fileinput import sys import re rep = re.compile(r"(getelementptr(?:\s+inbounds)?\s*\()((<\d*\s+x\s+)?([^@]*?)(|\s*addrspace\(\d+\))\s*\*(?(3)>)\s*)(?=$|%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|zeroinitializer|<|\[\[[a-zA-Z]|\{\{)", re.MULTILINE | re.DOTALL) def conv(match): line = match.group(1) line += match.group(4) line += ", " line += match.group(2) return line line = sys.stdin.read() off = 0 for match in re.finditer(rep, line): sys.stdout.write(line[off:match.start()]) sys.stdout.write(conv(match)) off = match.end() sys.stdout.write(line[off:]) llvm-svn: 232184
* Add the option, -non-verbose to llvm-objdump used with -macho to print thingsKevin Enderby2015-03-139-0/+168
| | | | | | | | | | using numeric values and not their symbolic constant names. The routines that print Mach-O stuff already had a verbose parameter and this change is just changing the passing true to passing !NonVerbose. With just a couple of fixes and a bunch of test case updates. llvm-svn: 232182
* Add the option, -info-plist to llvm-objdump used with -macho to print theKevin Enderby2015-03-111-0/+7
| | | | | | Mach-O info plist section as strings. llvm-svn: 231974
* [dsymutil] Correctly clone address attributes.Frederic Riss2015-03-112-0/+12
| | | | | | | DW_AT_low_pc on functions is taken care of by the relocation processing, but DW_AT_high_pc and DW_AT_low_pc on other lexical scopes need special handling. llvm-svn: 231955
* Now that r231902's test is executed, make it actually passJustin Bogner2015-03-112-2/+2
| | | | | | | | As of r231908, the test I added in r231902 actually gets run - but I'd checked in a stale version of the input so it didn't pass. Fix the input and un-xfail the test. llvm-svn: 231911
* Make test added in r231902 actually be executed.Daniel Jasper2015-03-112-3/+3
| | | | | | | | | There were also errors in the CHECK line which I fixed and the test doesn't actually pass as the "100" is in the wrong line. Not sure whether this is a test failure or a coverage failure so making the test XFAIL for now. llvm-svn: 231908
* InstrProf: Teach llvm-cov to handle universal binaries when given -archJustin Bogner2015-03-113-0/+17
| | | | llvm-svn: 231902
* InstrProf: Use the proftext format for these coverage testsJustin Bogner2015-03-096-3/+24
| | | | | | This format's easier to understand and update by hand. llvm-svn: 231686
* InstrProf: Allow hexadecimal function hashes in proftext formatJustin Bogner2015-03-091-2/+10
| | | | llvm-svn: 231685
* [dsymutil] Apply relocations to DIE data before cloning.Frederic Riss2015-03-072-2/+18
| | | | | | | | | | | | | Doing this gets function's low_pc and global variable's locations right in the output debug info. It also could get right other attributes that need to be relocated (in linker terms), but I don't know of any other than the address attributes. This doesn't fixup low_pc attributes in compile_unit, lexical_block or inlined subroutine, nor does it get right high_pc attributes for function. This will come in a subsequent commit. llvm-svn: 231544
* [dsymutil] Support cloning DIE reference attributes.Frederic Riss2015-03-062-0/+35
| | | | | | | | | | Reference attributes are mainly handled by just creating DIEEntry attributes for them. There is a special case for DW_FORM_ref_addr attributes though, because the DIEEntry code needs a DwarfDebug code to emit them (and we don't have one as we do no CodeGen). In that case, just use DIEInteger attributes with the right form. llvm-svn: 231531
* [dsymutil] Add debug_str construction support.Frederic Riss2015-03-062-2/+49
| | | | | | With this comes the ability to correctly clone string attributes in DIEs. llvm-svn: 231493
* [dsymutil] Add minimal code to emit DIE trees.Frederic Riss2015-03-042-0/+126
| | | | | | | | | | | | | | | | | | | This commit adds code to emit DIE trees that have been pruned from the parts that haven't been marked as kept in the previous pass. It works by 'cloning' the input DIE tree (as read by libDebugInfoDwarf) into a tree of DIE objects. Cloning the DIEs means essentially cloning their attributes. The code in this commit does only handle scalar and block attributes (scalar because they are trivial, blocks because they can't be easily replaced by a scalr placeholder), all the other ones are replaced by placeholder zero values and will be handled in further commits. The added tests mostly check that the DIE tree has the correct layout and also verify that a few chosen scalar and block attributes correctly make their way into the output. llvm-svn: 231300
* Bring r231132 back with a fix.Rafael Espindola2015-03-041-0/+22
| | | | | | | | | | The issue was that we were always printing the remarks. Fix that and add a test showing that it prints nothing if -pass-remarks is not given. Original message: Correctly handle -pass-remarks in the gold plugin. llvm-svn: 231273
* Revert r231132, "Correctly handle -pass-remarks in the gold plugin.", for ↵NAKAMURA Takumi2015-03-041-17/+0
| | | | | | now, to suppress log floodng in LTO. llvm-svn: 231253
* [llvm-pdbdump] Display full enum definitions.Zachary Turner2015-03-042-7/+26
| | | | | | | | | | | This will now display enum definitions both at the global scope as well as nested inside of classes. Additionally, it will no longer display enums at the global scope if the enum is nested. Instead, it will omit the definition of the enum globally and instead emit it in the corresponding class definition. llvm-svn: 231215
* Correctly handle -pass-remarks in the gold plugin.Rafael Espindola2015-03-031-0/+17
| | | | llvm-svn: 231132
* lit: Add 'cd' support to the internal shell and port some testsReid Kleckner2015-03-021-1/+2
| | | | | | | | | | | The internal shell was already threading around a 'cwd' parameter. We just have to make it mutable so that we can update it as the test script executes. If the shell ever grows support for environment variable substitution, we could also implement support for export. llvm-svn: 231017
* Add r230655 back with a fix.Rafael Espindola2015-03-022-0/+8
| | | | | | | | | | | | | | | | | | | | The issue is that now we have a diag handler during optimizations and get forward every optimization remark, flooding stdout. The same filtering should probably be done with or without a custom handler, but for now just ignore remarks. Original message: gold-plugin: "Upgrade" debug info and handle its warnings. The gold plugin never calls MaterializeModule, so any old debug info was not deleted and could cause crashes. Now that it is being "upgraded", the plugin also has to handle warnings and create Modules with a nice id (it shows in the warning). llvm-svn: 230991
* [llvm-pdbdump] Many minor fixes and improvementsZachary Turner2015-03-024-1/+122
| | | | | | | | | | | | | | | | | A short list of some of the improvements: 1) Now supports -all command line argument, which implies many other command line arguments to simplify usage. 2) Now supports -no-compiler-generated command line argument to exclude compiler generated types. 3) Prints base class list. 4) -class-definitions implies -types. 5) Proper display of bitfields. 6) Can now distinguish between struct/class/interface/union. And a few other minor tweaks. llvm-svn: 230933
* [llvm-pdbdump] Add regex-based filtering.Zachary Turner2015-03-014-0/+106
| | | | llvm-svn: 230888
* Revert r230655, "gold-plugin: "Upgrade" debug info and handle its warnings."NAKAMURA Takumi2015-03-012-8/+0
| | | | | | It emits *millions of warnings* during selfhosting LTO build, to choke the buildbot with gigbytes of log. llvm-svn: 230885
* Remove option.ll as part of the Forward Control Flow IntegrityEric Christopher2015-02-281-39/+0
| | | | | | removal. llvm-svn: 230844
* [dsymutil] Add the DwarfStreamer class.Frederic Riss2015-02-283-3/+13
| | | | | | | | | | | | | | | | | | | | This class is responsible for getting the linked data to the disk in the appropriate form. Today it it an empty shell that just instantiates an MC layer. As we do not put anything in the resulting file yet, we just check it has the right architecture (and check that -o does the right thing). To be able to create all the components, this commit adds a few dependencies to llvm-dsymutil, namely all-targets, MC and AsmPrinter. Also add a -no-output option, so that tests that do not need the binary result can continue to run even if they do not have the required target linked in. llvm-svn: 230824
* llvm-vtabledump: Update field with a better nameDavid Majnemer2015-02-271-13/+13
| | | | llvm-svn: 230804
* [opaque pointer type] Add textual IR support for explicit type parameter to ↵David Blaikie2015-02-272-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | load instruction Essentially the same as the GEP change in r230786. A similar migration script can be used to update test cases, though a few more test case improvements/changes were required this time around: (r229269-r229278) import fileinput import sys import re pat = re.compile(r"((?:=|:|^)\s*load (?:atomic )?(?:volatile )?(.*?))(| addrspace\(\d+\) *)\*($| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$)") for line in sys.stdin: sys.stdout.write(re.sub(pat, r"\1, \2\3*\4", line)) Reviewers: rafael, dexonsmith, grosser Differential Revision: http://reviews.llvm.org/D7649 llvm-svn: 230794
* [opaque pointer type] Add textual IR support for explicit type parameter to ↵David Blaikie2015-02-272-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | getelementptr instruction One of several parallel first steps to remove the target type of pointers, replacing them with a single opaque pointer type. This adds an explicit type parameter to the gep instruction so that when the first parameter becomes an opaque pointer type, the type to gep through is still available to the instructions. * This doesn't modify gep operators, only instructions (operators will be handled separately) * Textual IR changes only. Bitcode (including upgrade) and changing the in-memory representation will be in separate changes. * geps of vectors are transformed as: getelementptr <4 x float*> %x, ... ->getelementptr float, <4 x float*> %x, ... Then, once the opaque pointer type is introduced, this will ultimately look like: getelementptr float, <4 x ptr> %x with the unambiguous interpretation that it is a vector of pointers to float. * address spaces remain on the pointer, not the type: getelementptr float addrspace(1)* %x ->getelementptr float, float addrspace(1)* %x Then, eventually: getelementptr float, ptr addrspace(1) %x Importantly, the massive amount of test case churn has been automated by same crappy python code. I had to manually update a few test cases that wouldn't fit the script's model (r228970,r229196,r229197,r229198). The python script just massages stdin and writes the result to stdout, I then wrapped that in a shell script to handle replacing files, then using the usual find+xargs to migrate all the files. update.py: import fileinput import sys import re ibrep = re.compile(r"(^.*?[^%\w]getelementptr inbounds )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))") normrep = re.compile( r"(^.*?[^%\w]getelementptr )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))") def conv(match, line): if not match: return line line = match.groups()[0] if len(match.groups()[5]) == 0: line += match.groups()[2] line += match.groups()[3] line += ", " line += match.groups()[1] line += "\n" return line for line in sys.stdin: if line.find("getelementptr ") == line.find("getelementptr inbounds"): if line.find("getelementptr inbounds") != line.find("getelementptr inbounds ("): line = conv(re.match(ibrep, line), line) elif line.find("getelementptr ") != line.find("getelementptr ("): line = conv(re.match(normrep, line), line) sys.stdout.write(line) apply.sh: for name in "$@" do python3 `dirname "$0"`/update.py < "$name" > "$name.tmp" && mv "$name.tmp" "$name" rm -f "$name.tmp" done The actual commands: From llvm/src: find test/ -name *.ll | xargs ./apply.sh From llvm/src/tools/clang: find test/ -name *.mm -o -name *.m -o -name *.cpp -o -name *.c | xargs -I '{}' ../../apply.sh "{}" From llvm/src/tools/polly: find test/ -name *.ll | xargs ./apply.sh After that, check-all (with llvm, clang, clang-tools-extra, lld, compiler-rt, and polly all checked out). The extra 'rm' in the apply.sh script is due to a few files in clang's test suite using interesting unicode stuff that my python script was throwing exceptions on. None of those files needed to be migrated, so it seemed sufficient to ignore those cases. Reviewers: rafael, dexonsmith, grosser Differential Revision: http://reviews.llvm.org/D7636 llvm-svn: 230786
* llvm-vtabledump: Dump catch/throw exception structures for MS ABIDavid Majnemer2015-02-272-0/+258
| | | | llvm-svn: 230713
* gold-plugin: "Upgrade" debug info and handle its warnings.Rafael Espindola2015-02-262-0/+8
| | | | | | | | | | The gold plugin never calls MaterializeModule, so any old debug info was not deleted and could cause crashes. Now that it is being "upgraded", the plugin also has to handle warnings and create Modules with a nice id (it shows in the warning). llvm-svn: 230655
* InstrProf: Teach llvm-cov to show the max count instead of the lastJustin Bogner2015-02-231-2/+2
| | | | | | | | | | | | When multiple regions start on the same line, llvm-cov was just showing the count of the last one as the line count. This can be confusing and misleading for things like one-liner loops, where the count at the end isn't very interesting, or even "if" statements with an opening brace at the end of the line. Instead, use the maximum of all of the region start counts. llvm-svn: 230263
* [Objdump] Fixing crash when printing symbols in ELF sections with special types.Colin LeMahieu2015-02-182-0/+3
| | | | llvm-svn: 229759
* Modify llvm-readobj to dump symbol record bytes.Zachary Turner2015-02-181-14/+14
| | | | | | | | | | This will help us study the format of individual symbol records more closely. Differential Revision: http://reviews.llvm.org/D7664 Reviewed by: Timur Iskhodzhanov llvm-svn: 229730
OpenPOWER on IntegriCloud