llvm with tablegen backend for capstone disassembler
Go to file
Rafael Espindola 2fa1e43a22 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.

llvm-svn: 223215
2014-12-03 07:18:23 +00:00
clang Handle delayed corrections in a couple more error paths in ParsePostfixExpressionSuffix. 2014-12-03 05:30:54 +00:00
clang-tools-extra Update and simplify to match Clang r223095. 2014-12-02 00:32:02 +00:00
compiler-rt [asan] fix four asan tests to run in use-after-return mode 2014-12-03 00:08:41 +00:00
debuginfo-tests New round of fixes for "Always compile debuginfo-tests for the host triple" 2014-10-18 23:47:59 +00:00
libclc Don't include <stddef.h> 2014-11-18 14:19:27 +00:00
libcxx libc++: support NaCl when building thread.cpp 2014-12-02 17:30:19 +00:00
libcxxabi Fix comment on end of #endif to match #if 2014-11-25 03:19:02 +00:00
lld [PECOFF] Fix a bug in /export option handler. 2014-12-03 04:34:20 +00:00
lldb Update setMCJITMemoryManager call to keep in line with llvm r223183. 2014-12-03 04:02:03 +00:00
llgo Initial commit of llgo third_party. 2014-11-27 00:12:26 +00:00
llvm Ask the module for its the identified types. 2014-12-03 07:18:23 +00:00
openmp I apologise in advance for the size of this check-in. At Intel we do 2014-10-07 16:25:50 +00:00
polly checkout_isl: Do not fail in presence of an old CLooG checkout 2014-12-02 21:04:20 +00:00