Commit Graph

7289 Commits

Author SHA1 Message Date
Saleem Abdulrasool
b79146f48d CodeView: extract the OMF Directory Header
The DebugDirectory contains a pointer to the CodeView info structure which is a
derivative of the OMF debug directory.  The structure has evolved a bit over
time, and PDB 2.0 used a slightly different definition from PDB 7.0.  Both of
these are specific to CodeView and not COFF.  Reflect this by moving the
structure definitions into the DebugInfo/CodeView headers.  Define a generic
DebugInfo union type that can be used to pass around a reference to the
DebugInfo irrespective of the versioning.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278075 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 00:25:12 +00:00
Daniel Sanders
7dd6fd6b28 Re-commit r277988: [mips][ias] Fix all the hacks related to MIPS-specific unary operators (%hi/%lo/%gp_rel/etc.).
Hopefully with the MSVC builds fixed. I've added a missing '#include <tuple>'
that gcc and clang don't seem to need.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277995 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-08 11:50:25 +00:00
Daniel Sanders
0985f50be7 Revert r277988: [mips][ias] Fix all the hacks related to MIPS-specific unary operators (%hi/%lo/%gp_rel/etc.).
It seems that MSVC doesn't like std::tie().



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277990 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-08 09:33:14 +00:00
Daniel Sanders
007417372d [mips][ias] Fix all the hacks related to MIPS-specific unary operators (%hi/%lo/%gp_rel/etc.).
Summary:
They are now lexed as a single token on targets where
MCAsmInfo::HasMipsExpressions is true and then parsed in a similar way to
the '~' operator as part of MCExpr::parseExpression.

As a result:
* expressions and immediates no longer have different parsing rules. The
  difference is now solely down to whether evaluateAsAbsolute() succeeds.
* %hi(%neg(%gp_rel(x))) are no longer parsed as a single operator and
  decomposed into the three MipsMCExpr nodes. They are parsed directly as
  three MipsMCExpr nodes.
  * parseMemOperand no longer needs to eat all the surrounding parenthesis
    to get at the outermost operator to make this work
* %hi(%neg(%gp_rel(x))) and %lo(%neg(%gp_rel(x))) are no longer the only
  3-in-1 relocs that parse for N64. They're still the only combinations that
  are permitted in relocatable expressions though. Fixing that should be a
  later patch.
* We no longer need to list all the tokens that can occur as the first token of
  an expression or immediate.

test/MC/Mips/expr1.s:
    This change also prevents the incorrect lowering of %lo(2*4)+foo to
    %lo(8+foo) which is not an equivalent expression (the difference is
    whether foo is truncated to 16-bit or not) and the test has been
    updated to account for the macro expansion the correct expression requires.

Reviewers: sdardis

Subscribers: dsanders, sdardis, llvm-commits

Differential Revision: https://reviews.llvm.org/D23110

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277988 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-08 09:20:52 +00:00
Lang Hames
9350f3619a [ORC] Re-apply r277896, removing bogus triples and datalayouts that broke tests
on linux last time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277942 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-06 22:36:26 +00:00
Nico Weber
84f6a48c0d Revert r277896.
It breaks ExecutionEngine/OrcLazy/weak-function.ll on most bots.

Script:
--
...
--
Exit Code: 1

Command Output (stderr):
--
Could not find main function.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277907 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-06 02:00:45 +00:00
Lang Hames
38365dac94 [ORC] Add (partial) weak symbol support to the CompileOnDemand layer.
This adds partial support for weak functions to the CompileOnDemandLayer by
modifying the addLogicalModule method to check for existing stub definitions
before building a new stub for a weak function. This scheme is sufficient to
support ODR definitions, but fails for general weak definitions if strong
definition is encountered after the first weak definition. (A more extensive
refactor will be required to fully support weak symbols).

This patch does *not* add weak symbol support to RuntimeDyld: I hope to add
that in the near future.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277896 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-06 00:54:43 +00:00
Zachary Turner
ab23f2239f Resubmit "Make YAML support SmallVector"
This resubmits a3770391c5,
which was reverted due to breakages on non-Windows machines.

Due to differences in template instantiation rules on Microsoft
and non-Microsoft platforms, a member access restriction was
triggering on non-Microsoft compilers.  Previously, a friend
declaration for std::vector<> had been introduced into the
DebugMap class to make the member access restriction pass,
but the introduction of support for SmallVector<> meant that
an additional friend declaration would need to be added.

This didn't really make a lot of sense since the user of the
macro is probably only using one type (SmallVector<>, vector<>,
etc) and we could in theory add support for even more types
to this macro in the future (e.g. std::deque), so rather than
add another friend declaration, I just made the type being
referenced a public nested typedef instead of a private nested
typedef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277888 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-05 23:12:31 +00:00
Zachary Turner
3483f21bbc [CodeView] Decouple record deserialization from visitor dispatch.
Until now, our use case for the visitor has been to take a stream of bytes
representing a type stream, deserialize the records in sequence, and do
something with them, where "something" is determined by how the user
implements a particular set of callbacks on an abstract class.

For actually writing PDBs, however, we want to do the reverse. We have
some kind of description of the list of records in their in-memory format,
and we want to process each one. Perhaps by serializing them to a byte
stream, or perhaps by converting them from one description format (Yaml)
to another (in-memory representation).

This was difficult in the current model because deserialization and
invoking the callbacks were tightly coupled.

With this patch we change this so that TypeDeserializer is itself an
implementation of the particular set of callbacks. This decouples
deserialization from the iteration over a list of records and invocation
of the callbacks.  TypeDeserializer is initialized with another
implementation of the callback interface, so that upon deserialization it
can pass the deserialized record through to the next set of callbacks. In
a sense this is like an implementation of the Decorator design pattern,
where the Deserializer is a decorator.

This will be useful for writing Pdbs from yaml, where we have a
description of the type records in Yaml format. In this case, the visitor
implementation would have each visitation callback method implemented in
such a way as to extract the proper set of fields from the Yaml, and it
could maintain state that builds up a list of these records. Finally at
the end we can pass this information through to another set of callbacks
which serializes them into a byte stream.

Reviewed By: majnemer, ruiu, rnk
Differential Revision: https://reviews.llvm.org/D23177

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277871 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-05 21:45:34 +00:00
Kevin Enderby
cedb0b6b7e Add the first of what will be a long line of additional error checks for invalid Mach-O files.
This is where an LC_SEGMENT load command has a fileoff field that
extends past the end of the file.

Also fix llvm-nm and llvm-size to remove the errorToErrorCode() call so error messages are printed.
And needed to update a few test cases now that they do print the error messages just a
bit differently.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277845 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-05 18:19:40 +00:00
Gor Nishanov
e648a0611e opt: Adding -O0 to opt tool
Summary:
Having -O0 in opt allows testing that -O0 optimization
pipeline is built correctly.

Reviewers: majnemer

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D23208

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277829 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-05 16:27:33 +00:00
Zachary Turner
92cd0ecb7f [CodeView] Use llvm::Error instead of std::error_code.
This eliminates the remnants of std::error_code from the
DebugInfo libraries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277758 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-04 19:39:55 +00:00
Chris Bieneman
8acfa94475 [macho2yaml] String table can contain null strings
Since the string table being read from the MachO is a properly bounded StringRef including null strings is safe and reasonable.

This occurs frequently with stripped binaries where the string table has been modified.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277753 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-04 19:19:25 +00:00
Vedant Kumar
df48bd9ec3 [llvm-cov] Add some documentation for the -tab-size option
Also, un-hide the cl::opt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277741 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-04 18:00:42 +00:00
Ying Yi
65787e2459 [LLVM-COV]Replace tabs to the space indentations in the HTML coverage report.
When using orbis-llvm-cov.exe to generate the HTML report, the HTML report 
can look quite different to the source file if it includes tabs.The default
tab size is 2 spaces instead of 8 spaces. A command line switch is
be added to set the tab size.

Differential Revision: https://reviews.llvm.org/D23087

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277715 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-04 10:39:43 +00:00
Justin Bogner
e1dd154bf6 llvm-profdata: Clarify the top level help
It wasn't very obvious that you're supposed to call help on the
subcommands. This should help.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277678 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-03 23:10:51 +00:00
Kevin Enderby
b48816b9fc Clean up of libObject/Archive interfaces and change the last three uses of ErrorOr<>
changing them to Expected<> to allow them to pass through llvm Errors.
No functional change.

This commit by itself will break the next lld builds.  I’ll be committing the
matching change for lld immediately next.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277656 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-03 21:57:47 +00:00
Vedant Kumar
e5d157859c Reapply "More fixes to get good error messages for bad archives."
This reverts commit the revert commit r277627. The build errors
mentioned in r277627 were likely caused by an unclean build directory.
Sorry for the noise.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277630 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-03 19:02:50 +00:00
Vedant Kumar
a0149b5f2f Revert "More fixes to get good error messages for bad archives."
This reverts commit r277540. It breaks the build with:

../lib/Object/Archive.cpp:264:41: error: return type of out-of-line definition of 'llvm::object::ArchiveMemberHeader::getUID' differs from that in the declaration
Expected<unsigned> ArchiveMemberHeader::getUID() const {
~~~~~~~~~~~~~~~~~~                      ^
include/llvm/Object/Archive.h:53:12: note: previous declaration is here
  unsigned getUID() const;
  ~~~~~~~~ ^

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277627 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-03 18:44:32 +00:00
Zachary Turner
29b012cdcd [msf] Make FPM reader use MappedBlockStream.
MappedBlockSTream can work with any sequence of block data where
the ordering is specified by a list of block numbers.  So rather
than manually stitch them together in the case of the FPM, reuse
this functionality so that we can treat the FPM as if it were
contiguous.

Reviewed By: ruiu
Differential Revision: https://reviews.llvm.org/D23066

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277609 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-03 16:53:21 +00:00
Matthias Braun
b1f5b4a5bd CommandFlags.h/llc: Move StopAfter/StartBefore options to llc.
Move those two options to llc:

The options in CommandFlags.h are shared by dsymutil, gold, llc,
llvm-dwp, llvm-lto, llvm-mc, lto, opt.

-stop-after/-start-after only affect codegen passes however only gold and llc
actually create codegen passes and I believe these flags to be only
useful for users of llc. For the other tools they are just highly
confusing: -stop-after claims to "Stop compilation after a specific
pass" which is not true in the context of the "opt" tool.

Differential Revision: https://reviews.llvm.org/D23050

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277551 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-02 23:36:06 +00:00
Rui Ueyama
09f1981bfa pdbdump: Do not treat stream 0 pages as allocated pages.
I examined a few PDBs and all of them treated pages for stream 0
are unused, thus they were unmarked in their free page bitmap.
I think we should do the same thing for compatibility.

Differential Revision: https://reviews.llvm.org/D23047

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277545 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-02 23:22:46 +00:00
Kevin Enderby
d5adfbcabc More fixes to get good error messages for bad archives.
Fixed the last incorrect uses of llvm_unreachable() in the code
which were actually just cases of errors in the input Archives.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277540 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-02 22:58:55 +00:00
Lang Hames
f8cfb2fa65 [lli] Add the ability for OrcLazyJIT to accept multiple input modules.
LLI already supported passing multiple input modules to MCJIT via the
-extra-module option. This patch adds the plumbing to pass these modules to
the OrcLazy JIT too.

This functionality will be used in an upcoming test case for weak symbol
handling.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277521 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-02 21:00:40 +00:00
Zachary Turner
822ef4e420 [msf] Teach LLVM to parse a split Fpm.
The FPM is split at regular intervals across the MSF file, as the MS code
suggests. It turns out that the value of the interval is precisely the
block size. If the block size is 4096, then there are two Fpm pages every
4096 blocks.

So here we teach the PDBFile class to parse a split FPM, and also add more
options when dumping the FPM to display some additional information such
as orphaned pages (pages which the FPM says are allocated, but which
nothing appears to use), use after free pages (pages which the FPM says
are not allocated, but which are referenced by a stream), and multiple use
pages (pages which the FPM says are allocated but are used more than
once).

Reviewed By: ruiu
Differential Revision: https://reviews.llvm.org/D23022

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277388 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-01 21:19:45 +00:00
Lang Hames
075c1e2e1a [ExecutionEngine][MCJIT][Orc] Replace RuntimeDyld::SymbolInfo with JITSymbol.
This patch replaces RuntimeDyld::SymbolInfo with JITSymbol: A symbol class
that is capable of lazy materialization (i.e. the symbol definition needn't be
emitted until the address is requested). This can be used to support common
and weak symbols in the JIT (though this is not implemented in this patch).

For consistency, RuntimeDyld::SymbolResolver is renamed to JITSymbolResolver.

For space efficiency a new class, JITEvaluatedSymbol, is introduced that
behaves like the old RuntimeDyld::SymbolInfo - i.e. it is just a pair of an
address and symbol flags. Instances of JITEvaluatedSymbol can be used in
symbol-tables to avoid paying the space cost of the materializer.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277386 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-01 20:49:11 +00:00
David Majnemer
e2fac43a5a [COFF] Remove a duplicate import_directory_table_entry definition
We had import_directory_table_entry and
coff_import_directory_table_entry, remove one.  Also, factor out the
logic which determins if a descriptor is a terminator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277296 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-31 19:25:21 +00:00
David Majnemer
5494cee7ac [bugpoint] Add a -Os option
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277295 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-31 19:25:16 +00:00
Rui Ueyama
a8209f7b0e pdbdump: Dump Free Page Map contents.
Differential Revision: https://reviews.llvm.org/D22974

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277216 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 21:38:00 +00:00
Zachary Turner
5e117855c3 [msf] Resubmit "Rename Msf -> MSF".
Previously this change was submitted from a Windows machine, so
changes made to the case of filenames and directory names did
not survive the commit, and as a result the CMake source file
names and the on-disk file names did not match on case-sensitive
file systems.

I'm resubmitting this patch from a Linux system, which hopefully
allows the case changes to make it through unfettered.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277213 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 20:56:36 +00:00
Zachary Turner
85c3e3ee9c Revert "[msf] Rename Msf to MSF."
This reverts commit 4d1557ffac.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277194 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 18:38:47 +00:00
Zachary Turner
4d1557ffac [msf] Rename Msf to MSF.
In a previous patch, it was suggested to use all caps instead of
rolling caps for initialisms, so this patch changes everything
to do this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277190 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 18:24:26 +00:00
Kevin Enderby
2a7151766d The next step along the way to getting good error messages for bad archives.
As mentioned in commit log for r276686 this next step is adding a new
method in the ArchiveMemberHeader class to get the full name that
does proper error checking, and can be use for error messages.

To do this the name of ArchiveMemberHeader::getName() is changed to
ArchiveMemberHeader::getRawName() to be consistent with
Archive::Child::getRawName().  Then the “new” method is the addition
of a new implementation of ArchiveMemberHeader::getName() which gets
the full name and provides proper error checking.  Which is mostly a rewrite
of what was Archive::Child::getName() and cleaning up incorrect uses of
llvm_unreachable() in the code which were actually just cases of errors
in the input Archives.

Then Archive::Child::getName() is changed to return Expected<> and use
the new implementation of ArchiveMemberHeader::getName() .

Also needed to change Archive::getMemoryBufferRef() with these
changes to return Expected<> as well to propagate Errors up.
As well as changing Archive::isThinMember() to return Expected<> .


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277177 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 17:44:13 +00:00
Daniel Berlin
ad0220cb9b Rework CFG simplification in bugpoint
Summary:
Depends on D22841

We now use a much simpler CFG simplification routine for bugpoint,
because SimplifyCFG is no longer a good match for what bugpoint wants
to do.

At the same time, to make sure we don't lose anything valuable it was doing,
SimplifyCFG is now run as a per-BB reduction pass.

With this and D22841 combined, bugpoint operates both much faster on
the large testcases i have, and reduces them to pretty much minimal
testcases (in one case, bugpoint used to leave about 6000 useless blocks, and
now it leaves 3 ...)

Reviewers: chandlerc, majnemer

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D22845

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277063 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 22:29:25 +00:00
David Majnemer
880190560d [coroutines] Part 3 of N: Adding Boilerplate for Coroutine Passes
This adds boilerplate code for all coroutine passes,
the passes are no-ops for now.
Also, a small test has been added to verify that passes execute in
the expected order or not at all if coroutine support is disabled.

Patch by Gor Nishanov!

Differential Revision: https://reviews.llvm.org/D22847

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277033 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 21:04:31 +00:00
Zachary Turner
0c7a213a73 [pdb] Refactor library to more clearly separate reading/writing
Reviewed By: amccarth, ruiu
Differential Revision: https://reviews.llvm.org/D22693

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277019 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 19:12:28 +00:00
Zachary Turner
0c78d1d159 Get rid of IMsfStreamData class.
This was a pure virtual base class whose purpose was to abstract
away the notion of how you retrieve the layout of a discontiguous
stream of blocks in an Msf file.  This led to too many layers of
abstraction making it difficult to figure out what was going on
and extend things.  Ultimately, a stream's layout is decided by
its length and the array of block numbers that it lives on.  So
rather than have an abstract base class which can return this in
any number of ways, it's more straightforward to simply store them
as fields of a trivial struct, and also to give a more appropriate
name.

This patch does that.  It renames IMsfStreamData to MsfStreamLayout,
and deletes the 2 concrete implementations, DirectoryStreamData
and IndexedStreamData.  MsfStreamLayout is a trivial struct
with the necessary data.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277018 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 19:11:09 +00:00
Vedant Kumar
e201775db6 [llvm-cov] Add a debug mode for source range highlighting (in html)
llvm-cov's `-dump' option now emits information which helps debug source
range highlighting in html mode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276924 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-27 21:57:15 +00:00
Vedant Kumar
627477de2c Revert "[llvm-cov] Minor aesthetic improvements for html reports"
This reverts commit r276906. It breaks tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276908 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-27 19:59:44 +00:00
Vedant Kumar
afafefeaee [llvm-cov] Minor aesthetic improvements for html reports
This fixes the highlighting for lines without any coverage segments. I
don't have a neat way of testing this yet, but am working on it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276906 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-27 19:51:17 +00:00
Daniel Berlin
41bc5c29c9 Make bugpoint transform conditional jumps into unconditional jumps.
Summary:
Add a pass to bugpoint to make it transform conditional jumps into unconditional jumps.

Often, bugpoint generates output that has large numbers of br undef jumps, where
one side is dead.

What is happening is two fold:
1. It never tries to just pick a direction for the jump, and just see what happens
<<<< this patch

2. SimplifyCFG no longer is a good match for bugpoint's usecase. It
does too much.
Even things in SimplifyCFG, like removeUnreachableBlocks, go to great
lengths to transform undefined behavior into  blocks and kill large
parts of the CFG.  This is great for regular code, not so much for
bugpoint, which often generates UB on purpose (store undef is a great
example).
<<<< a followup patch that is coming, to move simplifycfg into a
separate reduction pass, and move the existing reduceCrashingBlocks
pass to use simpleSimplifyCFG.

Both of these patches significantly reduce the size and complexity of bugpoint
generated testcases.

Reviewers: chandlerc, majnemer

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D22841

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276884 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-27 16:13:25 +00:00
Vedant Kumar
c380ddf1dc [llvm-cov] Escape '\' in strings when emitting JSON
Test that Windows path separators are escaped properly. Add a round-trip
test to verify the JSON produced by the exporter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276832 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-27 04:08:32 +00:00
Andrew Wilkins
064517fef6 [llvm-go] parameterize $GOPATH construction
Summary:
To build llgo, you must currently ensure that llgo
is in the tools/llgo directory, due to a hard-coded
path in llvm-go.

To support the use of LLVM_EXTERNAL_LLGO_SOURCE_DIR,
we introduce a flag to llvm-go that enables the
caller to specify the paths to symlink in the
temporary $GOPATH.

Reviewers: pcc

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D21634

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276829 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-27 03:21:51 +00:00
Vedant Kumar
53397d1544 Retry: [llvm-cov] Add support for exporting coverage data to JSON
This enables users to export coverage information as portable JSON for use by
analysis tools and storage in document based databases.

The export sub-command is invoked just like the others:

  llvm-cov export -instr-profile path/to/foo.profdata path/to/foo.binary

The resulting JSON contains a list of files and functions. Every file object
contains a list of segments, expansions, and a summary of the file's region,
function, and line coverage. Every function object contains the function's name
and regions. There is also a total summary for the entire object file.

Changes since the initial commit (r276813):

  - Fixed the regexes in the tests to handle Windows filepaths.

Patch by Eddie Hurtig!

Differential Revision: https://reviews.llvm.org/D22651

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276818 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 22:50:58 +00:00
Vedant Kumar
63d80be936 Revert "[llvm-cov] Add support for exporting coverage data to JSON"
This reverts commit r276813. The Windows bots are complaining about some
of the filename regexes in the tests:

  http://bb.pgr.jp/builders/ninja-clang-i686-msc19-R/builds/5299

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276816 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 21:55:39 +00:00
Vedant Kumar
f57cf2f2c7 [llvm-cov] Add support for exporting coverage data to JSON
This enables users to export coverage information as portable JSON for use by
analysis tools and storage in document based databases.

The export sub-command is invoked just like the others:

  llvm-cov export -instr-profile path/to/foo.profdata path/to/foo.binary

The resulting JSON contains a list of files and functions. Every file object
contains a list of segments, expansions, and a summary of the file's region,
function, and line coverage. Every function object contains the function's name
and regions. There is also a total summary for the entire object file.

Patch by Eddie Hurtig!

Differential Revision: https://reviews.llvm.org/D22651

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276813 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 21:35:43 +00:00
Chris Bieneman
a6b4cd40ca [CMake] Updating Xcode Toolchain creation to support Xcode 7
Recent changes to Xcode have changed the structure of Xcode toolchains. This patch makes the xcode-toolchain goop construct a new-format Xcode toolchain that is compatible with Xcode 7.

The new format has a compatibility version key, so when a new format comes out we can support multiple formats in parallel.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276718 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 00:47:52 +00:00
Michael Kuperstein
b3391842c6 [PM] Port SymbolRewriter to the new PM
Differential Revision: https://reviews.llvm.org/D22703


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276687 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-25 20:52:00 +00:00
Joel Jones
8a39975ebd MC] Provide an MCTargetOptions to implementors of MCAsmBackendCtorTy, NFC
Some targets, notably AArch64 for ILP32, have different relocation encodings
based upon the ABI. This is an enabling change, so a future patch can use the
ABIName from MCTargetOptions to chose which relocations to use. Tested using
check-llvm.

The corresponding change to clang is in: http://reviews.llvm.org/D16538

Patch by: Joel Jones

Differential Revision: https://reviews.llvm.org/D16213


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276654 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-25 17:18:28 +00:00
Vedant Kumar
d12f3729fd [llvm-cov] Don't copy stylesheets into index files
Just link in the stylesheet from the toplevel dir of the report.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276468 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 20:49:23 +00:00