llvm-6502/lib/IR
Duncan P. N. Exon Smith b0d0a65e1d Verifier: Check that inlined-at locations agree
Check that the `MDLocalVariable::getInlinedAt()` in a debug info
intrinsic's variable always matches the `MDLocation::getInlinedAt()` of
its `!dbg` attachment.

The goal here is to get rid of `MDLocalVariable::getInlinedAt()`
entirely (PR22778), since it's expensive and unnecessary, but I'll let
this verifier check bake for a while (a week maybe?) first.  I've
updated the testcases that had the wrong value for `inlinedAt:`.

This checks that things are sane in the IR, but currently things go out
of whack in a few places in the backend.  I'll follow shortly with
assertions in the backend (with code fixes).

If you have out-of-tree testcases that just started failing, here's how
I updated these ones:

 1. The verifier check gives you the basic block, function, instruction,
    and relevant metadata arguments (metadata numbering doesn't
    necessarily match the source file, unfortunately).
 2. Look at the `@llvm.dbg.*()` instruction, and compare the
    `inlinedAt:` fields of the variable argument (second `metadata`
    argument) and the `!dbg` attachment.
 3. Figure out based on the variable `scope:` chain and the functions in
    the file whether the variable has been inlined (and into what), so
    you can determine which `inlinedAt:` is actually correct.  In all of
    the in-tree testcases, the `!MDLocation()` was correct and the
    `!MDLocalVariable()` was wrong, but YMMV.
 4. Duplicate the metadata that you're going to change, and add/drop the
    `inlinedAt:` field from one of them.  Be careful that the other
    references to the same metadata node point at the correct one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234021 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-03 16:54:30 +00:00
..
AsmWriter.cpp Verifier: Add operand checks for remaining debug info 2015-03-30 17:21:38 +00:00
AttributeImpl.h Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition. 2015-02-15 22:54:22 +00:00
Attributes.cpp Remove more superfluous .str() and replace std::string concatenation with Twine. 2015-03-30 15:42:36 +00:00
AutoUpgrade.cpp Trying to fix the Hexagon and debian-fast bots arm32_neon_vcnt_upgrade.ll test. 2015-03-30 16:10:39 +00:00
BasicBlock.cpp Return iterator from BasicBlock::eraseFromParent 2015-04-03 01:20:33 +00:00
CMakeLists.txt Use ADDITIONAL_HEADER_DIRS in all LLVM CMake projects. 2015-02-11 03:28:02 +00:00
Comdat.cpp
ConstantFold.cpp [opaque pointer type] API migration for GEP constant factories 2015-04-02 18:55:32 +00:00
ConstantFold.h
ConstantRange.cpp [ConstantRange] Split makeICmpRegion in two. 2015-03-18 00:41:24 +00:00
Constants.cpp [opaque pointer type] API migration for GEP constant factories 2015-04-02 18:55:32 +00:00
ConstantsContext.h Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition. 2015-02-15 22:54:22 +00:00
Core.cpp [opaque pointer type] API migration for GEP constant factories 2015-04-02 18:55:32 +00:00
DataLayout.cpp COFF: Let globals with private linkage reside in their own section 2015-03-17 23:54:51 +00:00
DebugInfo.cpp git-clang-format r233603. 2015-04-01 14:44:59 +00:00
DebugInfoMetadata.cpp DwarfDebug: Avoid creating new DebugLocs in the backend 2015-03-30 21:32:28 +00:00
DebugLoc.cpp DebugLoc: Remove getFromDILexicalBlock() 2015-03-30 23:47:26 +00:00
DiagnosticInfo.cpp IR: Use the new DebugLoc API, NFC 2015-03-30 19:40:05 +00:00
DiagnosticPrinter.cpp
DIBuilder.cpp Verifier: Add operand checks for remaining debug info 2015-03-30 17:21:38 +00:00
Dominators.cpp
Function.cpp InstCombine: propagate deref via new addDereferenceableAttr 2015-02-14 19:37:54 +00:00
GCOV.cpp Remove more superfluous .str() and replace std::string concatenation with Twine. 2015-03-30 15:42:36 +00:00
Globals.cpp Remove getDataLayout() from Instruction/GlobalValue/BasicBlock/Function 2015-03-03 22:01:13 +00:00
GVMaterializer.cpp
InlineAsm.cpp Silence sign compare warning. NFC. 2015-03-29 20:49:03 +00:00
Instruction.cpp Return iterator from Instruction::eraseFromParent. 2015-04-02 00:03:07 +00:00
Instructions.cpp [opaque pointer type] Change GetElementPtrInst::getIndexedType to take the pointee type 2015-03-30 21:41:43 +00:00
IntrinsicInst.cpp
IRBuilder.cpp PlaceSafepoints: use IRBuilder helpers 2015-02-26 00:35:56 +00:00
IRPrintingPasses.cpp
LegacyPassManager.cpp Typo. 2015-03-20 15:45:14 +00:00
LLVMBuild.txt
LLVMContext.cpp
LLVMContextImpl.cpp Revert GCStrategy ownership changes 2015-01-26 18:26:35 +00:00
LLVMContextImpl.h Verifier: Add operand checks for remaining debug info 2015-03-30 17:21:38 +00:00
Makefile
Mangler.cpp Revert "Address review comments" 2015-03-17 20:40:21 +00:00
MDBuilder.cpp [IC] Turn non-null MD on pointer loads to range MD on integer loads. 2015-02-25 05:10:25 +00:00
Metadata.cpp IR: Enable uniquing callbacks during MDNode::replaceWithUniqued() 2015-03-31 20:50:50 +00:00
MetadataImpl.h Added missing header for the explicit dependency on MDNode. 2015-02-04 00:20:52 +00:00
MetadataTracking.cpp IR: Store RAUW support and Context in the same pointer, NFC 2015-01-19 19:02:06 +00:00
Module.cpp Be lazy about loading metadata in IRObjectFile. 2015-03-13 21:54:20 +00:00
module.modulemap
Pass.cpp Refactoring cl::parser construction and initialization. 2015-01-22 21:01:12 +00:00
PassManager.cpp
PassRegistry.cpp Revert r231276 (including r231277): Add a lock() function in PassRegistry to speed up multi-thread synchronization. 2015-03-05 17:53:00 +00:00
Statepoint.cpp Add invoke related functionality into StatepointSite classes. 2015-02-19 11:02:11 +00:00
SymbolTableListTraitsImpl.h
Type.cpp [slp] Fix a nasty bug in the SLP vectorizer that Joerg pointed out. 2015-02-12 02:30:56 +00:00
TypeFinder.cpp Fix Value dangling reference debug output 2015-03-10 23:55:38 +00:00
Use.cpp
UseListOrder.cpp
User.cpp
Value.cpp Re-sort includes with sort-includes.py and insert raw_ostream.h where it's used. 2015-03-23 19:32:43 +00:00
ValueSymbolTable.cpp
ValueTypes.cpp
Verifier.cpp Verifier: Check that inlined-at locations agree 2015-04-03 16:54:30 +00:00