Commit Graph

5667 Commits

Author SHA1 Message Date
Kevin Enderby
300c79d840 Add the option, -non-verbose to llvm-objdump used with -macho to print things
using numeric values and not their symbolic constant names.

The routines that print Mach-O stuff already had a verbose parameter and this
change is just changing the passing true to passing !NonVerbose.  With just a
couple of fixes and a bunch of test case updates.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232182 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-13 17:56:32 +00:00
Frederic Riss
63a0e366a1 Reapply "[dsymutil] Gather function ranges during DIE selection."
This reverts commit r231967 which reinstates r231957.

Now that IntervalMap uses explicitely aligned storage, it should be safe.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232080 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-12 18:45:10 +00:00
Chris Bieneman
a08ee010be Refactoring CMake CrossCompile module.
* put most of the cross-compiling support into a function llvm_create_cross_target_internal.
* when CrossCompile is included it still generates a NATIVE target.
* llvm_create_cross_target function takes a target_name which should match a toolchain.
* llvm_create_cross_target can now be used to target more than one cross-compilation target.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232067 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-12 17:33:34 +00:00
Kevin Enderby
8284f0fb29 Add the option, -info-plist to llvm-objdump used with -macho to print the
Mach-O info plist section as strings.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231974 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 22:06:32 +00:00
Frederic Riss
d5fb5250fc Revert "[dsymutil] Gather function ranges during DIE selection."
This reverts commit r231957.

IntervalMap currently doesn't support keys more aligned than host pointers
and I've been using it with uint64_t keys. This asserts on some 32bits
systems.

Revert while I work on an IntervalMap generalization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231967 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 21:17:41 +00:00
Frederic Riss
fb14969197 [dsymutil] Add missing headers.
No build failure, found by code inspection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231958 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 18:46:01 +00:00
Frederic Riss
c45c6d4403 [dsymutil] Gather function ranges during DIE selection.
Gather the function ranges [low_pc, high_pc) during DIE selection and
store them along with the offset to apply to them to get the linked
addresses.

This is just the data collection part, it comes with no tests. That
information will be used in multiple followup commits to perform the
relocation of line tables and range sections among other things, and
these commits will add tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231957 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 18:45:59 +00:00
Frederic Riss
7944cd1ed2 [dsymutil] Small clang-format patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231956 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 18:45:57 +00:00
Frederic Riss
89393bbba6 [dsymutil] Correctly clone address attributes.
DW_AT_low_pc on functions is taken care of by the relocation processing, but
DW_AT_high_pc and DW_AT_low_pc on other lexical scopes need special handling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231955 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 18:45:52 +00:00
Justin Bogner
d39109de09 InstrProf: Teach llvm-cov to handle universal binaries when given -arch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231902 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 02:30:51 +00:00
Lang Hames
94c37b0b6a [Orc][MCJIT][RuntimeDyld] Re-apply r231726 and r231724 with fix suggested by
Dave Blaikie. Thanks Dave!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231896 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 00:43:26 +00:00
Eric Christopher
57849e3bb4 Remove the use of the subtarget in MCCodeEmitter creation and
update all ports accordingly. Required a couple of small rewrites
in handling subtarget features during creation in PPC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231861 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 22:03:14 +00:00
Yaron Keren
1132d0cc5b Teach raw_ostream to accept SmallString.
Saves adding .str() call to any raw_ostream << SmallString usage
and a small step towards making .str() consistent in the ADTs by
removing one of the SmallString::str() use cases, discussion at

http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20141013/240026.html

I'll update the Phabricator patch http://reviews.llvm.org/D6372
for review of the Twine SmallString support, it's more complex
than this one.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231763 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 07:33:23 +00:00
Eric Christopher
5225aec964 Temporarily revert r231726 and r231724 as they're breaking the build.:
Author: Lang Hames <lhames@gmail.com>
Date:   Mon Mar 9 23:51:09 2015 +0000

    [Orc][MCJIT][RuntimeDyld] Add header that was accidentally left out of r231724.

Author: Lang Hames <lhames@gmail.com>
Date:   Mon Mar 9 23:44:13 2015 +0000

    [Orc][MCJIT][RuntimeDyld] Add symbol flags to symbols in RuntimeDyld. Thread the
    new types through MCJIT and Orc.

    In particular, add a 'weak' flag. When plumbed through RTDyldMemoryManager, this
    will allow us to distinguish between weak and strong definitions and find the
    right ones during symbol resolution.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231731 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 00:33:27 +00:00
Lang Hames
6d6178426f [Orc][MCJIT][RuntimeDyld] Add symbol flags to symbols in RuntimeDyld. Thread the
new types through MCJIT and Orc.

In particular, add a 'weak' flag. When plumbed through RTDyldMemoryManager, this
will allow us to distinguish between weak and strong definitions and find the
right ones during symbol resolution.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231724 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-09 23:44:13 +00:00
Ed Schouten
71706a01b0 Add support for Nuxi CloudABI.
CloudABI is a POSIX-like runtime environment built around the concept of
capability-based security. More details:

	https://github.com/NuxiNL/cloudlibc

CloudABI uses its own ELFOSABI number. This number has been allocated by
the maintainers of ELF a couple of days ago.

Reviewed by:	echristo


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231681 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-09 18:40:45 +00:00
Benjamin Kramer
0df4e22602 Make helper functions static.
Found by -Wmissing-prototypes. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231664 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-09 16:23:46 +00:00
Aaron Ballman
b36506466f Adding parenthesis around logical expressions to silence a -Wparentheses warning; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231567 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-07 15:16:27 +00:00
Aaron Ballman
1e0774077e Removing spurious semi-colons; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231566 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-07 15:10:32 +00:00
Chandler Carruth
2349136630 [PM] Create a separate library for high-level pass management code.
This will provide the analogous replacements for the PassManagerBuilder
and other code long term. This code is extracted from the opt tool
currently, and I plan to extend it as I build up support for using the
new pass manager in Clang and other places.

Mailing this out for review in part to let folks comment on the terrible names
here. A brief word about why I chose the names I did.

The library is called "Passes" to try and make it clear that it is a high-level
utility and where *all* of the passes come together and are registered in
a common library. I didn't want it to be *limited* to a registry though, the
registry is just one component.

The class is a "PassBuilder" but this name I'm less happy with. It doesn't
build passes in any traditional sense and isn't a Builder-style API at all. The
class is a PassRegisterer or PassAdder, but neither of those really make a lot
of sense. This class is responsible for constructing passes for registry in an
analysis manager or for population of a pass pipeline. If anyone has a better
name, I would love to hear it. The other candidate I looked at was
PassRegistrar, but that doesn't really fit either. There is no register of all
the passes in use, and so I think continuing the "registry" analog outside of
the registry of pass *names* and *types* is a mistake. The objects themselves
are just objects with the new pass manager.

Differential Revision: http://reviews.llvm.org/D8054

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231556 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-07 09:02:36 +00:00
Frederic Riss
3c8e619a71 [dsymutil] Apply relocations to DIE data before cloning.
Doing this gets function's low_pc and global variable's locations right
in the output debug info. It also could get right other attributes
that need to be relocated (in linker terms), but I don't know of any
other than the address attributes.

This doesn't fixup low_pc attributes in compile_unit, lexical_block
or inlined subroutine, nor does it get right high_pc attributes
for function. This will come in a subsequent commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231544 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-07 01:25:09 +00:00
Frederic Riss
fe78287585 [dsymutil] Support cloning DIE reference attributes.
Reference attributes are mainly handled by just creating DIEEntry
attributes for them. There is a special case for DW_FORM_ref_addr
attributes though, because the DIEEntry code needs a DwarfDebug
code to emit them (and we don't have one as we do no CodeGen).
In that case, just use DIEInteger attributes with the right form.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231531 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-06 23:22:53 +00:00
Frederic Riss
1edd6edd60 [dsymutil] Set linked unit start offset early. NFC.
The start offset of a linked unit is known before starting to clone
its DIEs. Handling DW_FORM_ref_addr attributes requires that this
offset is set while cloning the unit. Split CompileUnit::computeOffsets()
into setStartOffset() and computeNextUnitOffset() and call them
repsectively before cloning the DIEs and right after.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231530 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-06 23:22:50 +00:00
Frederic Riss
98ecf5a7ed [dsymutil] Add debug_str construction support.
With this comes the ability to correctly clone string attributes in DIEs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231493 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-06 17:56:30 +00:00
Frederic Riss
497ca634e1 Revert "[dsymutil] MSVC does generate move constructors, but it should accept to default them"
This reverts commit r231350.

It turns out MSVC doesn't generate implicit move constructors and also doesn't accept to default them...
See for example http://lab.llvm.org:8011/builders/lldb-x86-windows-msvc/builds/2786

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231351 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-05 05:29:05 +00:00
Frederic Riss
0ff2c1e37f [dsymutil] MSVC does generate move constructors, but it should accept to default them
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231350 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-05 05:17:06 +00:00
David Blaikie
274eae84d8 Provide an explicit move ctor because MSVC can't synthesize one
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231303 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-04 22:20:52 +00:00
Frederic Riss
d0d92e7d30 [dsymutil] Add minimal code to emit DIE trees.
This commit adds code to emit DIE trees that have been pruned from the
parts that haven't been marked as kept in the previous pass.

It works by 'cloning' the input DIE tree (as read by libDebugInfoDwarf)
into a tree of DIE objects. Cloning the DIEs means essentially cloning
their attributes. The code in this commit does only handle scalar and
block attributes (scalar because they are trivial, blocks because they
can't be easily replaced by a scalr placeholder), all the other ones
are replaced by placeholder zero values and will be handled in
further commits.

The added tests mostly check that the DIE tree has the correct layout and
also verify that a few chosen scalar and block attributes correctly make
their way into the output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231300 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-04 22:07:44 +00:00
Rafael Espindola
671944ff8f Fix the build of the gold-plugin and examples.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231279 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-04 19:15:29 +00:00
Rafael Espindola
c90e7f79ca Bring r231132 back with a fix.
The issue was that we were always printing the remarks. Fix that and add a test
showing that it prints nothing if -pass-remarks is not given.

Original message:
Correctly handle -pass-remarks in the gold plugin.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231273 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-04 18:51:45 +00:00
Mehdi Amini
c94da20917 Make DataLayout Non-Optional in the Module
Summary:
DataLayout keeps the string used for its creation.

As a side effect it is no longer needed in the Module.
This is "almost" NFC, the string is no longer
canonicalized, you can't rely on two "equals" DataLayout
having the same string returned by getStringRepresentation().

Get rid of DataLayoutPass: the DataLayout is in the Module

The DataLayout is "per-module", let's enforce this by not
duplicating it more than necessary.
One more step toward non-optionality of the DataLayout in the
module.

Make DataLayout Non-Optional in the Module

Module->getDataLayout() will never returns nullptr anymore.

Reviewers: echristo

Subscribers: resistor, llvm-commits, jholewinski

Differential Revision: http://reviews.llvm.org/D7992

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231270 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-04 18:43:29 +00:00
NAKAMURA Takumi
69de0932a5 Revert r231132, "Correctly handle -pass-remarks in the gold plugin.", for now, to suppress log floodng in LTO.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231253 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-04 16:24:28 +00:00
Zachary Turner
b9c28bc7f1 [llvm-pdbdump] Display full enum definitions.
This will now display enum definitions both at the global
scope as well as nested inside of classes.  Additionally,
it will no longer display enums at the global scope if the
enum is nested.  Instead, it will omit the definition of
the enum globally and instead emit it in the corresponding
class definition.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231215 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-04 06:09:53 +00:00
David Blaikie
317ccafdbd Revert "Remove the explicit SDNodeIterator::operator= in favor of the implicit default"
Accidentally committed a few more of these cleanup changes than
intended. Still breaking these out & tidying them up.

This reverts commit r231135.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231136 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-03 21:18:16 +00:00
David Blaikie
b13215ec3b Remove the explicit SDNodeIterator::operator= in favor of the implicit default
There doesn't seem to be any need to assert that iterator assignment is
between iterators over the same node - if you want to reuse an iterator
variable to iterate another node, that's perfectly acceptable. Just
don't mix comparisons between iterators into disjoint sequences, as
usual.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231135 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-03 21:17:08 +00:00
Rafael Espindola
0685d06674 Correctly handle -pass-remarks in the gold plugin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231132 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-03 21:11:13 +00:00
Rafael Espindola
de833240aa Add r230655 back with a fix.
The issue is that now we have a diag handler during optimizations
and get forward every optimization remark, flooding stdout.

The same filtering should probably be done with or without a
custom handler, but for now just ignore remarks.

Original message:

gold-plugin: "Upgrade" debug info and handle its warnings.

The gold plugin never calls MaterializeModule, so any old debug info
was not deleted and could cause crashes.

Now that it is being "upgraded", the plugin also has to handle warnings
and create Modules with a nice id (it shows in the warning).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230991 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-02 19:08:03 +00:00
Zachary Turner
0c7c98a27d [llvm-pdbdump] Many minor fixes and improvements
A short list of some of the improvements:

1) Now supports -all command line argument, which implies many
   other command line arguments to simplify usage.
2) Now supports -no-compiler-generated command line argument to
   exclude compiler generated types.
3) Prints base class list.
4) -class-definitions implies -types.
5) Proper display of bitfields.
6) Can now distinguish between struct/class/interface/union.

And a few other minor tweaks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230933 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-02 04:39:56 +00:00
Benjamin Kramer
d59c5f9a06 Add missing includes. make_unique proliferated everywhere.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230909 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-01 21:28:53 +00:00
Zachary Turner
aac6cc3360 [llvm-pdbdump] Fix GCC build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230890 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-01 06:59:57 +00:00
Zachary Turner
53e4b56257 [llvm-pdbdump] Clean up method signatures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230889 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-01 06:51:29 +00:00
Zachary Turner
914913952c [llvm-pdbdump] Add regex-based filtering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230888 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-01 06:49:49 +00:00
NAKAMURA Takumi
a18f49225a Revert r230655, "gold-plugin: "Upgrade" debug info and handle its warnings."
It emits *millions of warnings* during selfhosting LTO build, to choke the buildbot with gigbytes of log.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230885 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-01 04:16:28 +00:00
Zachary Turner
e09af84db5 [llvm-pdbdump] Better error handling.
Previously it was impossible to distinguish between "There is
no PDB implementation for this platform" and "I tried to load
the PDB, but couldn't find the file", making it hard to figure
out if you built llvm-pdbdump incorrectly or if you just mistyped
a file name.

This patch adds proper error handling so that we can know exactly
what went wrong.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230868 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-28 20:23:18 +00:00
Frederic Riss
63ac784d31 [dsymutil] Fully qualify llvm::make_unique<>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230826 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-28 00:42:37 +00:00
Frederic Riss
2929a7accf [dsymutil] Add the DwarfStreamer class.
This class is responsible for getting the linked data to the
disk in the appropriate form. Today it it an empty shell that
just instantiates an MC layer.

As we do not put anything in the resulting file yet, we just
check it has the right architecture (and check that -o does
the right thing).

To be able to create all the components, this commit adds a
few dependencies to llvm-dsymutil, namely all-targets, MC and
AsmPrinter.

Also add a -no-output option, so that tests that do not need
the binary result can continue to run even if they do not have
the required target linked in.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230824 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-28 00:29:11 +00:00
Frederic Riss
d9a80bd641 [dsymutil] Add a LinkOptions struct to pass to the DwarfLinker. NFC.
The only option we have to pass down currently is verbosity, but there
are more to come.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230823 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-28 00:29:07 +00:00
Frederic Riss
fddb9d924e [dsymutil] clang-format a file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230822 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-28 00:29:05 +00:00
Frederic Riss
77f4ca1e41 [dsymutil] Add -o option to select ouptut filename
We do not create the output file yet, so no means to test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230821 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-28 00:29:03 +00:00
Frederic Riss
a2cd6a504c [dsymutil] Create warn() global helper...
...and reimplement DwarfLinker::reportWarning in terms of it. Other
compenents than the DwarfLinker will need to report warnings, and I'm
about to add a similar "error()" helper at the same global level so
make that consistent.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230820 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-28 00:29:01 +00:00
Frederic Riss
a646d2705f [dsymutil] Make trivial accessor const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230819 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-28 00:28:56 +00:00
David Majnemer
7de1732297 llvm-vtabledump: Update field with a better name
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230804 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-27 22:35:25 +00:00
Zachary Turner
b6fca0bb37 [llvm-pdbdump] Fix member initialization order warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230747 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-27 09:53:55 +00:00
Zachary Turner
756b823064 [llvm-pdbdump] Colorize output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230746 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-27 09:15:59 +00:00
Zachary Turner
964a619cad [llvm-pdbdump] Add support for dumping global variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230744 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-27 09:15:18 +00:00
David Majnemer
a72314cd80 llvm-vtabledump: Dump catch/throw exception structures for MS ABI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230713 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-27 00:43:58 +00:00
Zachary Turner
4490f2dc1a [llvm-pdbdump] Add missing files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230704 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-26 23:51:49 +00:00
Zachary Turner
6aba383ab5 [llvm-pdbdump] Fix dumping of function pointers and basic types.
Function pointers were not correctly handled by the dumper, and
they would print as "* name".  They now print as
"int (__cdecl *name)(int arg1, int arg2)" as they should.

Also, doubles were being printed as floats.  This fixes that bug
as well, and adds tests for all builtin types. as well as a test
for function pointers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230703 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-26 23:49:23 +00:00
Rafael Espindola
8d4343eb9b gold-plugin: "Upgrade" debug info and handle its warnings.
The gold plugin never calls MaterializeModule, so any old debug info
was not deleted and could cause crashes.

Now that it is being "upgraded", the plugin also has to handle warnings
and create Modules with a nice id (it shows in the warning).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230655 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-26 18:24:37 +00:00
David Majnemer
3bd9ff3f1e Replace a few instances of NULL with nullptr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230599 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-26 01:10:49 +00:00
Duncan P. N. Exon Smith
aaff953db4 llvm-dis: Stop crashing when dropping debug info
Since r199356, we've printed a warning when dropping debug info.
r225562 started crashing on that, since it registered a diagnostic
handler that only expected errors.  This fixes the handler to expect
other severities.  As a side effect, it now prints "error: " at the
start of error messages, similar to `llvm-as`.

There was a testcase for r199356, but it only really checked the
assembler.  Move `test/Bitcode/drop-debug-info.ll` to `test/Assembler`,
and introduce `test/Bitcode/drop-debug-info.3.5.ll` (and companion
`.bc`) to test the bitcode reader.

Note: tools/gold/gold-plugin.cpp has an equivalent bug, but I'm not sure
what the best fix is there.  I'll file a PR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230416 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-25 01:10:03 +00:00
David Blaikie
6606ad944b [opaque pointer type] Bitcode support for explicit type parameter on GEP.
Like r230414, add bitcode support including backwards compatibility, for
an explicit type parameter to GEP.

At the suggestion of Duncan I tried coalescing the two older bitcodes into a
single new bitcode, though I did hit a wrinkle: I couldn't figure out how to
create an explicit abbreviation for a record with a variable number of
arguments (the indicies to the gep). This means the discriminator between
inbounds and non-inbounds gep is a full variable-length field I believe? Is my
understanding correct? Is there a way to create such an abbreviation? Should I
just use two bitcodes as before?

Reviewers: dexonsmith

Differential Revision: http://reviews.llvm.org/D7736

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230415 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-25 01:08:52 +00:00
Tobias Grosser
bc8f84c030 Revert "Raising minimum required CMake version to 2.8.12.2."
This reverts commit r230062.

Debian stable (wheezy) ships still with cmake 2.8.9.

The commit broke my LLVM/Polly buildbot, to my knowledge our only Linux+cmake
buildbot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230343 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-24 16:39:46 +00:00
Manman Ren
bd26e6a006 [LTO API] add lto_codegen_set_module to set the destination module.
When debugging LTO issues with ld64, we use -save-temps to save the merged
optimized bitcode file, then invoke ld64 again on the single bitcode file to
speed up debugging code generation passes and ld64 stuff after code generation.

llvm linking a single bitcode file via lto_codegen_add_module will generate a
different bitcode file from the single input. With the newly-added
lto_codegen_set_module, we can make sure the destination module is the same as
the input.

lto_codegen_set_module will transfer the ownship of the module to code
generator.

rdar://19024554


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230290 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-24 00:45:56 +00:00
Justin Bogner
90c4e8b70c InstrProf: Teach llvm-cov to show the max count instead of the last
When multiple regions start on the same line, llvm-cov was just
showing the count of the last one as the line count. This can be
confusing and misleading for things like one-liner loops, where the
count at the end isn't very interesting, or even "if" statements with
an opening brace at the end of the line.

Instead, use the maximum of all of the region start counts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230263 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 21:21:34 +00:00
Chad Rosier
9659f43f10 Revert "Revert "Raising minimum required CMake version to 2.8.12.2.""
This reverts commit r230240, which was an accidental commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230246 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 19:34:04 +00:00
Chad Rosier
3986322604 Revert "Raising minimum required CMake version to 2.8.12.2."
This reverts commit 247aed4710.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230240 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 19:15:08 +00:00
Benjamin Kramer
84bcaea04a [llvm-pdbdump] Remove unused variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230216 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 11:33:54 +00:00
Zachary Turner
ad73d54ee0 [llvm-pdbdump] Fix builders again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230205 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 06:13:27 +00:00
Zachary Turner
4ad658d8f1 [llvm-pdbdump] Very minor code cleanup.
This just removes some dead enums as well as some debug flushes
of stdout.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230204 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 05:59:14 +00:00
Zachary Turner
92d755ea65 [llvm-pdbdump] Add an option to dump full class definitions.
This adds the --class-definitions flag.  If specified, when dumping
types, instead of "class Foo" you will see the full class definition,
with member functions, constructors, access specifiers.

NOTE: Using this option can be very slow, as generating a full class
definition requires accessing many different parts of the PDB.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230203 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 05:58:34 +00:00
David Majnemer
1f229009ed llvm-pdbdump: Fix gcc/clang build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230187 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-22 22:33:57 +00:00
Zachary Turner
86a84e3368 [llvm-pdbdump] Fix a few compilation failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230186 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-22 22:20:26 +00:00
Zachary Turner
395adf9f89 [llvm-pdbdump] Rewrite dumper using visitor pattern.
This increases the flexibility of how to dump different
symbol types -- necessary for context-sensitive formatting of
symbol types -- and also improves the modularity by allowing
the dumping to be implemented in the actual dumper, as opposed
to in the PDB library.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230184 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-22 22:03:38 +00:00
Zachary Turner
e759e99a67 [llvm-pdbdump] Simplify options and output.
This removes a wealth of options, and instead now only provides
three options.  -symbols, -types, and -compilands.  This greatly
simplifies use of the tool, and makes it easier to understand
what you're going to see when you run the tool.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230182 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-22 21:45:38 +00:00
Shankar Easwaran
5872174fd8 [obj2yaml/yaml2obj] Add SHT_GROUP support.
This adds section group support to the tools obj2yaml and yaml2obj.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230124 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-21 04:28:26 +00:00
Rafael Espindola
7ef23e62b2 Set the datalayout in the gold plugin.
This fixes the gold tests after r230054.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230098 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-21 00:13:15 +00:00
Chris Bieneman
247aed4710 Raising minimum required CMake version to 2.8.12.2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230062 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-20 21:28:18 +00:00
Peter Collingbourne
7d3b145da4 llvm-mc: Use Target::createNullStreamer to fix crashes on target-specific asm directives.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229798 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-19 00:45:04 +00:00
Reid Kleckner
f89d9b1c75 Add an IR-to-IR test for dwarf EH preparation using opt
This tests the simple resume instruction elimination logic that we have
before making some changes to it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229768 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-18 23:17:41 +00:00
Zachary Turner
23719010db Modify llvm-readobj to dump symbol record bytes.
This will help us study the format of individual symbol
records more closely.

Differential Revision: http://reviews.llvm.org/D7664
Reviewed by: Timur Iskhodzhanov

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229730 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-18 19:32:05 +00:00
Chris Bieneman
c689d4b9f2 Fixing a CMake developer warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229721 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-18 18:52:11 +00:00
Kevin Enderby
b019348f5d Add code to llvm-objdump so the -section option with -macho will dump literal pointer sections
with the Mach-O S_LITERAL_POINTERS section type.

Also fix the printing of the leading addresses for literal sections to be consistent and
not print the 0x prefix.  Updated test cases to match.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229548 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-17 21:35:48 +00:00
NAKAMURA Takumi
36fcfaf54e [CMake] Add RuntimeDyld to libdeps corresponding to r229343.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229351 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16 02:13:30 +00:00
Aaron Ballman
66981fe208 Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229340 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-15 22:54:22 +00:00
Zachary Turner
70e171f7cd llvm-pdbdump: Fix warning caused by missing sentinel value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229331 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-15 20:37:44 +00:00
Zachary Turner
7f6d93f718 llvm-pdbdump: Add flags controlling the type of values to dump.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229330 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-15 20:27:53 +00:00
Chandler Carruth
15db81893f [gold] Consolidate the gold plugin options and actually search for
a gold binary explicitly. Substitute this binary into the tests rather
than just directly executing the 'ld' binary.

This should allow folks to inject a cross compiling gold binary, or in
my case to use a gold binary built and installed somewhere other than
/usr/bin/ld. It should also allow the tests to find 'ld.gold' so that
things work even if gold isn't the default on the system.

I've only stubbed out support in the makefile to preserve the existing
behavior with none of the fancy logic. If someone else wants to add
logic here, they're welcome to do so.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229251 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-14 09:43:57 +00:00
Justin Bogner
1ec34b0c61 llvm-cov: Actually use the command line arguments when reporting
This code didn't really make sense as is. If a filename is passed in,
the user obviously wants the coverage *for that file*, not *for
everything*.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229217 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-14 02:05:05 +00:00
Justin Bogner
9bdb194b86 llvm-cov: Simplify coverage reports, fixing PR22575 in the process
PR22575 occurred because we were unsafely storing references into a
std::vector. If the vector moved because it grew, we'd be left
iterating through garbage memory. This avoids the issue by simplifying
the logic to gather coverage information as we go, rather than storing
it and iterating over it.

I'm relying on the existing tests showing that this is semantically
NFC, since it's difficult to hit the issue this fixes without
relatively large covered programs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229215 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-14 02:01:24 +00:00
Peter Collingbourne
0f7084338a llvm-go: Set $GCCGO instead of putting a gccgo executable on $PATH.
Now that llgo ships its own go command we can rely on it having support for $GCCGO.

Differential Revision: http://reviews.llvm.org/D7628

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229210 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-14 01:45:57 +00:00
Peter Collingbourne
e887b2e8f3 llvm-go: Add flag for specifying path to go command.
Differential Revision: http://reviews.llvm.org/D7627

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229209 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-14 01:45:56 +00:00
Frederic Riss
2e2ed16a3b [dsymutil] Add DIE selection algorithm.
With this commit, llvm-dsymutil learns how to choose which DIEs
it will link in the final output and which ones it won't. This
is based on the 'valid relocation' information that has been
built in the previous commits.

The test only tests that we choose the right 'root DIEs'. The
selection algorithm (and especially the part that walk the
dependencies of a root DIE) lacks a bit test coverage. This
will be much easier to cover when we output actual Dwarf and
thus can use llvm-dwarfdump to verify the structure of the
emitted DIE trees. I'll add more tests then.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229183 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 23:18:34 +00:00
Frederic Riss
443abd7905 [dsymutil] Downcase a function name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229182 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 23:18:31 +00:00
Frederic Riss
5bdb2cda7f [dsymutil] Add a few generic helper methods.
To be used in subsequent commits (separated to keep only core logic
in the follow-ups).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229181 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 23:18:29 +00:00
Frederic Riss
abcb98090c [dsymutil] constify trivial function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229180 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 23:18:27 +00:00
Frederic Riss
16acc91bc4 [dsymutil] Find relocations that correspond to debug map entries.
These 'valid relocations' in the debug_info section will be how
dsymutil identifies the DIEs it needs to keep in the linked debug
information.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229178 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 23:18:22 +00:00
Frederic Riss
e9483b84f0 [dsymutil] Add DebugMapObject::lookupObjectAddress()
It turns out the debug map will be interogated both by name and
by object file address. Add the latter capability.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229177 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 23:18:16 +00:00
Chandler Carruth
29a861abc9 [PM] Fix a compile error I introduced in r229094 and didn't notice
because I didn't have binutils set up properly to build the gold plugin.

Fixes PR22581 which was filed because this broke the build for folks
relying on the plugin. Very sorry! =]

I've gotten the plugin stuff building now as well so it shouldn't keep
happening.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229156 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 21:10:58 +00:00
Chandler Carruth
417c5c172c [PM] Remove the old 'PassManager.h' header file at the top level of
LLVM's include tree and the use of using declarations to hide the
'legacy' namespace for the old pass manager.

This undoes the primary modules-hostile change I made to keep
out-of-tree targets building. I sent an email inquiring about whether
this would be reasonable to do at this phase and people seemed fine with
it, so making it a reality. This should allow us to start bootstrapping
with modules to a certain extent along with making it easier to mix and
match headers in general.

The updates to any code for users of LLVM are very mechanical. Switch
from including "llvm/PassManager.h" to "llvm/IR/LegacyPassManager.h".
Qualify the types which now produce compile errors with "legacy::". The
most common ones are "PassManager", "PassManagerBase", and
"FunctionPassManager".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229094 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 10:01:29 +00:00