aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-diff
AgeCommit message (Collapse)AuthorFilesLines
2020-02-26Avoid SmallString.h include in MD5.h, NFCReid Kleckner1-0/+1
Saves 200 includes, which is mostly immaterial.
2019-12-17llvm-diff: Perform structural comparison on GlobalVariables, if possibleDominic Chen1-0/+9
Summary: Names of GlobalVariables may not be preserved depending on compilation options, so prefer a structural diff Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D71582
2019-02-21Fix some include order and file headers issues. NFCFangrui Song1-1/+1
llvm-svn: 354550
2019-01-20Replace llvm::isPodLike<...> by llvm::is_trivially_copyable<...>Serge Guelton1-1/+1
As noted in https://bugs.llvm.org/show_bug.cgi?id=36651, the specialization for isPodLike<std::pair<...>> did not match the expectation of std::is_trivially_copyable which makes the memcpy optimization invalid. This patch renames the llvm::isPodLike trait into llvm::is_trivially_copyable. Unfortunately std::is_trivially_copyable is not portable across compiler / STL versions. So a portable version is provided too. Note that the following specialization were invalid: std::pair<T0, T1> llvm::Optional<T> Tests have been added to assert that former specialization are respected by the standard usage of llvm::is_trivially_copyable, and that when a decent version of std::is_trivially_copyable is available, llvm::is_trivially_copyable is compared to std::is_trivially_copyable. As of this patch, llvm::Optional is no longer considered trivially copyable, even if T is. This is to be fixed in a later patch, as it has impact on a long-running bug (see r347004) Note that GCC warns about this UB, but this got silented by https://reviews.llvm.org/D50296. Differential Revision: https://reviews.llvm.org/D54472 llvm-svn: 351701
2019-01-19Update the file headers across all of the LLVM projects in the monorepoChandler Carruth8-32/+24
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
2018-10-15[TI removal] Make `getTerminator()` return a generic `Instruction`.Chandler Carruth1-2/+2
This removes the primary remaining API producing `TerminatorInst` which will reduce the rate at which code is introduced trying to use it and generally make it much easier to remove the remaining APIs across the codebase. Also clean up some of the stragglers that the previous mechanical update of variables missed. Users of LLVM and out-of-tree code generally will need to update any explicit variable types to handle this. Replacing `TerminatorInst` with `Instruction` (or `auto`) almost always works. Most of these edits were made in prior commits using the perl one-liner: ``` perl -i -ple 's/TerminatorInst(\b.* = .*getTerminator\(\))/Instruction\1/g' ``` This also my break some rare use cases where people overload for both `Instruction` and `TerminatorInst`, but these should be easily fixed by removing the `TerminatorInst` overload. llvm-svn: 344504
2018-09-24Fix llvm-diff anon-func.ll testHans Wennborg1-4/+4
llvm-svn: 342864
2018-09-24llvm-diff: Fix crash on anonymous functionsMatt Arsenault1-2/+26
Not sure what the correct behavior is for this. Skip them and report how many there were. llvm-svn: 342857
2018-04-12Let llvm-diff correctly deal with ↵Brian Gesiak1-2/+35
Undef/ConstantAggregateZero/ConstantVector/IndirectBr Summary: llvm-diff incorrectly reports that there's a diff when input IR contains undef/zeroinitializer/constantvector/indirectbr. (This happens even if two identical files are given, e.g. `llvm-diff x.ll x.ll`) This is fix to the bug report https://bugs.llvm.org/show_bug.cgi?id=33623 . Reviewers: dexonsmith, rjmccall Reviewed By: rjmccall Subscribers: chenwj, mgrang, llvm-commits Differential Revision: https://reviews.llvm.org/D34856 llvm-svn: 329957
2017-12-13Remove redundant includes from tools.Michael Zolotukhin2-2/+0
llvm-svn: 320631
2017-04-12[IR] Redesign the case iterator in SwitchInst to actually be an iteratorChandler Carruth1-9/+7
and to expose a handle to represent the actual case rather than having the iterator return a reference to itself. All of this allows the iterator to be used with common STL facilities, standard algorithms, etc. Doing this exposed some missing facilities in the iterator facade that I've fixed and required some work to the actual iterator to fully support the necessary API. Differential Revision: https://reviews.llvm.org/D31548 llvm-svn: 300032
2017-01-28Cleanup dump() functions.Matthias Braun1-3/+4
We had various variants of defining dump() functions in LLVM. Normalize them (this should just consistently implement the things discussed in http://lists.llvm.org/pipermail/cfe-dev/2014-January/034323.html For reference: - Public headers should just declare the dump() method but not use LLVM_DUMP_METHOD or #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) - The definition of a dump method should look like this: #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) LLVM_DUMP_METHOD void MyClass::dump() { // print stuff to dbgs()... } #endif llvm-svn: 293359
2016-11-19[CMake] llvm-diff depends on intrinsics_genChris Bieneman1-0/+3
llvm-diff.cpp has the following include chain: llvm/IR/Module.h llvm/IR/Function.h llvm/IR/Argument.h llvm/IR/Attributes.h llvm/IR/Attributes.gen This means llvm-diff needs to depend on intrinsics_gen. llvm-svn: 287427
2016-04-18[NFC] Header cleanupMehdi Amini5-6/+1
Removed some unused headers, replaced some headers with forward class declarations. Found using simple scripts like this one: clear && ack --cpp -l '#include "llvm/ADT/IndexedMap.h"' | xargs grep -L 'IndexedMap[<]' | xargs grep -n --color=auto 'IndexedMap' Patch by Eugene Kosov <claprix@yandex.ru> Differential Revision: http://reviews.llvm.org/D19219 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266595
2016-02-18Remove uses of builtin comma operator.Richard Trieu1-3/+7
Cleanup for upcoming Clang warning -Wcomma. No functionality change intended. llvm-svn: 261270
2016-01-27Make more headers self-contained.Benjamin Kramer1-0/+1
A lot of this comes from the new complete type requirement of DenseMap. llvm-svn: 258956
2016-01-26Remove autoconf supportChris Bieneman1-17/+0
Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "I felt a great disturbance in the [build system], as if millions of [makefiles] suddenly cried out in terror and were suddenly silenced. I fear something [amazing] has happened." - Obi Wan Kenobi Reviewers: chandlerc, grosbach, bob.wilson, tstellarAMD, echristo, whitequark Subscribers: chfast, simoncook, emaste, jholewinski, tberghammer, jfb, danalbert, srhines, arsenm, dschuff, jyknight, dsanders, joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D16471 llvm-svn: 258861
2015-10-20llvm-diff: Remove implicit ilist iterator conversions, NFCDuncan P. N. Exon Smith1-2/+2
llvm-svn: 250842
2015-08-05-Wdeprecated clean by making LogBuilder move constructible so it can be ↵David Blaikie2-4/+9
returned by value (in DifferenceEngine::logf) llvm-svn: 244129
2015-03-03Revert "Remove the explicit SDNodeIterator::operator= in favor of the ↵David Blaikie1-2/+0
implicit default" Accidentally committed a few more of these cleanup changes than intended. Still breaking these out & tidying them up. This reverts commit r231135. llvm-svn: 231136
2015-03-03Remove the explicit SDNodeIterator::operator= in favor of the implicit defaultDavid Blaikie1-0/+2
There doesn't seem to be any need to assert that iterator assignment is between iterators over the same node - if you want to reuse an iterator variable to iterate another node, that's perfectly acceptable. Just don't mix comparisons between iterators into disjoint sequences, as usual. llvm-svn: 231135
2014-08-26Return a std::unique_ptr from the IRReader.h functions. NFC.Rafael Espindola1-12/+10
llvm-svn: 216466
2014-08-13Canonicalize header guards into a common format.Benjamin Kramer3-6/+6
Add header guards to files that were missing guards. Remove #endif comments as they don't seem common in LLVM (we can easily add them back if we decide they're useful) Changes made by clang-tidy with minor tweaks. llvm-svn: 215558
2014-07-21Revert "[C++11] Add predecessors(BasicBlock *) / successors(BasicBlock *) ↵Duncan P. N. Exon Smith1-2/+2
iterator ranges." This reverts commit r213474 (and r213475), which causes a miscompile on a stage2 LTO build. I'll reply on the list in a moment. llvm-svn: 213562
2014-07-20[C++11] Add predecessors(BasicBlock *) / successors(BasicBlock *) iterator ↵Manuel Jacob1-2/+2
ranges. Summary: This patch introduces two new iterator ranges and updates existing code to use it. No functional change intended. Test Plan: All tests (make check-all) still pass. Reviewers: dblaikie Reviewed By: dblaikie Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D4481 llvm-svn: 213474
2014-04-28[C++] Use 'nullptr'.Craig Topper1-1/+1
llvm-svn: 207394
2014-04-25[C++] Use 'nullptr'. Tools edition.Craig Topper1-2/+2
llvm-svn: 207176
2014-03-08[C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper1-5/+5
class. llvm-svn: 203345
2014-03-04[Modules] Move CFG.h to the IR library as it defines graph traits overChandler Carruth1-1/+1
IR types. llvm-svn: 202827
2014-03-04[Modules] Move CallSite into the IR library where it belogs. It isChandler Carruth1-1/+1
abstracting between a CallInst and an InvokeInst, both of which are IR concepts. llvm-svn: 202816
2013-12-10[CMake] Update LLVM_LINK_COMPONENTS for each CMakeLists.txt.NAKAMURA Takumi1-1/+5
llvm-svn: 196908
2013-10-01Remove several unused variables.Rafael Espindola1-2/+0
Patch by Alp Toker. llvm-svn: 191757
2013-09-19Revert "Encapsulate PassManager debug flags to avoid static init and cxa_exit."Andrew Trick1-4/+0
Working on a better solution to this. This reverts commit 7d4e9934e7ca83094c5cf41346966c8350179ff2. llvm-svn: 190990
2013-09-18Encapsulate PassManager debug flags to avoid static init and cxa_exit.Andrew Trick1-0/+4
This puts all the global PassManager debugging flags, like -print-after-all and -time-passes, behind a managed static. This eliminates their static initializers and, more importantly, exit-time destructors. The only behavioral change I anticipate is that tools need to initialize the PassManager before parsing the command line in order to export these options, which makes sense. Tools that already initialize the standard passes (opt/llc) don't need to do anything new. llvm-svn: 190974
2013-09-18whitespaceAndrew Trick1-1/+1
llvm-svn: 190973
2013-09-09Revert patches to add case-range support for PR1255.Bob Wilson1-4/+4
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 llvm-svn: 190328
2013-03-26Manually update the dependencies in the Makefiles. It turns out that allChandler Carruth1-1/+1
that work on the LLVMBuild based dependency specification didn't actually work, we just now maintain dependencies in *3* places instead of 2. Yay. There may still be some missing dependencies, I'm still sifting through the bots and my builds, but this is a step in the right direction. llvm-svn: 177988
2013-03-26Split out the IRReader header and the utility functions it provides intoChandler Carruth3-3/+3
its own library. These functions are bridging between the bitcode reader and the ll parser which are in different libraries. Previously we didn't have any good library to do this, and instead played fast and loose with a "header only" set of interfaces in the Support library. This really doesn't work well as evidenced by the recent attempt to add timing logic to the these routines. As part of this, make them normal functions rather than weird inline functions, and sink the implementation into the library. Also clean up the header to be nice and minimal. This requires updating lots of build system dependencies to specify that the IRReader library is needed, and several source files to not implicitly rely upon the header file to transitively include all manner of other headers. If you are using IRReader.h, this commit will break you (the header moved) and you'll need to also update your library usage to include 'irreader'. I will commit the corresponding change to Clang momentarily. llvm-svn: 177971
2013-01-02Move all of the header files which are involved in modelling the LLVM IRChandler Carruth4-10/+10
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. llvm-svn: 171366
2012-12-04Sort the #include lines for tools/...Chandler Carruth6-23/+15
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. llvm-svn: 169252
2012-07-23Fix a typo (the the => the)Sylvestre Ledru1-1/+1
llvm-svn: 160621
2012-06-06Remove unused private fields found by clang's new -Wunused-private-field.Benjamin Kramer3-9/+6
There are some that I didn't remove this round because they looked like obvious stubs. There are dead variables in gtest too, they should be fixed upstream. llvm-svn: 158090
2012-05-29ConstantRangesSet renamed to IntegersSubset. CRSBuilder renamed to ↵Stepan Dyatkovskiy1-1/+1
IntegersSubsetMapping. llvm-svn: 157612
2012-05-19Ordinary PR1255 patch: DifferenceEngine and CPPBackend adopted to the new ↵Stepan Dyatkovskiy1-4/+4
SwitchInst methods. llvm-svn: 157112
2012-03-11llvm::SwitchInstStepan Dyatkovskiy1-2/+2
Renamed methods caseBegin, caseEnd and caseDefault with case_begin, case_end, and case_default. Added some notes relative to case iterators. llvm-svn: 152532
2012-03-08Taken into account Duncan's comments for r149481 dated by 2nd Feb 2012:Stepan Dyatkovskiy1-5/+9
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. llvm-svn: 152297
2012-02-01SwitchInst refactoring.Stepan Dyatkovskiy1-4/+4
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. llvm-svn: 149481
2011-12-20Unweaken vtables as per ↵David Blaikie4-1/+8
http://llvm.org/docs/CodingStandards.html#ll_virtual_anch llvm-svn: 146960
2011-12-12LLVMBuild: Remove trailing newline, which irked me.Daniel Dunbar1-1/+0
llvm-svn: 146409
2011-11-11LLVMBuild: Add description files for the LLVM tools.Daniel Dunbar1-0/+23
llvm-svn: 144417