llvm-6502/lib/IR
Rafael Espindola eee41dbb65 Ask the module for its the identified types.
When lazy reading a module, the types used in a function will not be visible to
a TypeFinder until the body is read.

This patch fixes that by asking the module for its identified struct types.
If a materializer is present, the module asks it. If not, it uses a TypeFinder.

This fixes pr21374.

I will be the first to say that this is ugly, but it was the best I could find.

Some of the options I looked at:

* Asking the LLVMContext. This could be made to work for gold, but not currently
  for ld64. ld64 will load multiple modules into a single context before merging
  them. This causes us to see types from future merges. Unfortunately,
  MappedTypes is not just a cache when it comes to opaque types. Once the
  mapping has been made, we have to remember it for as long as the key may
  be used. This would mean moving MappedTypes to the Linker class and having
  to drop the Linker::LinkModules static methods, which are visible from C.

* Adding an option to ignore function bodies in the TypeFinder. This would
  fix the PR by picking the worst result. It would work, but unfortunately
  we are currently quite dependent on the upfront type merging. I will
  try to reduce our dependency, but it is not clear that we will be able
  to get rid of it for now.

The only clean solution I could think of is making the Module own the types.
This would have other advantages, but it is a much bigger change. I will
propose it, but it is nice to have this fixed while that is discussed.

With the gold plugin, this patch takes the number of types in the LTO clang
binary from 52817 to 49669.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223215 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 07:18:23 +00:00
..
AsmWriter.cpp Prologue support 2014-12-03 02:08:38 +00:00
AsmWriter.h
AttributeImpl.h
Attributes.cpp
AutoUpgrade.cpp Revert "IR: MDNode => Value" 2014-11-11 21:30:22 +00:00
BasicBlock.cpp
CMakeLists.txt [Statepoints 3/4] Statepoint infrastructure for garbage collection: SelectionDAGBuilder 2014-12-02 18:50:36 +00:00
Comdat.cpp
ConstantFold.cpp
ConstantFold.h
ConstantRange.cpp
Constants.cpp Revert "unique_ptrify LLVMContextImpl::CAZConstants" 2014-11-25 02:26:22 +00:00
ConstantsContext.h
Core.cpp Revert "IR: MDNode => Value" 2014-11-11 21:30:22 +00:00
DataLayout.cpp
DebugInfo.cpp Debug Info: revert r222195, r222210 and r222239. 2014-11-21 19:55:23 +00:00
DebugLoc.cpp
DiagnosticInfo.cpp Revert "IR: MDNode => Value" 2014-11-11 21:30:22 +00:00
DiagnosticPrinter.cpp
DIBuilder.cpp Debug Info: revert r222195, r222210 and r222239. 2014-11-21 19:55:23 +00:00
Dominators.cpp
Function.cpp Prologue support 2014-12-03 02:08:38 +00:00
GCOV.cpp GCOV: Make sure that function idents in the .gcda and .gcno match 2014-11-06 06:55:02 +00:00
Globals.cpp Copy externally_initialized in GlobalVariable::copyAttributesFrom. 2014-11-10 18:41:59 +00:00
GVMaterializer.cpp
InlineAsm.cpp
Instruction.cpp Revert "IR: MDNode => Value" 2014-11-11 21:30:22 +00:00
Instructions.cpp Revert r220349 to re-instate r220277 with a fix for PR21330 -- quite 2014-11-25 08:20:27 +00:00
IntrinsicInst.cpp
IRBuilder.cpp Revert "Masked Vector Load and Store Intrinsics." 2014-11-28 21:29:14 +00:00
IRPrintingPasses.cpp
LeakDetector.cpp
LeaksContext.h
LegacyPassManager.cpp Remove redundant calls to isMaterializable. 2014-11-01 16:46:18 +00:00
LLVMBuild.txt
LLVMContext.cpp Remove StringMap::GetOrCreateValue in favor of StringMap::insert 2014-11-19 05:49:42 +00:00
LLVMContextImpl.cpp Revert "unique_ptrify LLVMContextImpl::CAZConstants" 2014-11-25 02:26:22 +00:00
LLVMContextImpl.h Prologue support 2014-12-03 02:08:38 +00:00
Makefile
Mangler.cpp
MDBuilder.cpp
Metadata.cpp IR: Sink MDNode::Hash down to GenericMDNode::Hash 2014-11-18 02:20:29 +00:00
Module.cpp Ask the module for its the identified types. 2014-12-03 07:18:23 +00:00
module.modulemap
Pass.cpp
PassManager.cpp
PassRegistry.cpp
Statepoint.cpp [Statepoints 3/4] Statepoint infrastructure for garbage collection: SelectionDAGBuilder 2014-12-02 18:50:36 +00:00
SymbolTableListTraitsImpl.h
Type.cpp Update SetVector to rely on the underlying set's insert to return a pair<iterator, bool> 2014-11-19 07:49:26 +00:00
TypeFinder.cpp Prologue support 2014-12-03 02:08:38 +00:00
Use.cpp
UseListOrder.cpp
User.cpp
Value.cpp [InstCombine] Re-commit of r218721 (Optimize icmp-select-icmp sequence) 2014-11-21 23:36:44 +00:00
ValueSymbolTable.cpp Remove StringMap::GetOrCreateValue in favor of StringMap::insert 2014-11-19 05:49:42 +00:00
ValueTypes.cpp
Verifier.cpp [Statepoints 1/4] Statepoint infrastructure for garbage collection: IR Intrinsics 2014-12-01 21:18:12 +00:00