Go to file
Rui Ueyama 1d510428e8 Separate file parsing from File's constructors.
This is a second patch for InputGraph cleanup.

Sorry about the size of the patch, but what I did in this
patch is basically moving code from constructor to a new
method, parse(), so the amount of new code is small.
This has no change in functionality.

We've discussed the issue that we have too many classes
to represent a concept of "file". We have File subclasses
that represent files read from disk. In addition to that,
we have bunch of InputElement subclasses (that are part
of InputGraph) that represent command line arguments for
input file names. InputElement is a wrapper for File.

InputElement has parseFile method. The method instantiates
a File. The File's constructor reads a file from disk and
parses that.

Because parseFile method is called from multiple worker
threads, file parsing is processed in parallel. In other
words, one reason why we needed the wrapper classes is
because a File would start reading a file as soon as it
is instantiated.

So, the reason why we have too many classes here is at
least partly because of the design flaw of File class.
Just like threads in a good threading library, we need
to separate instantiation from "start" method, so that
we can instantiate File objects when we need them (which
should be very fast because it involves only one mmap()
and no real file IO) and use them directly instead of
the wrapper classes. Later, we call parse() on each
file in parallel to let them do actual file IO.

In this design, we can eliminate a reason to have the
wrapper classes.

In order to minimize the size of the patch, I didn't go so
far as to replace the wrapper classes with File classes.
The wrapper classes are still there.

In this patch, we call parse() immediately after
instantiating a File, so this really has no change in
functionality. Eventually the call of parse() should be
moved to Driver::link(). That'll be done in another patch.

llvm-svn: 224102
2014-12-12 07:31:09 +00:00
clang Do not warn on keyword undef 2014-12-12 06:37:55 +00:00
clang-tools-extra Update to match clang r223913. 2014-12-10 03:10:06 +00:00
compiler-rt [mips] [test] Enable COMPILER_RT_INCLUDE_TESTS for MIPS 2014-12-12 07:08:12 +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 Add support for building libc++ as a 32 bit library 2014-12-12 03:12:18 +00:00
libcxxabi Fix comment on end of #endif to match #if 2014-11-25 03:19:02 +00:00
lld Separate file parsing from File's constructors. 2014-12-12 07:31:09 +00:00
lldb Make sure if a thread specifies a 'register_data_addr' in a python operating system plug-in, that is is used to fetch the register values. 2014-12-11 23:53:52 +00:00
llgo Optimize comparisons to empty string. 2014-12-09 01:02:12 +00:00
llvm A fix for PR21176. 2014-12-12 05:11:47 +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 Do not run dead code elimination by default 2014-12-10 21:12:23 +00:00