[DWARF parser] Respect address ranges specified in compile unit DIE.

When address ranges for compile unit are specified in compile unit DIE
itself, there is no need to collect ranges from children subprogram DIEs.

This change speeds up llvm-symbolizer on Clang-produced binaries with
full debug info. For instance, symbolizing a first address in a 1Gb binary
is now 2x faster (1s vs. 2s).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206641 91177308-0d34-0410-b5e6-96231b3b80d8
OnDiskHashTable: Expect the Info type to declare the hash size

This changes the on-disk hash to get the size of a hash value from the
Info type, so that clients can be more flexible with the types of hash
they use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206642 91177308-0d34-0410-b5e6-96231b3b80d8
OnDiskHashTable: Expect the Info type to declare the offset type

This changes the on-disk hash to get the type to use for offsets from
the Info type, so that clients can be more flexible with the size of
table they support.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206643 91177308-0d34-0410-b5e6-96231b3b80d8
[LCG] Fix the bugs that Ben pointed out in code review (and the MSan bot
caught). Sad that we don't have warnings for these things, but bleh, no
idea how to fix that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206646 91177308-0d34-0410-b5e6-96231b3b80d8
Expanded test for x86-pc-windows-gnu and x86_64-pc-windows-gnu environments.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206649 91177308-0d34-0410-b5e6-96231b3b80d8
Remove -simplify-libcalls pass form Passes documentation

This pass was removed in r184459.

Also added note that the InstCombine pass does library call
simplification.

Patch slightly modified from one by Daniel Liew
<daniel.liew@imperial.ac.uk>!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206650 91177308-0d34-0410-b5e6-96231b3b80d8
[ARM64] Ports the Cortex-A53 Machine Model description from AArch64.

Summary:
This port includes the rudimentary latencies that were provided for
the Cortex-A53 Machine Model in the AArch64 backend. It also changes
the SchedAlias for COPY in the Cyclone model to an explicit
WriteRes mapping to avoid conflicts in other subtargets.

Differential Revision: http://reviews.llvm.org/D3427
Patch by Dave Estes <cestes@codeaurora.org>!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206652 91177308-0d34-0410-b5e6-96231b3b80d8
Update the fragments of symbols in compressed sections.

While unnamed relocations are already cached in side tables in
ELFObjectWriter::RecordRelocation, symbols still need their fragments
updated to refer to the newly compressed fragment (even if that fragment
isn't big enough to fit the offset). Even though we only create
temporary symbols in debug info sections this comes up in 32 bit builds
where even temporary symbols in mergeable sections (such as debug_str)
have to be emitted as named symbols.

I tried a few other ways to do this but they all didn't work for various
reasons:

1) Canonicalize the MCSymbolData in RecordRelocation, nulling out the
Fragment (so it didn't have to be updated by CompressDebugSection). This
doesn't work because some code relies on symbols having fragments to
indicate that they're defined, I think.

2) Canonicalize the MCSymbolData in RecordRelocation to be "first
fragment + absolute offset" so it would be cheaper to just test and
update the fragment in CompressDebugSections. This doesn't work because
the offset computed in RecordRelocation isn't that of the symbol's
fragment, it's the passed in fragment (I haven't figured out what that
fragment is - perhaps it's the location where the relocation is to be
written). And if the fragment offset has to be computed only for this
use we might as well just do it when we need to, in
CompressDebugSection.

I also added an assert to help catch this a bit more clearly, even
though it is UB. The test case improvements would either assert fail
and/or valgrind vail without the fix, even if they wouldn't necessarily
fail the FileCheck output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206653 91177308-0d34-0410-b5e6-96231b3b80d8
[DWARF parser] Turn DILineInfo into a struct.

Immutable DILineInfo doesn't bring any benefits and complicates
code. Also, use std::string instead of SmallString<16> for file
and function names - their length can vary significantly.

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206654 91177308-0d34-0410-b5e6-96231b3b80d8
Added Sphinx documentation generation to CMake build system.

The option LLVM_ENABLE_SPHINX option enables the "docs-llvm-html",
"docs-llvm-man" targets but does not build them by default. The
following CMake options have been added that control what targets are
made available

SPHINX_OUTPUT_HTML
SPHINX_OUTPUT_MAN

If LLVM_BUILD_DOCS is enabled then the enabled docs-llvm-* targets will
be built by default and if ``make install`` is run then docs-llvm-html
and docs-llvm-man will be installed (tested on Linux only).

The add_sphinx_target function is in its own file so it can be included
by other projects that use Sphinx for their documentation.

Patch by Daniel Liew <daniel.liew@imperial.ac.uk>!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206655 91177308-0d34-0410-b5e6-96231b3b80d8
ProfileData: Add support for the indexed instrprof format

This adds support for an indexed instrumentation based profiling
format, which is just a small header and an on disk hash table.  This
format will be used by clang's -fprofile-instr-use= for PGO.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206656 91177308-0d34-0410-b5e6-96231b3b80d8
Compress debug sections only when beneficial.

Both ZLIB and the debug info compressed section header ("ZLIB" + the
size of the uncompressed data) take some constant overhead so in some
cases the compressed data is actually larger than the uncompressed data.
In these cases, just don't compress or rename the section at all.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206659 91177308-0d34-0410-b5e6-96231b3b80d8
ProfileData: Don't forward declare ComputeHash and make it static inline

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206663 91177308-0d34-0410-b5e6-96231b3b80d8
[llvm-symbolizer] Print file/line for a PC even if there is no DIE describing it.

This is important for symbolizing executables with debug info in
unavailable .dwo files. Even if all DIE entries are missing, we can
still symbolize an address: function name can be fetched from symbol table,
and file/line info can be fetched from line table.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206665 91177308-0d34-0410-b5e6-96231b3b80d8
Reapply "blockfreq: Rewrite BlockFrequencyInfoImpl" (#2)

This reverts commit r206628, reapplying r206622 (and r206626).

Two tests are failing only on buildbots [1][2]: i.e., I can't reproduce
on Darwin, and Chandler can't reproduce on Linux.  Asan and valgrind
don't tell us anything, but we're hoping the msan bot will catch it.

So, I'm applying this again to get more feedback from the bots.  I'll
leave it in long enough to trigger builds in at least the sanitizer
buildbots (it was failing for reasons unrelated to my commit last time
it was in), and hopefully a few others.... and then I expect to revert a
third time.

[1]: http://bb.pgr.jp/builders/ninja-x64-msvc-RA-centos6/builds/1816
[2]: http://llvm-amd64.freebsd.your.org/b/builders/clang-i386-freebsd/builds/18445

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206666 91177308-0d34-0410-b5e6-96231b3b80d8
test: Add extra run lines to investigate an error on the bots

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206668 91177308-0d34-0410-b5e6-96231b3b80d8
Change the ARM assembler to require a :lower16: or :upper16 on non-constant
expressions for mov instructions instead of silently truncating by default.

For the ARM assembler, we want to avoid misleadingly allowing something
like "mov r0, <symbol>" especially when we turn it into a movw and the
expression <symbol> does not have a :lower16: or :upper16" as part of the
expression.  We don't want the behavior of silently truncating, which can be
unexpected and lead to bugs that are difficult to find since this is an easy
mistake to make.

This does change the previous behavior of llvm but actually matches an
older gnu assembler that would not allow this but print less useful errors
of like “invalid constant (0x927c0) after fixup” and “unsupported relocation on
symbol foo”.  The error for llvm is "immediate expression for mov requires
:lower16: or :upper16" with correct location information on the operand
as shown in the added test cases.

rdar://12342160


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206669 91177308-0d34-0410-b5e6-96231b3b80d8
llvm-profdata: Avoid writing to /dev/null in tests

We fseek on our output file in llvm-profdata, which errors on some
systems. Avoid getting into the situation by writing to /dev/null

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206670 91177308-0d34-0410-b5e6-96231b3b80d8
Check whether functions have any lines associated before emitting coverage info for them. This isn't just a size/time saving, gcov may crash on these.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206671 91177308-0d34-0410-b5e6-96231b3b80d8
OnDiskHashTable: Fix a think-o with offset_type

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206672 91177308-0d34-0410-b5e6-96231b3b80d8