summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Verifier: Explicitly verify type referencesDuncan P. N. Exon Smith2015-03-311-83/+93
| | | | | | | | | | | | | `verifyDebugInfo()` was doing two things: - Asserting on unresolved type references. - Calling `Verify()` functions for various types of debug info. The `Verify()` functions have been gutted, so rename the function to `verifyTypeRefs()` and explicitly check those. Instead of assertions, we get nice error messages now. llvm-svn: 233664
* Verifier: Move over DISubprogram::Verify()Duncan P. N. Exon Smith2015-03-312-33/+40
| | | | | | | | | | | | | Move over the remaining (somewhat complicated) check from `DISubprogram::Verify()`. I suspect this check could be optimized -- e.g., it would be nice not to do another full traversal here -- but it's not exactly obvious how. For now, just bring it over as is. Once we have a better model for the "canonical" subprogram of a `Function`, we should enforce that all `!dbg` attachments lead to the canonical one. llvm-svn: 233663
* DebugInfo: Rewrite llvm::getDISubprogram(), NFCDuncan P. N. Exon Smith2015-03-311-11/+3
| | | | | | | | Simplify implementation of `llvm::getDISubprogram()`. I might go through and see how difficult it is to update the users, since this function doesn't really seem necessary anymore. llvm-svn: 233662
* DebugInfo: Hide isScopeRef() and isTypeRef() behind NDEBUGDuncan P. N. Exon Smith2015-03-311-1/+1
| | | | | | | | | The copies of these in `lib/IR/DebugInfo.cpp` are apparently [1] only used in assertions now, so hide them behind `#ifndef NDEBUG`. [1]: http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/9238 llvm-svn: 233661
* Verifier: Check reference flags in debug infoDuncan P. N. Exon Smith2015-03-312-18/+13
| | | | | | Move over checks of `&` and `&&` flags. llvm-svn: 233658
* Verifier: Move more debug info checks away from Verify()Duncan P. N. Exon Smith2015-03-313-44/+11
| | | | | | | | | | Most of these checks were already in the `Verifier` so this is more of a cleanup. Now almost everything is over there. Now that require a `name:` for `MDGlobalVariable`, add a check in `LLParser` for it. llvm-svn: 233657
* Verifier: Move checks over from DIDescriptor::Verify()Duncan P. N. Exon Smith2015-03-313-57/+37
| | | | | | | | | | | | | | Move over some more checks from `DIDescriptor::Verify()`, and change `LLParser` to require non-null `file:` fields in compile units. I've ignored the comment in test/Assembler/metadata-null-operands.ll since I disagree with it. At the time that test was written (r229960), the debug info verifier wasn't on by default, so my comment there is in the context of not expecting the verifier to be useful. It is now, and besides that, since r233394 we can check when parsing textual IR whether an operand is null that shouldn't be. llvm-svn: 233654
* [AArch64] Fix poor codegen for add immediate.Quentin Colombet2015-03-311-0/+2
| | | | | | | We used to match the register variant before the immediate when the register argument could be implicitly zero-extended. llvm-svn: 233653
* DebugInfo: Remove LexicalBlockFile scope/context distinctionDuncan P. N. Exon Smith2015-03-311-12/+3
| | | | | | | | | | | | | | Two things here: 1. I read `getScope()` and `getContext()` backwards in r233640. There was no need for `getScopeOfScope()`. Obviously not enough test coverage here (as I said in that commit, I'm going to come back to that), but anyway I'm reverting to the behaviour before r233640. 2. The callers that use `DILexicalBlockFile::getContext()` don't seem to care about the difference. Just have it redirect to `getScope()` so I can't get confused again. llvm-svn: 233650
* Replace the MCSubtargetInfo parameter with a Triple when creatingEric Christopher2015-03-3116-49/+47
| | | | | | | an MCInstPrinter. Update all callers and use where we wanted a Triple previously. llvm-svn: 233648
* LexicalScopes: Cleanup remaining uses of DebugLocDuncan P. N. Exon Smith2015-03-301-8/+6
| | | | llvm-svn: 233644
* DebugLoc: Remove getFromDILexicalBlock()Duncan P. N. Exon Smith2015-03-302-19/+7
| | | | | | | | | The only user of `DebugLoc::getFromDILexicalBlock()` was creating a new `MDLocation` as convenient API for passing an `MDScope`. Stop doing that, and remove the API. If in the future we actually *want* to create new DebugLocs, calling `MDLexicalBlock::get()` makes more sense. llvm-svn: 233643
* LexicalScopes: Use debug info hierarchy pervasivelyDuncan P. N. Exon Smith2015-03-302-36/+46
| | | | | | | | | | | | | | | | | | | | | | | | | Pervasively use the types provided by the debug info hierarchy rather than `MDNode` in `LexicalScopes`. I noticed (again, I guess, based on comments in the implementation?) that `DILexicalBlockFile::getScope()` returns something different from `DILexicalBlockFile::getContext()`. I created a local helper for getting the same logic from `MDLexicalBlockFile` called `getScopeOfScope()`. I still don't really understand it, but I've added some FIXMEs and I'll come back to it (I suspect the way we encode these objects isn't really ideal). Note that my previous commit r233610 accidentally changed behaviour in `findLexicalScope()` -- it transitioned from a call to `DILexicalBlockFile::getScope()` to `MDLexicalBlockFile::getScope()` (sounds right, doesn't it?) -- so I've fixed that as a drive-by. No tests failed with my error, so it looks like we're missing some coverage here... when I come back to understand the logic, I'll see if I can add some. Other than the fix to `findLexicalScope()`, no functionality change. llvm-svn: 233640
* Silence an unused variable warning.David Majnemer2015-03-301-0/+2
| | | | | | No functional change intended. llvm-svn: 233639
* Move lib/Fuzzer docs from a README.txt to a proper .rst file.Kostya Serebryany2015-03-301-111/+1
| | | | | | | | | | | | | | | | | | Summary: Move lib/Fuzzer docs from a README.txt to a proper .rst file. This change does not add any content, just formatting. Test Plan: n/a Reviewers: samsonov Reviewed By: samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D8710 llvm-svn: 233638
* [fuzzer] when a single unit takes over 1 second to run and it is the slowest ↵Kostya Serebryany2015-03-302-4/+17
| | | | | | one so far, print it. llvm-svn: 233637
* [WinEH] Run cleanup handlers when an exception is thrownDavid Majnemer2015-03-3012-91/+454
| | | | | | | | Generate tables in the .xdata section representing what actions to take when an exception is thrown. This currently fills in state for cleanups, catch handlers are still unfinished. llvm-svn: 233636
* Transfer implicit operands when expanding the RET_ReallyLR pseudo instruction.Juergen Ributzka2015-03-301-3/+6
| | | | | | | | | | | | When we expand the RET_ReallyLR pseudo instruction we also need to transfer the implicit operands. The return register is an implicit operand and without it the liveness calculation generates an incorrect live-out set for the patchpoint. This fixes rdar://problem/19068476. llvm-svn: 233635
* [fuzzer] print various stats in a unified wayKostya Serebryany2015-03-302-21/+25
| | | | llvm-svn: 233624
* [bpf] add support for bswap instructionsAlexei Starovoitov2015-03-302-1/+27
| | | | | | | BPF has cpu_to_be and cpu_to_le instructions. For now assume little endian and generate cpu_to_be for ISD::BSWAP. llvm-svn: 233620
* [bpf] fix buildAlexei Starovoitov2015-03-301-2/+2
| | | | | | | fix build broken due to r233599. Would still need to switch to MDLocation long term. llvm-svn: 233619
* Rename const char *Triple argument to TT to avoid shadowing llvm::Triple.Eric Christopher2015-03-301-21/+20
| | | | llvm-svn: 233615
* Remove unused MCSubtargetInfo argument from the X86 MCInstPrinter ctors.Eric Christopher2015-03-302-2/+2
| | | | llvm-svn: 233614
* DFSan-based fuzzer (proof of concept).Kostya Serebryany2015-03-3011-4/+361
| | | | | | | | | | | | | | | | | | Summary: This adds a simple DFSan-based (i.e. taint-guided) fuzzer mutator, see the comments for details. Test Plan: a test added Reviewers: samsonov, pcc Reviewed By: samsonov, pcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D8669 llvm-svn: 233613
* Remove unused MCSubtargetInfo argument from the Sparc MCInstPrinter ctors.Eric Christopher2015-03-302-6/+4
| | | | llvm-svn: 233612
* Remove unused MCSubtargetInfo argument from the NVPTX MCInstPrinter ctors.Eric Christopher2015-03-303-6/+4
| | | | llvm-svn: 233611
* LexicalScopes: Use MDLocation directly instead of DebugLocDuncan P. N. Exon Smith2015-03-301-12/+10
| | | | | | | There's no benefit to using `DebugLoc` here. Moreover, this will let a follow-up commit work with `MDScope` directly instead of `DebugLoc`. llvm-svn: 233610
* Remove unused MCSubtargetInfo argument from the ARM MCInstPrinter ctors.Eric Christopher2015-03-303-4/+3
| | | | llvm-svn: 233609
* Remove unused MCSubtargetInfo argument from the AArch64 MCInstPrinter ctors.Eric Christopher2015-03-303-10/+7
| | | | llvm-svn: 233608
* Remove unused Target argument from MCInstPrinter ctor functions.Eric Christopher2015-03-3014-34/+22
| | | | llvm-svn: 233607
* [RegisterCoalescer] Fix a potential misuse of direct operand index in theQuentin Colombet2015-03-301-4/+6
| | | | | | | terminal rule. Spot by code inspection. llvm-svn: 233606
* [opaque pointer type] Change GetElementPtrInst::getIndexedType to take the ↵David Blaikie2015-03-3010-26/+35
| | | | | | | | | | pointee type This pushes the use of PointerType::getElementType up into several callers - I'll essentially just have to keep pushing that up the stack until I can eliminate every call to it... llvm-svn: 233604
* Fix PR23045.Rafael Espindola2015-03-302-10/+31
| | | | | | | | | Keep a note in the materializer that we are stripping debug info so that user doing a lazy read of the module don't hit outdated formats. Thanks to Duncan for suggesting the fix. llvm-svn: 233603
* DwarfDebug: Avoid creating new DebugLocs in the backendDuncan P. N. Exon Smith2015-03-302-5/+9
| | | | | | | Don't use `DebugLoc::getFnDebugLoc()`, which creates new `MDLocation`s, in the backend. We just want to grab the subprogram here anyway. llvm-svn: 233601
* DebugInfo: Remove dead code from old DebugLoc APIDuncan P. N. Exon Smith2015-03-301-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove old API for `DebugLoc` now that all the callers have been updated. If this broke your out-of-tree build, here's a quick map from the old API to the new one: DebugLoc DebugLoc::getFromMDLocation(MDNode *) => DebugLoc::DebugLoc(MDLocation *) => explicit DebugLoc::DebugLoc(MDNode *) // works with broken code MDNode *DebugLoc::getAsMDNode(LLVMContext &) => MDLocation *DebugLoc::get() => DebugLoc::operator MDLocation *() => MDNode *DebugLoc::getAsMDNode() // works with broken code bool DebugLoc::isUnknown() => DebugLoc::operator MDLocation *() i.e.: if (MDLocation *DL = ...) => DebugLoc::operator bool() // works with broken code i.e.: if (DebugLoc DL = ...) void DebugLoc::getScopeAndInlinedAt(MDNode *&, MDNode *&) => use: MDNode *DebugLoc::getScope() and: MDLocation *DebugLoc::getInlinedAt() MDNode *DebugLoc::getScopeNode(LLVMContext &) => MDNode *DebugLoc::getInlinedAtScope() void DebugLoc::dump(LLVMContext &) => void DebugLoc::dump() void DebugLoc::getFnDebugLoc(LLVMContext &) => void DebugLoc::getFnDebugLoc() MDNode *DebugLoc::getScope(LLVMContext &) => MDNode *DebugLoc::getScope() MDNode *DebugLoc::getInlinedAt(LLVMContext &) => MDLocation *DebugLoc::getInlinedAt() I've noted above the only functions that won't crash on broken code (due to downcasting to `MDLocation`). If your code could be dealing with broken IR (i.e., you haven't run the verifier yet, or you've used a temporary node that will eventually (but not yet) get RAUW'ed to an `MDLocation`), you need to restrict yourself to those. llvm-svn: 233599
* Use range loops and add missing braces.Rafael Espindola2015-03-301-7/+7
| | | | llvm-svn: 233598
* [opaque pointer type] More IRBuilder::createGEP (non-inbounds) migrations: ↵David Blaikie2015-03-302-12/+13
| | | | | | CodeGenPrepare and SimplifyLibCalls llvm-svn: 233596
* MC: For variable symbols, maintain MCSymbol::Section as a cache.Peter Collingbourne2015-03-304-29/+4
| | | | | | | | | | | This fixes the visibility of symbols in certain edge cases involving aliases with multiple levels of indirection. Fixes PR19582. Differential Revision: http://reviews.llvm.org/D8586 llvm-svn: 233595
* Transforms: Use the new DebugLoc API, NFCDuncan P. N. Exon Smith2015-03-307-28/+30
| | | | | | Update lib/Analysis and lib/Transforms to use the new `DebugLoc` API. llvm-svn: 233587
* IR: Use the new DebugLoc API, NFCDuncan P. N. Exon Smith2015-03-306-39/+28
| | | | | | | | Update lib/IR and lib/Bitcode to use the new `DebugLoc` API. Added an explicit conversion to `bool` (avoiding a conversion to `MDLocation`), since a couple of these use cases need to handle broken code. llvm-svn: 233585
* [NVPTX] Associate a minimum PTX version for each SM architectureJustin Holewinski2015-03-301-9/+5
| | | | | | | | | | When a new SM architecture is introduced, it is only supported by the current PTX version and later. Make sure we are using at least the minimum PTX version for the target architecture. This also removes support for PTX ISA < 3.2. llvm-svn: 233583
* CodeGen: Use the new DebugLoc API, NFCDuncan P. N. Exon Smith2015-03-309-60/+39
| | | | | | Update lib/CodeGen (and lib/Target) to use the new `DebugLoc` API. llvm-svn: 233582
* DebugInfo: Reflow printDebugLoc() to use early returns, NFCDuncan P. N. Exon Smith2015-03-301-15/+18
| | | | llvm-svn: 233580
* Bitcode: Reflow code to use early continues, NFCDuncan P. N. Exon Smith2015-03-301-15/+18
| | | | llvm-svn: 233578
* SelectionDAG: Reflow code to use early returns, NFCDuncan P. N. Exon Smith2015-03-301-15/+19
| | | | llvm-svn: 233577
* [NVPTX] Add options for PTX 4.1/4.2 and SM 3.2/3.7/5.2/5.3Justin Holewinski2015-03-301-0/+16
| | | | llvm-svn: 233575
* DebugInfo: Write new DebugLoc APIDuncan P. N. Exon Smith2015-03-301-53/+63
| | | | | | | | | | | | | | | | | Rewrite `DebugLoc` with a cleaner API that reflects its current status as a wrapper around an `MDLocation` pointer. - Add accessors/constructors to/from `MDLocation`. - Simplify construction from `MDNode`. - Remove unnecessary `LLVMContext` from APIs. - Drop some API that isn't useful any more. - Rewrite documentation. Actually, I've left the old API behind temporarily at the bottom of the class so that I can update callers in separate commits. I'll remove it once the callers are updated. llvm-svn: 233573
* DebugInfo: Implement MDLocation::getInlinedAtScope()Duncan P. N. Exon Smith2015-03-302-6/+2
| | | | | | | | | Write `MDLocation::getInlinedAtScope()` and use it to re-implement `DebugLoc::getScopeNode()` (and simplify `DISubprogram::Verify()`). This follows the inlined-at linked list and returns the scope of the deepest/last location. llvm-svn: 233568
* Verifier: Add operand checks for remaining debug infoDuncan P. N. Exon Smith2015-03-304-16/+43
| | | | llvm-svn: 233565
* DebugInfo: Simplify logic in DISubprogram::Verify(), NFCDuncan P. N. Exon Smith2015-03-301-13/+8
| | | | | | | Simplify the logic in `DISubprogram::Verify()` by using the new debug info hierarchy directly instead of the `DebugLoc` wrapper. llvm-svn: 233563
OpenPOWER on IntegriCloud