1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-25 14:02:52 +02:00
llvm-mirror/lib/IR
Chandler Carruth dad102bcc9 [PM] Change the static object whose address is used to uniquely identify
analyses to have a common type which is enforced rather than using
a char object and a `void *` type when used as an identifier.

This has a number of advantages. First, it at least helps some of the
confusion raised in Justin Lebar's code review of why `void *` was being
used everywhere by having a stronger type that connects to documentation
about this.

However, perhaps more importantly, it addresses a serious issue where
the alignment of these pointer-like identifiers was unknown. This made
it hard to use them in pointer-like data structures. We were already
dodging this in dangerous ways to create the "all analyses" entry. In
a subsequent patch I attempted to use these with TinyPtrVector and
things fell apart in a very bad way.

And it isn't just a compile time or type system issue. Worse than that,
the actual alignment of these pointer-like opaque identifiers wasn't
guaranteed to be a useful alignment as they were just characters.

This change introduces a type to use as the "key" object whose address
forms the opaque identifier. This both forces the objects to have proper
alignment, and provides type checking that we get it right everywhere.
It also makes the types somewhat less mysterious than `void *`.

We could go one step further and introduce a truly opaque pointer-like
type to return from the `ID()` static function rather than returning
`AnalysisKey *`, but that didn't seem to be a clear win so this is just
the initial change to get to a reliably typed and aligned object serving
is a key for all the analyses.

Thanks to Richard Smith and Justin Lebar for helping pick plausible
names and avoid making this refactoring many times. =] And thanks to
Sean for the super fast review!

While here, I've tried to move away from the "PassID" nomenclature
entirely as it wasn't really helping and is overloaded with old pass
manager constructs. Now we have IDs for analyses, and key objects whose
address can be used as IDs. Where possible and clear I've shortened this
to just "ID". In a few places I kept "AnalysisID" to make it clear what
was being identified.

Differential Revision: https://reviews.llvm.org/D27031

llvm-svn: 287783
2016-11-23 17:53:26 +00:00
..
AsmWriter.cpp Fix -Werror build with clang-cl. 2016-11-11 23:58:11 +00:00
AttributeImpl.h Kill deprecated attribute API 2016-11-06 07:48:46 +00:00
Attributes.cpp Kill deprecated attribute API 2016-11-06 07:48:46 +00:00
AttributesCompatFunc.td
AttributeSetNode.h
AutoUpgrade.cpp [AVX-512] Remove intrinsics for valignd/q and autoupgrade them to native shuffles. 2016-11-23 06:54:55 +00:00
BasicBlock.cpp Don't create a SymbolTable in Function when the LLVMContext discards value names (NFC) 2016-09-17 06:00:02 +00:00
CMakeLists.txt [CMake] NFC. Updating CMake dependency specifications 2016-11-17 04:36:50 +00:00
Comdat.cpp
ConstantFold.cpp IR: Introduce inrange attribute on getelementptr indices. 2016-11-10 22:34:55 +00:00
ConstantFold.h IR: Introduce inrange attribute on getelementptr indices. 2016-11-10 22:34:55 +00:00
ConstantRange.cpp Analysis: Move llvm::getConstantRangeFromMetadata to IR library. 2016-10-21 19:59:26 +00:00
Constants.cpp IR: Introduce inrange attribute on getelementptr indices. 2016-11-10 22:34:55 +00:00
ConstantsContext.h
Core.cpp [C API] Fix several null pointer dereferences. 2016-11-12 03:38:23 +00:00
DataLayout.cpp [IR/DataLayout] Simplify the code using PowerOf2Ceil. NFCI. 2016-11-11 03:00:00 +00:00
DebugInfo.cpp Add -strip-nonlinetable-debuginfo capability 2016-10-25 18:44:13 +00:00
DebugInfoMetadata.cpp Add DWARF debug info support for C++11 inline namespaces. 2016-11-03 19:42:02 +00:00
DebugLoc.cpp
DiagnosticInfo.cpp [OptDiag, opt-viewer] Save callee's location and display as link 2016-11-07 22:41:13 +00:00
DiagnosticPrinter.cpp
DIBuilder.cpp Add DWARF debug info support for C++11 inline namespaces. 2016-11-03 19:42:02 +00:00
Dominators.cpp [PM] Change the static object whose address is used to uniquely identify 2016-11-23 17:53:26 +00:00
Function.cpp Expandload and Compressstore intrinsics 2016-11-03 03:23:55 +00:00
GCOV.cpp Support: Remove MemoryObject and DataStreamer interfaces. 2016-11-02 00:08:37 +00:00
Globals.cpp Bitcode: Change the materializer interface to return llvm::Error. 2016-11-09 17:49:19 +00:00
GVMaterializer.cpp
InlineAsm.cpp Replace "fallthrough" comments with LLVM_FALLTHROUGH 2016-08-17 05:10:15 +00:00
Instruction.cpp fix documentation comments; NFC 2016-10-05 18:51:12 +00:00
Instructions.cpp fix comment formatting; NFC 2016-11-16 18:09:44 +00:00
IntrinsicInst.cpp [Profile] code refactoring: make getStep a method in base class 2016-09-20 19:07:22 +00:00
IRBuilder.cpp
IRPrintingPasses.cpp
LegacyPassManager.cpp Timer: Track name and description. 2016-11-18 19:43:18 +00:00
LLVMBuild.txt
LLVMContext.cpp Change setDiagnosticsOutputFile to take a unique_ptr from a raw pointer (NFC) 2016-11-19 18:19:41 +00:00
LLVMContextImpl.cpp Use unique_ptr in LLVMContextImpl's constant maps. 2016-10-10 16:26:13 +00:00
LLVMContextImpl.h Add DWARF debug info support for C++11 inline namespaces. 2016-11-03 19:42:02 +00:00
Mangler.cpp Remove the default constructor and count variable from the Mangler since 2016-09-29 02:03:50 +00:00
MDBuilder.cpp Use profile info to set function section prefix to group hot/cold functions. 2016-10-18 20:42:47 +00:00
Metadata.cpp Add -strip-nonlinetable-debuginfo capability 2016-10-25 18:44:13 +00:00
MetadataImpl.h
Module.cpp Bitcode: Change the materializer interface to return llvm::Error. 2016-11-09 17:49:19 +00:00
ModuleSummaryIndex.cpp ThinLTO: handles modules with empty summaries 2016-10-08 04:44:18 +00:00
Operator.cpp
OptBisect.cpp
Pass.cpp Use StringRef in Pass Info/Support API (NFC) 2016-10-01 04:03:30 +00:00
PassManager.cpp [PM] Change the static object whose address is used to uniquely identify 2016-11-23 17:53:26 +00:00
PassRegistry.cpp
ProfileSummary.cpp
Statepoint.cpp
SymbolTableListTraitsImpl.h ADT: Remove external uses of ilist_iterator, NFC 2016-09-03 01:22:56 +00:00
Type.cpp IR: Remove a no longer needed assert. 2016-10-29 20:57:12 +00:00
TypeFinder.cpp
Use.cpp
User.cpp Retire llvm::alignOf in favor of C++11 alignof. 2016-10-20 15:02:18 +00:00
Value.cpp Don't create a SymbolTable in Function when the LLVMContext discards value names (NFC) 2016-09-17 06:00:02 +00:00
ValueSymbolTable.cpp Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes. 2016-08-23 17:14:32 +00:00
ValueTypes.cpp getVectorElementType().getSizeInBits() -> getScalarSizeInBits() ; NFCI 2016-09-14 16:37:15 +00:00
Verifier.cpp [PM] Change the static object whose address is used to uniquely identify 2016-11-23 17:53:26 +00:00