summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/DebugInfo/DWARF/DwarfUtils.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix DWARF DebugInfo unit test errors when cross-compilingJason Liu2019-06-031-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When building with a Default Target set we can experience issues in the DWARF DebugInfo unit tests because: They assume we can generate object files for the host platform. Some tests assume the endianess of the target we are generating DWARF for and the host match. This patch correct these issues by ensuring the tests which generate objects in memory are run with respect to LVM_DEFAULT_TARGET_TRIPLE and it's endianess. We also make sure we don't use the hosts address size for line test and split the triple util function in DwarfUtils into a version that takes an address size and one that doesn't. See also for discussion: http://lists.llvm.org/pipermail/llvm-dev/2019-March/131212.html Patch by: daltenty Differential Revision: https://reviews.llvm.org/D62084 llvm-svn: 362454
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* IWYU for llvm-config.h in llvm, additions.Nico Weber2018-04-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See r331124 for how I made a list of files missing the include. I then ran this Python script: for f in open('filelist.txt'): f = f.strip() fl = open(f).readlines() found = False for i in xrange(len(fl)): p = '#include "llvm/' if not fl[i].startswith(p): continue if fl[i][len(p):] > 'Config': fl.insert(i, '#include "llvm/Config/llvm-config.h"\n') found = True break if not found: print 'not found', f else: open(f, 'w').write(''.join(fl)) and then looked through everything with `svn diff | diffstat -l | xargs -n 1000 gvim -p` and tried to fix include ordering and whatnot. No intended behavior change. llvm-svn: 331184
* [DWARF] Don't attempt to parse line tables at invalid offsetsJames Henderson2018-03-081-0/+42
Whilst working on improvements to the error handling of the debug line parsing code, I noticed that if an invalid offset were to be specified in a call to getOrParseLineTable(), an entry in the LineTableMap would still be created, even if the offset was not within the section range. The immediate parsing attempt afterwards would fail (it would end up getting a version of 0), and thereafter, any subsequent calls to getOrParseLineTable or getLineTable would return the default- constructed, invalid line table. In reality, we shouldn't even attempt to parse this table, and we should always return a nullptr from these two functions for this situation. I have tested this via a unit test, which required some new framework for unit testing debug line. My plan is to add quite a few more unit tests for the new error reporting mechanism that will follow shortly, hence the reason why the supporting code for the tests are written the way they are - I intend to extend the DwarfGenerator class to support generating debug line. At that point, I'll make sure that there are a few positive test cases for this and the parsing code too. Differential Revision: https://reviews.llvm.org/D44200 Reviewers: JDevlieghere, aprantl llvm-svn: 326995
OpenPOWER on IntegriCloud