llvm-project/llvm/lib
Duncan P. N. Exon Smith 9d1cf4c166 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.

llvm-svn: 234255
2015-04-06 23:18:49 +00:00
..
Analysis [opaque pointer type] More GEP API migrations in IRBuilder uses 2015-04-03 19:41:44 +00:00
AsmParser [opaque pointer type] Avoid using PointerType::getElementType when parsing IR 2015-04-06 20:59:48 +00:00
Bitcode [opaque pointer type] API migration for GEP constant factories 2015-04-02 18:55:32 +00:00
CodeGen Use sext in fast isel. 2015-04-06 22:29:07 +00:00
DebugInfo Raising minimum required CMake version to 2.8.12.2. 2015-03-23 20:03:57 +00:00
ExecutionEngine [Orc] Tidy up the assembly for the x86-64 resolver block. 2015-04-06 03:01:29 +00:00
Fuzzer Removing a spurious space; NFC. 2015-04-06 16:09:13 +00:00
IR IR: Stop using DIDescriptor::is*() and auto-casting 2015-04-06 23:18:49 +00:00
IRReader Use ADDITIONAL_HEADER_DIRS in all LLVM CMake projects. 2015-02-11 03:28:02 +00:00
LTO Remove more superfluous .str() and replace std::string concatenation with Twine. 2015-03-30 15:42:36 +00:00
LineEditor Use ADDITIONAL_HEADER_DIRS in all LLVM CMake projects. 2015-02-11 03:28:02 +00:00
Linker IR: Stop using DIDescriptor::is*() and auto-casting 2015-04-06 23:18:49 +00:00
MC Use a comma after the unique keyword. 2015-04-06 16:34:41 +00:00
Object Remove more superfluous .str() and replace std::string concatenation with Twine. 2015-03-30 15:42:36 +00:00
Option Remove more superfluous .str() and replace std::string concatenation with Twine. 2015-03-30 15:42:36 +00:00
Passes [PM] Fixup for r231556 where I missed a dependency on intrinsics 2015-03-07 09:08:20 +00:00
ProfileData Re-sort includes with sort-includes.py and insert raw_ostream.h where it's used. 2015-03-23 19:32:43 +00:00
Support fix typos; NFC 2015-04-06 16:21:12 +00:00
TableGen Add missing includes. make_unique proliferated everywhere. 2015-03-01 21:28:53 +00:00
Target ARM: do not relax Thumb1 -> Thumb2 if only Thumb1 is available. 2015-04-06 18:44:42 +00:00
Transforms ArgPromo: Bail out earlier for varargs functions 2015-04-06 21:27:31 +00:00
CMakeLists.txt [PM] Create a separate library for high-level pass management code. 2015-03-07 09:02:36 +00:00
LLVMBuild.txt [PM] Create a separate library for high-level pass management code. 2015-03-07 09:02:36 +00:00
Makefile [PM] Create a separate library for high-level pass management code. 2015-03-07 09:02:36 +00:00