llvm-6502/lib/IR
Duncan P. N. Exon Smith 1545953510 IR: Stop using DIDescriptor::is*() and auto-casting
`DIDescriptor`'s subclasses allow construction from incompatible
pointers, and `DIDescriptor` defines a series of `isa<>`-like functions
(e.g., `isCompileUnit()` instead of `isa<MDCompileUnit>()`) that clients
tend to use like this:

    if (DICompileUnit(N).isCompileUnit())
      foo(DICompileUnit(N));

These construction patterns work together to make `DIDescriptor` behave
differently from normal pointers.

Instead, use built-in `isa<>`, `dyn_cast<>`, etc., and only build
`DIDescriptor`s from pointers that are valid for their type.

I've split this into a few commits for different parts of LLVM and clang
(to decrease the patch size and increase the chance of review).
Generally the changes I made were NFC, but in a few places I made things
stricter if it made sense from the surrounded code.

Eventually a follow-up commit will remove the API for the "old" way.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234255 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-06 23:18:49 +00:00
..
AsmWriter.cpp DebugInfo: Use MDTypeRef throughout the hierarchy 2015-04-06 19:03:45 +00:00
AttributeImpl.h
Attributes.cpp Remove more superfluous .str() and replace std::string concatenation with Twine. 2015-03-30 15:42:36 +00:00
AutoUpgrade.cpp AutoUpgrade: Remove obsolete dbg.declare/value upgrade 2015-04-06 17:17:47 +00:00
BasicBlock.cpp Return iterator from BasicBlock::eraseFromParent 2015-04-03 01:20:33 +00:00
CMakeLists.txt
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
Core.cpp [opaque pointer type] The last of the GEP IRBuilder API migrations 2015-04-05 22:41:44 +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 IR: Stop using DIDescriptor::is*() and auto-casting 2015-04-06 23:18:49 +00:00
DebugInfoMetadata.cpp DwarfDebug: Avoid creating new DebugLocs in the backend 2015-03-30 21:32:28 +00:00
DebugLoc.cpp IR: Stop using DIDescriptor::is*() and auto-casting 2015-04-06 23:18:49 +00:00
DiagnosticInfo.cpp IR: Use the new DebugLoc API, NFC 2015-03-30 19:40:05 +00:00
DiagnosticPrinter.cpp
DIBuilder.cpp IR: Stop using DIDescriptor::is*() and auto-casting 2015-04-06 23:18:49 +00:00
Dominators.cpp
Function.cpp [opaque pointer type] Avoid using PointerType::getElementType when parsing IR 2015-04-06 20:59:48 +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] Avoid using PointerType::getElementType when parsing IR 2015-04-06 20:59:48 +00:00
IntrinsicInst.cpp
IRBuilder.cpp [opaque pointer type] More GEP IRBuilder API migrations... 2015-04-03 21:33:42 +00:00
IRPrintingPasses.cpp
LegacyPassManager.cpp Typo. 2015-03-20 15:45:14 +00:00
LLVMBuild.txt
LLVMContext.cpp
LLVMContextImpl.cpp
LLVMContextImpl.h DebugInfo: Use MDTypeRef throughout the hierarchy 2015-04-06 19:03:45 +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
MetadataTracking.cpp
Module.cpp Be lazy about loading metadata in IRObjectFile. 2015-03-13 21:54:20 +00:00
module.modulemap
Pass.cpp
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
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 [opaque pointer type] Avoid using PointerType::getElementType when parsing IR 2015-04-06 20:59:48 +00:00