summaryrefslogtreecommitdiff
path: root/tools/llvm-diff/DifferenceEngine.cpp
Commit message (Collapse)AuthorAge
* Remove several unused variables.Rafael Espindola2013-10-01
| | | | | | Patch by Alp Toker. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191757 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert patches to add case-range support for PR1255.Bob Wilson2013-09-09
| | | | | | | | | | | | | | | | | The work on this project was left in an unfinished and inconsistent state. Hopefully someone will eventually get a chance to implement this feature, but in the meantime, it is better to put things back the way the were. I have left support in the bitcode reader to handle the case-range bitcode format, so that we do not lose bitcode compatibility with the llvm 3.3 release. This reverts the following commits: 155464, 156374, 156377, 156613, 156704, 156757, 156804 156808, 156985, 157046, 157112, 157183, 157315, 157384, 157575, 157576, 157586, 157612, 157810, 157814, 157815, 157880, 157881, 157882, 157884, 157887, 157901, 158979, 157987, 157989, 158986, 158997, 159076, 159101, 159100, 159200, 159201, 159207, 159527, 159532, 159540, 159583, 159618, 159658, 159659, 159660, 159661, 159703, 159704, 160076, 167356, 172025, 186736 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190328 91177308-0d34-0410-b5e6-96231b3b80d8
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-02
| | | | | | | | | | | | | | | | | | | | | into their new header subdirectory: include/llvm/IR. This matches the directory structure of lib, and begins to correct a long standing point of file layout clutter in LLVM. There are still more header files to move here, but I wanted to handle them in separate commits to make tracking what files make sense at each layer easier. The only really questionable files here are the target intrinsic tablegen files. But that's a battle I'd rather not fight today. I've updated both CMake and Makefile build systems (I think, and my tests think, but I may have missed something). I've also re-sorted the includes throughout the project. I'll be committing updates to Clang, DragonEgg, and Polly momentarily. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171366 91177308-0d34-0410-b5e6-96231b3b80d8
* Sort the #include lines for tools/...Chandler Carruth2012-12-04
| | | | | | | | Again, tools are trickier to pick the main module header for than library source files. I've started to follow the pattern of using LLVMContext.h when it is included as a stub for program source files. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169252 91177308-0d34-0410-b5e6-96231b3b80d8
* ConstantRangesSet renamed to IntegersSubset. CRSBuilder renamed to ↵Stepan Dyatkovskiy2012-05-29
| | | | | | IntegersSubsetMapping. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157612 91177308-0d34-0410-b5e6-96231b3b80d8
* Ordinary PR1255 patch: DifferenceEngine and CPPBackend adopted to the new ↵Stepan Dyatkovskiy2012-05-19
| | | | | | SwitchInst methods. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157112 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm::SwitchInstStepan Dyatkovskiy2012-03-11
| | | | | | | | | Renamed methods caseBegin, caseEnd and caseDefault with case_begin, case_end, and case_default. Added some notes relative to case iterators. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152532 91177308-0d34-0410-b5e6-96231b3b80d8
* Taken into account Duncan's comments for r149481 dated by 2nd Feb 2012:Stepan Dyatkovskiy2012-03-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20120130/136146.html Implemented CaseIterator and it solves almost all described issues: we don't need to mix operand/case/successor indexing anymore. Base iterator class is implemented as a template since it may be initialized either from "const SwitchInst*" or from "SwitchInst*". ConstCaseIt is just a read-only iterator. CaseIt is read-write iterator; it allows to change case successor and case value. Usage of iterator allows totally remove resolveXXXX methods. All indexing convertions done automatically inside the iterator's getters. Main way of iterator usage looks like this: SwitchInst *SI = ... // intialize it somehow for (SwitchInst::CaseIt i = SI->caseBegin(), e = SI->caseEnd(); i != e; ++i) { BasicBlock *BB = i.getCaseSuccessor(); ConstantInt *V = i.getCaseValue(); // Do something. } If you want to convert case number to TerminatorInst successor index, just use getSuccessorIndex iterator's method. If you want initialize iterator from TerminatorInst successor index, use CaseIt::fromSuccessorIndex(...) method. There are also related changes in llvm-clients: klee and clang. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152297 91177308-0d34-0410-b5e6-96231b3b80d8
* SwitchInst refactoring.Stepan Dyatkovskiy2012-02-01
| | | | | | | | | | | | | | | | | | | | The purpose of refactoring is to hide operand roles from SwitchInst user (programmer). If you want to play with operands directly, probably you will need lower level methods than SwitchInst ones (TerminatorInst or may be User). After this patch we can reorganize SwitchInst operands and successors as we want. What was done: 1. Changed semantics of index inside the getCaseValue method: getCaseValue(0) means "get first case", not a condition. Use getCondition() if you want to resolve the condition. I propose don't mix SwitchInst case indexing with low level indexing (TI successors indexing, User's operands indexing), since it may be dangerous. 2. By the same reason findCaseValue(ConstantInt*) returns actual number of case value. 0 means first case, not default. If there is no case with given value, ErrorIndex will returned. 3. Added getCaseSuccessor method. I propose to avoid usage of TerminatorInst::getSuccessor if you want to resolve case successor BB. Use getCaseSuccessor instead, since internal SwitchInst organization of operands/successors is hidden and may be changed in any moment. 4. Added resolveSuccessorIndex and resolveCaseIndex. The main purpose of these methods is to see how case successors are really mapped in TerminatorInst. 4.1 "resolveSuccessorIndex" was created if you need to level down from SwitchInst to TerminatorInst. It returns TerminatorInst's successor index for given case successor. 4.2 "resolveCaseIndex" converts low level successors index to case index that curresponds to the given successor. Note: There are also related compatability fix patches for dragonegg, klee, llvm-gcc-4.0, llvm-gcc-4.2, safecode, clang. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149481 91177308-0d34-0410-b5e6-96231b3b80d8
* Unweaken vtables as per ↵David Blaikie2011-12-20
| | | | | | http://llvm.org/docs/CodingStandards.html#ll_virtual_anch git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146960 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the printing of constants. Patch by Stepan Dyatkovskiy!John McCall2011-11-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144079 91177308-0d34-0410-b5e6-96231b3b80d8
* Silence a bunch (but not all) "variable written but not read" warningsDuncan Sands2011-08-12
| | | | | | | when building with assertions disabled. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137460 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a ton of comment typos found by codespell. Patch byChris Lattner2011-04-15
| | | | | | | | Luis Felipe Strano Moraes! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129558 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't include Operator.h from InstrTypes.h.Jay Foad2011-04-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129271 91177308-0d34-0410-b5e6-96231b3b80d8
* This patch is a big refactoring of llvm-diff. It doesn't add new features, ↵Renato Golin2011-03-14
| | | | | | but it re-organizes the old features, so I can insert the MetadataEngine to use the same infrastructure. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127627 91177308-0d34-0410-b5e6-96231b3b80d8
* Check in a couple of changes that I apparently never committed:John McCall2010-08-24
| | | | | | | | | | | - teach DifferenceEngine to unify successors of calls and invokes in certain circumstances - basic blocks actually don't have their own numbering; did that change? - add llvm-diff to the Makefile and CMake build systems git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111909 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the header self-contained and follow #include guidelines.John McCall2010-07-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109774 91177308-0d34-0410-b5e6-96231b3b80d8
* Centralize the logic to permanently unify two instructions and make sureJohn McCall2010-07-29
| | | | | | | | | it establishes a context and does a complaining diff. Also make sure we unify the prelude and postlude of a diff after a block-diff call. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109744 91177308-0d34-0410-b5e6-96231b3b80d8
* Diagnose non-structural differences in the case where blocks wereJohn McCall2010-07-29
| | | | | | | | structurally identical. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109743 91177308-0d34-0410-b5e6-96231b3b80d8
* When unifying instructions during a block diff, actually complain aboutJohn McCall2010-07-29
| | | | | | | | | | any differences we see. This should only happen if there are "non-structural" differences between the instructions, i.e. differences which wouldn't cause diff to return true. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109742 91177308-0d34-0410-b5e6-96231b3b80d8
* Somehow I was getting reasonable results for the test cases I was interestedJohn McCall2010-07-29
| | | | | | | | | | | | | in despite not ever incrementing any path costs, so that the only nonzero costs arose from the all-left path in the first column. Anyway. Perform the diff starting from the beginning of the block to avoid capturing (say) loads of allocas. Vastly improves diff results on code that hasn't been mem2reg'ed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109741 91177308-0d34-0410-b5e6-96231b3b80d8
* Cache the result of errs() and implement formatted logging.John McCall2010-07-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109740 91177308-0d34-0410-b5e6-96231b3b80d8
* Add the llvm-diff tool, which performs a relatively naive structuralJohn McCall2010-07-29
diff of a function. There's a lot of cruft in the current version, and it's pretty far from perfect, but it's usable. Currently only capable of comparing functions. Currently ignores metadata. Currently ignores most attributes of functions and instructions. Patches welcome. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109739 91177308-0d34-0410-b5e6-96231b3b80d8