summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/MC/CMakeLists.txt
Commit message (Collapse)AuthorAgeFilesLines
* [MC] Fix undefined behavior in MCInstPrinter::formatHexJonas Devlieghere2019-09-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Passing INT64_MIN to MCInstPrinter::formatHex triggers undefined behavior because the negation of -9223372036854775808 cannot be represented in type 'int64_t' (aka 'long long'). This patch puts a workaround in place to just print the hex value directly. A possible alternative involves using a small helper functions that uses (implementation) defined conversions to achieve the desirable value: static int64_t helper(int64_t V) { auto U = static_cast<uint64_t>(V); return V < 0 ? -U : U; } The underlying problem is that MCInstPrinter::formatHex(int64_t) returns a format_object<int64_t> and should really return a format_object<uint64_t>. However, that's not possible because formatImm needs to be able to print both as decimal (where a signed is required) and hex (where we'd prefer to always have an unsigned). format_object<int64_t> formatImm(int64_t Value) const { return PrintImmHex ? formatHex(Value) : formatDec(Value); } Differential revision: https://reviews.llvm.org/D67236 llvm-svn: 371159
* Move ObjectYAML code to a new library.Rafael Espindola2016-03-011-1/+0
| | | | | | | It is only ever used by obj2yaml and yaml2obj. No point in linking it everywhere. llvm-svn: 262368
* [unittests] Move TargetRegistry test from Support to MCReid Kleckner2016-02-031-0/+1
| | | | | | | This removes the dependency from SupportTests to all of the LLVM backends, and makes it link faster. llvm-svn: 259705
* [MCDwarf] Fix encoding of line tables with weird custom parametersFrederic Riss2016-01-311-0/+1
| | | | | | | | | | | | | | | | With poorly chosen custom parameters, the line table encoding logic would sometimes end up generating a special opcode bigger than 255, which is wrong. The set of default parameters that LLVM uses isn't subject to this bug. When carefully chosing the line table parameters, it's impossible to fall into the corner case that this patch fixes. The standard however doesn't require that these parameters be carefully chosen. And even if it did, we shouldn't generate broken encoding. Add a unittest for this specific encoding bug, and while at it, create some unit tests for the encoding logic using different sets of parameters. llvm-svn: 259334
* Cleaning out google tests from MC.Colin LeMahieu2014-11-251-6/+0
| | | | llvm-svn: 222770
* Fix a regression on the disassembling C API.Rafael Espindola2014-11-131-0/+3
| | | | | | | | | The fix is easy. Unfortunately, we had 0 tests, so adding one was somewhat complicated. Thanks to Kevin Enderby for the report. llvm-svn: 221899
* [Hexagon] Reverting 220584 to address ASAN errors.Colin LeMahieu2014-11-041-0/+6
| | | | llvm-svn: 221210
* [Hexagon] Resubmission of 220427Colin LeMahieu2014-10-241-6/+0
| | | | | | | | | | | Modified library structure to deal with circular dependency between HexagonInstPrinter and HexagonMCInst. Adding encoding bits for add opcode. Adding llvm-mc tests. Removing unit tests. http://reviews.llvm.org/D5624 llvm-svn: 220584
* [CMake] Prune trailing whitespace.NAKAMURA Takumi2014-10-231-1/+1
| | | | llvm-svn: 220479
* Revert r220427, "[Hexagon] Adding encoding bits for add opcode."NAKAMURA Takumi2014-10-231-0/+6
| | | | | | It brought cyclic dependecy between HexagonAsmPrinter and HexagonDesc. llvm-svn: 220478
* [Hexagon] Adding encoding bits for add opcode.Colin LeMahieu2014-10-221-6/+0
| | | | | | | | | Adding llvm-mc tests. Removing unit tests. http://reviews.llvm.org/D5624 llvm-svn: 220427
* Adding skeleton for unit testing Hexagon Code EmissionSid Manning2014-10-031-0/+6
| | | | | | | | | | | Adding and modifying CMakeLists.txt files to run unit tests under unittests/Target/* if the directory exists. Adding basic unit test to check that code emitter object can be retrieved. Differential Revision: http://reviews.llvm.org/D5523 Change by: Colin LeMahieu llvm-svn: 218986
* Nuke MCAnalysis.Sean Silva2014-09-021-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code is buggy and barely tested. It is also mostly boilerplate. (This includes MCObjectDisassembler, which is the interface to that functionality) Following an IRC discussion with Jim Grosbach, it seems sensible to just nuke the whole lot of functionality, and dig it up from VCS if necessary (I hope not!). All of this stuff appears to have been added in a huge patch dump (look at the timeframe surrounding e.g. r182628) where almost every patch seemed to be untested and not reviewed before being committed. Post-review responses to the patches were never addressed. I don't think any of it would have passed pre-commit review. I doubt anyone is depending on this, since this code appears to be extremely buggy. In limited testing that Michael Spencer and I did, we couldn't find a single real-world object file that wouldn't crash the CFG reconstruction stuff. The symbolizer stuff has O(n^2) behavior and so is not much use to anyone anyway. It seemed simpler to remove them as a whole. Most of this code is boilerplate, which is the only way it was able to scrape by 60% coverage. HEADSUP: Modules folks, some files I nuked were referenced from include/llvm/module.modulemap; I just deleted the references. Hopefully that is the right fix (one was a FIXME though!). llvm-svn: 216983
* [CMake] Update libdeps.NAKAMURA Takumi2014-07-141-0/+2
| | | | llvm-svn: 212920
* Invert the MC -> Object dependency.Rafael Espindola2014-07-031-0/+2
| | | | | | | | | Now that we have a lib/MC/MCAnalysis, the dependency was there just because of two helper classes. Move the two over to MC. This will allow IRObjectFile to parse inline assembly. llvm-svn: 212248
* Move CFG building code to a new lib/MC/MCAnalysis library.Rafael Espindola2014-07-021-6/+2
| | | | | | | The new library is 150KB on a Release+Asserts build, so it is quiet a bit of code that regular users of MC don't need to link with now. llvm-svn: 212209
* Fix MCDataAtom never calling remap when adding data.Rafael Espindola2013-10-161-0/+11
This patch fixes a small mistake in MCDataAtom::addData() where it doesn't ever call remap(): - if (Data.size() > Begin - End - 1) + if (Data.size() > End + 1 - Begin) remap(Begin, End + 1); This is currently not visible because of another bug is the disassembler, so the patch includes a unit test. Patch by Stephen Checkoway. llvm-svn: 192823
OpenPOWER on IntegriCloud