llvm-6502/include/llvm
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
..
ADT ADT: Rename argument in emplace_back_impl 2014-12-03 05:53:24 +00:00
Analysis [stack protector] Set edge weights for newly created basic blocks. 2014-12-01 04:27:03 +00:00
AsmParser
Bitcode Revert commits r222146 and r222137. 2014-11-17 19:26:40 +00:00
CodeGen [Statepoints 3/4] Statepoint infrastructure for garbage collection: SelectionDAGBuilder 2014-12-02 18:50:36 +00:00
Config cmake: Remove MAXPATHLEN define as autoconf does not provide it 2014-12-02 18:59:08 +00:00
DebugInfo Reapply "[dwarfdump] Add support for dumping accelerator tables." 2014-11-14 16:15:53 +00:00
ExecutionEngine [MCJIT] Unique-ptrify the RTDyldMemoryManager member of MCJIT. NFC. 2014-12-03 00:51:19 +00:00
IR Ask the module for its the identified types. 2014-12-03 07:18:23 +00:00
IRReader
LineEditor
Linker Partial revert of r222986. 2014-12-01 16:32:20 +00:00
LTO Remove StringMap::GetOrCreateValue in favor of StringMap::insert 2014-11-19 05:49:42 +00:00
MC Introduce CPUStringIsValid() into MCSubtargetInfo and use it for ARM .cpu parsing. 2014-12-02 20:03:22 +00:00
Object Widen ELFYAML relocation type to 32 bits 2014-11-27 17:20:48 +00:00
Option
ProfileData llvm-cov: Sink some reporting logic into CoverageMapping 2014-11-14 01:50:32 +00:00
Support Emit Tag_ABI_FP_denormal correctly in fast-math mode. 2014-12-02 08:22:29 +00:00
TableGen Revert r222965 "Make MultiClass::DefPrototypes own their Records to fix memory leaks." 2014-11-30 00:43:50 +00:00
Target Make sure that the TargetOptions operator== is checking the 2014-12-02 21:57:15 +00:00
Transforms DebugIR: Delete -debug-ir 2014-11-29 03:15:47 +00:00
CMakeLists.txt
InitializePasses.h DebugIR: Delete -debug-ir 2014-11-29 03:15:47 +00:00
LinkAllIR.h
LinkAllPasses.h Remove the unused FindUsedTypes pass. 2014-11-24 20:53:26 +00:00
module.modulemap Try to make the modules buildbot happy again. 2014-11-26 03:44:47 +00:00
module.modulemap.build
Pass.h
PassAnalysisSupport.h
PassInfo.h
PassManager.h
PassRegistry.h
PassSupport.h