Commit Graph

5505 Commits

Author SHA1 Message Date
David Majnemer
1dd631fe02 llvm-objdump: Skip empty sections when dumping contents
Empty sections are just noise when using objdump.
This is similar to what binutils does.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221680 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-11 09:58:25 +00:00
NAKAMURA Takumi
fdf59619d2 [CMake] llvm-shlib: Prune redundant components, AsmPrinter, MC, and SelectionDAG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221675 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-11 07:57:25 +00:00
NAKAMURA Takumi
75318bcc3c [CMake] llvm-c-test: Use libLLVM.so if it is available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221592 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-10 15:04:26 +00:00
NAKAMURA Takumi
5f3f254ed1 [CMake] Let llvm-shlib work on Linux with --whole-archive.
FIXME: It should work on not only Linux but elf-targeting gnu ld.

For example if LLVM_DYLIB_COMPONENTS is "BitWriter Support", CMake emits the command line like;

  -Wl,--whole-archive
    lib/libLLVMBitWriter.a
    lib/libLLVMSupport.a *1
  -Wl,--no-whole-archive
  lib/libLLVMCore.a
  lib/libLLVMSupport.a   *2
  -lrt -ldl -ltinfo -lpthread -lm

It works since symbols in LLVMCore is resolved with not *2 but *1.

Unfortunately, --gc-sections is not powerful in this case to prune unused "visibility(default)" entries.

I am still experimenting other way not to rely on --whole-archive.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221591 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-10 15:04:02 +00:00
NAKAMURA Takumi
c305163d14 [CMake] Move llvm-shlib in prior to other tools.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221590 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-10 15:03:02 +00:00
NAKAMURA Takumi
e1e1392e13 [CMake] llvm-shlib: Add possibly missing BitReader and MCDisassembler for llvm-c.
FYI, 3 modules below are redundant in trunk;

  AsmPrinter
  MC
  SelectionDAG

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221579 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-08 14:12:30 +00:00
Rafael Espindola
3fc63a67f2 Remove unused variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221549 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-07 21:33:09 +00:00
Saleem Abdulrasool
35c163020a Transform: add SymbolRewriter pass
This introduces the symbol rewriter. This is an IR->IR transformation that is
implemented as a CodeGenPrepare pass. This allows for the transparent
adjustment of the symbols during compilation.

It provides a clean, simple, elegant solution for symbol inter-positioning. This
technique is often used, such as in the various sanitizers and performance
analysis.

The control of this is via a custom YAML syntax map file that indicates source
to destination mapping, so as to avoid having the compiler to know the exact
details of the source to destination transformations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221548 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-07 21:32:08 +00:00
Michael J. Spencer
049368273b Fix style.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221547 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-07 21:30:36 +00:00
Rafael Espindola
0cb58206b1 Use StringRefMemoryObject in llvm-mc. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221536 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-07 17:59:05 +00:00
Jay Foad
222fcc59cb llvm-symbolizer: teach it about PowerPC64 ELF function descriptors
Summary:
Teach llvm-symbolizer about PowerPC64 ELF function descriptors. Symbols in the .opd section point to function descriptors, the first word of which is a pointer to the real function. For the purposes of symbolizing we pretend that the symbol points directly to the function.

This is enough to get decent function names in stack traces for unoptimized binaries, which fixes the sanitizer print-stack-trace test on PowerPC64 Linux.

Reviewers: kcc, willschm, samsonov

Reviewed By: samsonov

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221514 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-07 09:08:39 +00:00
Rafael Espindola
751848bb02 Use StringRefMemoryObject. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221502 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-07 00:52:15 +00:00
Simon Atanasyan
848edb1bfa [ELF][yaml2obj] Handle additional MIPS specific st_other field flags
The ELF symbol `st_other` field might contain additional flags besides
visibility ones. This patch implements support for some MIPS specific
flags.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221491 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-06 22:46:24 +00:00
Kevin Enderby
3b80486e3a Plumb in the ARM thumb symbolizer in llvm-objdump’s Mach-O disassembler and
add the code and test cases for 32-bit ARM symbolizer.

Also fixed the printing of data in code as it was not using the table correctly
and needed to fix one of the test cases too.

This will break lld’s test/mach-o/arm-interworking-movw.yaml till the tweak
for that is made. Which I’ll be committing immediately after this commit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221470 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-06 19:00:13 +00:00
Simon Atanasyan
5563be0f4f Add accessor to get 'visibility' part of st_other field
This new `getVisibility()` function will also be used in the LLD code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221392 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-05 20:47:35 +00:00
Duncan P. N. Exon Smith
bad06b13ba IR: MDNode => Value: NamedMDNode::getOperator()
Change `NamedMDNode::getOperator()` from returning `MDNode *` to
returning `Value *`.  To reduce boilerplate at some call sites, add a
`getOperatorAsMDNode()` for named metadata that's expected to only
return `MDNode` -- for now, that's everything, but debug node named
metadata (such as llvm.dbg.cu and llvm.dbg.sp) will soon change.  This
is part of PR21433.

Note that there's a follow-up patch to clang for the API change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221375 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-05 18:16:03 +00:00
David Majnemer
4787059b2f llvm-readobj: Add support for dumping the DOS header in PE files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221333 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-05 06:24:35 +00:00
David Majnemer
3aeca77385 llvm-objdump: Pass DiceTableEntry by reference
DiceTableEntry is 24 bytes on my machine, it's probably better to pass
them by reference.

This fixes PR21464.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221247 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-04 08:41:48 +00:00
Michael J. Spencer
58206dd147 Use findProgramByName.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221221 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-04 01:29:59 +00:00
Kevin Enderby
a25032214d Add the code and test cases for 32-bit Intel to llvm-objdump’s Mach-O symbolizer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221211 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-04 00:43:16 +00:00
Reid Kleckner
cce85e19f9 MSVC requires redeclarations to repeat noexcept
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221177 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-03 20:35:30 +00:00
David Majnemer
5dc81d5a76 llvm-vtabledump: Handle Itanium VTables
Add support in the vtable dumper for the Itanium ABI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221133 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-03 07:23:25 +00:00
Diego Novillo
2b6bd7aaf5 Use ErrorOr for the ::create factory on instrumented and sample profilers.
Summary:
As discussed in
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20141027/242445.html,
the creation of reader and writer instances is better done using
ErrorOr. There are no functional changes, but several callers needed to
be adjusted.

Reviewers: bogner

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221120 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-03 00:51:45 +00:00
Rafael Espindola
fc095209b8 Fix the build of the gold plugin.
I did the previous patch on OS X and didn't noticed the issue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221070 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-01 23:49:44 +00:00
Rafael Espindola
5793838fc8 Remove redundant calls to isMaterializable.
This removes calls to isMaterializable in the following cases:

* It was redundant with a call to isDeclaration now that isDeclaration returns
  the correct answer for materializable functions.
* It was followed by a call to Materialize. Just call Materialize and check EC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221050 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-01 16:46:18 +00:00
NAKAMURA Takumi
6128ca928d [CMake] llvm-profdata requires Core.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221046 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-01 11:46:04 +00:00
Diego Novillo
9657de5f22 Add show and merge tools for sample PGO profiles.
Summary:
This patch extends the 'show' and 'merge' commands in llvm-profdata to handle
sample PGO formats. Using the 'merge' command it is now possible to convert
one sample PGO format to another.

The only format that is currently not working is 'gcc'. I still need to
implement support for it in lib/ProfileData.

The changes in the sample profile support classes are needed for the
merge operation.

Reviewers: bogner

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221032 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-01 00:56:55 +00:00
Lang Hames
7b8ba81502 [Object] Modify OwningBinary's interface to separate inspection from ownership.
The getBinary and getBuffer method now return ordinary pointers of appropriate
const-ness. Ownership is transferred by calling takeBinary(), which returns a
pair of the Binary and a MemoryBuffer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221003 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 21:37:49 +00:00
David Majnemer
a2715904e5 Object, COFF: Cleanup symbol type code, improve binutils compatibility
Do a better job classifying symbols.  This increases the consistency
between the COFF handling code and the ELF side of things.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220952 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 05:07:00 +00:00
Justin Bogner
76ebe3d35c llvm-cov: Follow LLVM naming conventions
This renames a few things that are using an unusual naming convention.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220929 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-30 20:57:49 +00:00
Justin Bogner
6e5def6b3e llvm-cov: Don't manually parse an option for no reason
We're using cl::opt here, but for some reason we're reading out one
particular option by hand instead. This makes -help and the like
behave rather poorly, so let's not do it this way.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220928 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-30 20:51:24 +00:00
Justin Bogner
d33e67757e llvm-cov: Very basic top level help
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220926 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-30 20:29:48 +00:00
Rafael Espindola
d07e7ecd85 Enable the slp vectorizer in the gold plugin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220887 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-30 00:38:54 +00:00
Rafael Espindola
74ded7c790 Enable the loop vectorizer in the gold plugin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220886 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-30 00:11:24 +00:00
Rafael Espindola
25016f9d2e Replace also-emit-llvm with save-temps.
The also-emit-llvm option only supported getting the IR before optimizations.
This patch replaces it with a more generic save-temps option that saves the IR
both before and after optimizations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220885 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-29 23:54:45 +00:00
Kevin Enderby
be5683a6e0 Run clang-format on tools/llvm-objdump/MachODump.cpp . No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220875 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-29 21:28:24 +00:00
Michael Kuperstein
a042c235bb Fix build with CMake if LLVM_USE_INTEL_JITEVENTS option is enabled
* Added LLVM libraries required for IntelJITEvents to LLVMBuild.txt.
* Removed 'jit' library from llvm-jitlistener.
* Added support for OptionalLibraries to llvm-build cmake files generator.

Patch by aleksey.a.bader@intel.com

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220848 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-29 09:18:49 +00:00
Kevin Enderby
17380c7afa Update llvm-objdump’s Mach-O symbolizer code to demangle C++ names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220833 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-28 23:39:46 +00:00
Rafael Espindola
c35c39b73c Remove the PreserveSource linker mode.
I noticed that it was untested, and forcing it on caused some tests to fail:

    LLVM :: Linker/metadata-a.ll
    LLVM :: Linker/prefixdata.ll
    LLVM :: Linker/type-unique-odr-a.ll
    LLVM :: Linker/type-unique-simple-a.ll
    LLVM :: Linker/type-unique-simple2-a.ll
    LLVM :: Linker/type-unique-simple2.ll
    LLVM :: Linker/type-unique-type-array-a.ll
    LLVM :: Linker/unnamed-addr1-a.ll
    LLVM :: Linker/visibility1.ll

If it is to be resurrected, it has to be fixed and we should probably have a
-preserve-source command line option in llvm-mc and run tests with and without
it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220741 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-28 00:24:16 +00:00
Rafael Espindola
0660f174cf Make it easier to pass a custom diagnostic handler to the IR linker.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220732 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-27 23:02:10 +00:00
Arnold Schwaighofer
b26fb77d9b Add an option to the LTO code generator to disable vectorization during LTO
We used to always vectorize (slp and loop vectorize) in the LTO pass pipeline.

r220345 changed it so that we used the PassManager's fields 'LoopVectorize' and
'SLPVectorize' out of the desire to be able to disable vectorization using the
cl::opt flags 'vectorize-loops'/'slp-vectorize' which the before mentioned
fields default to.
Unfortunately, this turns off vectorization because those fields
default to false.
This commit adds flags to the LTO library to disable lto vectorization which
reconciles the desire to optionally disable vectorization during LTO and
the desired behavior of defaulting to enabled vectorization.

We really want tools to set PassManager flags directly to enable/disable
vectorization and not go the route via cl::opt flags *in*
PassManagerBuilder.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220652 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-26 21:50:58 +00:00
Rafael Espindola
e272236d69 Remove unused variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220610 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-25 04:07:53 +00:00
Rafael Espindola
72478e59c7 Update the error handling of lib/Linker.
Instead of passing a std::string&, use the new diagnostic infrastructure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220608 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-25 04:06:10 +00:00
Rafael Espindola
c498284e46 Modernize the error handling of the Materialize function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220600 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-24 22:50:48 +00:00
Rafael Espindola
68b02dcd54 Don't ever call materializeAllPermanently during LTO.
To do this, change the representation of lazy loaded functions.

The previous representation cannot differentiate between a function whose body
has been removed and one whose body hasn't been read from the .bc file. That
means that in order to drop a function, the entire body had to be read.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220580 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-24 18:13:04 +00:00
Timur Iskhodzhanov
13535f412a PR21189: Teach llvm-readobj to dump bits of COFF symbol subsections required to debug using VS2012+
Reviewed at http://reviews.llvm.org/D5755
Thanks to Andrey Guskov for his help investigating this!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220526 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-23 22:25:31 +00:00
Hans Wennborg
e4e2ea6839 MachODump.cpp: fix MSVC build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220518 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-23 21:59:17 +00:00
Kevin Enderby
4d529076b6 Change the name of the field BindTable to bindtable to not over lap the type.
Should fix the build bot issues from commit r220500.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220504 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-23 19:53:12 +00:00
Rafael Espindola
e37b00e50b Make llvm-link behave a bit more like LTO.
* Read modules lazily
* Don't treat the first file specially, instead merge all inputs into an empty
  module.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220501 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-23 19:40:45 +00:00
Kevin Enderby
a1afbd6421 Update llvm-objdump’s Mach-O symbolizer code for Objective-C references.
This prints disassembly comments for Objective-C references to CFStrings,
Selectors, Classes and method calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220500 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-23 19:37:31 +00:00
Chris Bieneman
71926e73ba Adding llvm-shlib to CMake build system with a few new bells and whistles
Summary:
This patch adds a new CMake build setting LLVM_BUILD_LLVM_DYLIB, which defaults to OFF. When set to ON, this will generate a shared library containing most of LLVM. The contents of the shared library can be overriden by specifying LLVM_DYLIB_COMPONENTS. LLVM_DYLIB_COMPONENTS can be set to a semi-colon delimited list of any LLVM components that you llvm-config can resolve.

On Windows, unless you are using Cygwin, you must specify an explicit symbol export file using LLVM_EXPORTED_SYMBOL_FILE. On Cygwin and all unix-like platforms if you do not specify LLVM_EXPORTED_SYMBOL_FILE, an export file containing only the LLVM C API will be auto-generated from the list of LLVM components specified in LLVM_DYLIB_COMPONENTS.

Reviewers: rnk

Reviewed By: rnk

Subscribers: rnk, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220490 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-23 17:22:14 +00:00
NAKAMURA Takumi
78582d480a [CMake] Prune CRLF in CMakeLists.txt(s).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220480 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-23 11:31:50 +00:00
Peter Collingbourne
bdc3a5b99a Add llvm-go tool.
This tool lets us build LLVM components within the tree by setting up a
$GOPATH that resembles a tree fetched in the normal way with "go get".

It is intended that components such as the Go frontend will be built in-tree
using this tool.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220462 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-23 02:33:23 +00:00
Rafael Espindola
d5b89313e0 Make two helper functions static.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220389 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-22 15:05:51 +00:00
Aaron Ballman
df8b8e7f69 Fixing a -Wsign-compare warning; NFC.
I think it might make sense to make COFF::MaxNumberOfSections16 be a uint32_t, however, that may have wider-reaching implications in other projects, which is why I did not change that declaration.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220384 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-22 13:09:43 +00:00
Rafael Espindola
230b53fd1b Handle spaces and quotes in file names in MRI scripts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220364 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-22 03:10:56 +00:00
Rafael Espindola
f9ebe0ad75 Fix a gcc warning.
Thanks to Filipe Cabecinhas for the report.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220361 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-22 02:23:31 +00:00
Rafael Espindola
f6b403a753 MRI scripts: Add addlib support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220346 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-21 23:18:51 +00:00
Rafael Espindola
e0b4b36be6 Use a range loop. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220344 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-21 23:04:55 +00:00
Rafael Espindola
e539932aad Overwrite instead of adding to archives when creating them in mri scripts.
This matches the behavior of GNU ar and also makes it easier to implemnt
support for the addlib command.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220336 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-21 21:56:47 +00:00
Rafael Espindola
c6961f286b Convert a few std::string with StringRef. NFC.
This is a micro optimization, but also makes the code a bit more flexible.

The MRIMembers variable is a short term hack. It is going away in the next
commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220334 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-21 21:47:27 +00:00
Rafael Espindola
41e69be6cb Use a StringRef. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220327 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-21 21:07:49 +00:00
Rafael Espindola
2256b352be Move code a bit to avoid a few declarations. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220317 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-21 20:34:57 +00:00
Rafael Espindola
32adf22cd1 Comment cleanup. NFC.
Don't duplicate names in comments and remove useless ones. Hopefully anyone
reading this knows what main is.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220298 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-21 15:49:46 +00:00
Rafael Espindola
2afb0e4d2c Add support for addmod to mri scripts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220294 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-21 14:46:17 +00:00
Rafael Espindola
410bde5171 Add a test that would have found the bug in r219829.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220016 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-17 01:34:23 +00:00
Rafael Espindola
70a1be3f76 Revert commit r219835 and r219829.
Revert "Correctly handle references to section symbols."
Revert "Allow forward references to section symbols."

Rui found a regression I am debugging.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220010 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-17 01:06:02 +00:00
Alexander Potapenko
0fea775e5c [llvm-symbolizer] Introduce the -dsym-hint option.
llvm-symbolizer will consult one of the .dSYM paths passed via -dsym-hint
if it fails to find the .dSYM bundle at the default location.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220004 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-17 00:50:19 +00:00
Rafael Espindola
2f8f1d34e3 Delete -std-compile-opts.
These days -std-compile-opts was just a silly alias for -O3.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219951 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-16 20:00:02 +00:00
Nick Kledzik
fb02b5c37f [llvm-objdump] Fix -private-headers for mach-o to print all LC_*_DYLIB variants
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219945 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-16 18:58:20 +00:00
Rafael Espindola
ad04f5db82 Correctly handle references to section symbols.
When processing assembly like

.long .text

we were creating a new undefined symbol .text. GAS on the other hand would
handle that as a reference to the .text section.

This patch implements that by creating the section symbols earlier so that
they are visible during asm parsing.

The patch also updates llvm-readobj to print the symbol number in the relocation
dump so that the test can differentiate between two sections with the same name.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219829 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-15 18:55:30 +00:00
Rafael Espindola
90ce9f70e2 Simplify handling of --noexecstack by using getNonexecutableStackSection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219799 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-15 16:12:52 +00:00
Nick Kledzik
1a0afd82b1 [llvm-objdump] Update error message and add test case for mach-o file with bad library ordinals
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219746 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 23:29:38 +00:00
Alexander Potapenko
49e7edc0fa [llvm-symbolizer] Minor typedef cleanup. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219682 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 13:40:44 +00:00
Eric Christopher
151811c07a Add lld to the parallel set of directories since it doesn't depend
on any of the other tools directories.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219667 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 06:56:28 +00:00
Rafael Espindola
f02687d9eb llvm-ar: Start adding support for mri scripts.
I was quiet surprised to find this feature being used. Fortunately the uses
I found look fairly simple. In fact, they are just a very verbose version
of the regular ar commands.

Start implementing it then by parsing the script and setting the command
variables as if we had a regular command line.

This patch adds just enough support to create an empty archive and do a bit
of error checking. In followup patches I will implement at least addmod
and addlib.

From the description in the manual, even the more general case should not
be too hard to implement if needed. The features that don't map 1:1 to
the simple command line are

* Reading from multiple archives.
* Creating multiple archives.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219521 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-10 18:33:51 +00:00
Rafael Espindola
a447422da3 Fix gcc warning in gold-plugin.cpp.
Patch by Markus Trippelsdorf!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219459 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-10 00:48:13 +00:00
David Majnemer
54a3b749e1 obj2yaml, COFF: Handle long section names
Long section names are represented as a slash followed by a numeric
ASCII string.  This number is an offset into a string table.

Print the appropriate entry in the string table instead of the less
enlightening /4.

N.B.  yaml2obj already does the right thing, this test exercises both
sides of the (de-)serialization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219458 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-10 00:17:57 +00:00
Rui Ueyama
f02f03c21a Object: Add range iterators for COFF import/export table
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219383 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 02:16:38 +00:00
Rafael Espindola
8175be535a Remove bogus std::error_code returns form SectionRef.
There are two methods in SectionRef that can fail:

* getName: The index into the string table can be invalid.
* getContents: The section might point to invalid contents.

Every other method will always succeed and returning and std::error_code just
complicates the code. For example, a section can have an invalid alignment,
but if we are able to get to the section structure at all and create a
SectionRef, we will always be able to read that invalid alignment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219314 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-08 15:28:58 +00:00
Lang Hames
7106ab7ffd [Bugpoint] Close error log in ProcessFailure. Bugpoint had been failing to close
this, and in some circumstances (e.g. reducing particularly large test-cases)
this was causing bugpoint to be killed for hitting open file-handle limits.

No test case: I was only able to trigger this with test cases taking upwards of
10 mins to run.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219244 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-07 21:47:23 +00:00
Saleem Abdulrasool
db02fa5a11 llvm-readobj: add support to dump (COFF) directives
PE/COFF has a special section (.drectve) which can be used to pass options to
the linker (similar to LC_LINKER_OPTION).  Add support to llvm-readobj to print
the contents of the section for tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219228 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-07 19:37:52 +00:00
Rafael Espindola
61c4e41480 gold plugin: Handle gold selecting a linkonce GV when a weak is present.
The plugin API doesn't have the notion of linkonce, only weak. It is up to the
plugin to figure out if a symbol used only for the symbol table can be dropped.
In particular, it has to avoid dropping a linkonce_odr selected by gold if there
is also a weak_odr.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219188 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-07 04:06:13 +00:00
Rafael Espindola
4f17a54bfa gold plugin: create internal replacement with original linkage first.
The call to copyAttributesFrom will copy the visibility, which might assert
if it were to produce something invalid like "internal hidden". We avoid it
by first creating the replacement with the original linkage and then setting
it to internal affter the call to copyAttributesFrom.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219184 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-07 03:19:55 +00:00
Rafael Espindola
3ddd4fa0dd gold plugin: Remap function arguments when creating a replacement function.
When creating an internal function replacement for use in an alias we were
not remapping the argument uses in the instructions to point to the new
arguments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219177 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-07 00:47:38 +00:00
Timur Iskhodzhanov
3e3908e2c7 Fix dumping codeview line tables when there are multiple debug sections
Codeview line tables for functions in different sections refer to a common
STRING_TABLE_SUBSECTION for filenames.
This happens when building with -Gy or with inline functions with MSVC.

Original patch by Jeff Muizelaar!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219125 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-06 16:59:44 +00:00
Rui Ueyama
a6abd9e176 llvm-readobj: print out the fields of the COFF delay-import table
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218996 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-03 18:07:18 +00:00
Rui Ueyama
820664686a llvm-readobj: print COFF delay-load import table
This patch adds another iterator to access the delay-load import table
and use it from llvm-readobj.

http://reviews.llvm.org/D5594



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218933 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-03 00:41:58 +00:00
Rui Ueyama
7bd81ba05b Rename data -> Data
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218916 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-02 22:13:44 +00:00
Rui Ueyama
3d49ad0cbc llvm-readobj: print COFF imported symbols
This patch defines a new iterator for the imported symbols.
Make a change to COFFDumper to use that iterator to print
out imported symbols and its ordinals.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218915 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-02 22:05:29 +00:00
Rui Ueyama
f3cd10bdc3 This patch adds a new flag "-coff-imports" to llvm-readobj.
When the flag is given, the command prints out the COFF import table.

Currently only the import table directory will be printed.
I'm going to make another patch to print out the imported symbols.

The implementation of import directory entry iterator in
COFFObjectFile.cpp was buggy. This patch fixes that too.

http://reviews.llvm.org/D5569



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218891 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-02 17:02:18 +00:00
Duncan P. N. Exon Smith
04d2186546 LTO: Ignore disabled diagnostic remarks
r206400 and r209442 added remarks that are disabled by default.
However, if a diagnostic handler is registered, the remarks are sent
unfiltered to the handler.  This is the right behaviour for clang, since
it has its own filters.

However, the diagnostic handler exposed in the LTO API receives only the
severity and message.  It doesn't have the information to filter by pass
name.  For LTO, disabled remarks should be filtered by the producer.

I've changed `LLVMContext::setDiagnosticHandler()` to take a `bool`
argument indicating whether to respect the built-in filters.  This
defaults to `false`, so other consumers don't have a behaviour change,
but `LTOCodeGenerator::setDiagnosticHandler()` sets it to `true`.

To make this behaviour testable, I added a `-use-diagnostic-handler`
command-line option to `llvm-lto`.

This fixes PR21108.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218784 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-01 18:36:03 +00:00
NAKAMURA Takumi
a7ac986332 llvm-cov/CoverageReport.cpp: Quick fix for msvcrt, since width specifier "z" is unavailable.
Note, mingw uses its own printf instead of msvcrt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218723 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-01 00:29:26 +00:00
Hans Wennborg
ce102799a9 MSBuild integration: fix the loop in install.bat
It would previously not continue the platforms loop
unless it could find the latest toolset directory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218712 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-30 22:30:06 +00:00
Bradley Smith
95b3e168c5 Extend C disassembler API to allow specifying target features
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218682 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-30 16:31:40 +00:00
Alex Lorenz
38c59de6b1 llvm-cov: Use the number of executed functions for the function coverage metric.
This commit fixes llvm-cov's function coverage metric by using the number of executed functions instead of the number of fully covered functions.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218672 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-30 12:45:13 +00:00
Nick Kledzik
c27ddda8ce [llvm-objdump] switch some uses of format() to format_hex() and left_justify()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218649 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-30 00:19:58 +00:00
Hans Wennborg
4edcbaec90 WinCOFFObjectWriter: optimize the string table for common suffices
This is a follow-up from r207670 which did the same for ELF.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218636 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-29 22:43:20 +00:00
David Majnemer
98a2899235 llvm-vtabledump: Further simplification
Hoist out calls to getSection and getContents.  No functional change
intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218550 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-26 22:32:19 +00:00
David Majnemer
01ea611601 Object: BSS/virtual sections don't have contents
Users of getSectionContents shouldn't try to pass in BSS or virtual
sections.  In all instances, this is a bug in the code calling this
routine.

N.B. Some COFF implementations (like CL) will mark their BSS sections as
taking space on disk.  This would confuse COFFObjectFile into thinking
the section is larger than the file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218549 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-26 22:32:16 +00:00
Kevin Enderby
7118c73867 Update llvm-objdump’s Mach-O symbolizer code to print the name of symbol stubs.
So in fully linked images when a call is made through a stub it now gets a
comment like the following in the disassembly:

    callq	0x100000f6c             ## symbol stub for: _printf

indicating the call is to a symbol stub and which symbol it is for.  This is
done for branch reference types and seeing if the branch target is in a stub
section and if so using the indirect symbol table entry for that stub and
using that symbol table entries symbol name.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218546 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-26 22:20:44 +00:00
Richard Smith
aeb9ee0261 Remove definition of LLVM_VERSION_INFO; this macro is not used by any of the
files in this directory. If it should be defined anywhere, it should be defined
when building lib/LTO/LTOCodeGenerator.cpp, but we've not had it defined there
for quite some time, so that doesn't really seem to be very important. (It also
would slow down the modules build by creating extra module variants.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218544 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-26 21:53:12 +00:00
David Majnemer
537364502a llvm-vtabledump: Small cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218505 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-26 08:01:23 +00:00
David Majnemer
178cb752c7 llvm-vtabledump: strip trailing NUL bytes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218502 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-26 05:50:45 +00:00
David Majnemer
035e22bc06 llvm-vtabledump: Dump RTTI structures for the MS ABI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218498 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-26 04:21:51 +00:00
David Majnemer
5c1c055cb7 Object: Add range iterators for Archive children
No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218471 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-25 22:56:54 +00:00
Aaron Ballman
837a7c094b Since the DisasmMemoryObject only operates on const data, it now only accepts a const data pointer. This silences a -Wcast-qual warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218454 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-25 14:02:43 +00:00
Kevin Enderby
e793862979 Flush out enough of llvm-objdump’s SymbolizerSymbolLookUp() for Mach-O files to
get the literal string “Hello world” printed as a comment on the instruction
that loads the pointer to it. For now this is just for x86_64. So for object
files with relocation entries it produces things like:

	leaq	L_.str(%rip), %rax      ## literal pool for: "Hello world\n"

and similar for fully linked images like executables:

	leaq	0x4f(%rip), %rax        ## literal pool for: "Hello world\n"

Also to allow testing against darwin’s otool(1), I hooked up the existing 
-no-show-raw-insn option to the Mach-O parser code, added the new Mach-O
only -full-leading-addr option to match otool(1)'s printing of addresses and
also added the new -print-imm-hex option.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218423 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-24 23:08:22 +00:00
Lang Hames
e0c253f4e8 [MCJIT] Remove a few more references to JITMemoryManager that survived r218316.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218318 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-23 17:10:24 +00:00
Lang Hames
0717be951f [MCJIT] Delete the JTIMemoryManager and associated APIs.
This patch removes the old JIT memory manager (which does not provide any
useful functionality now that the old JIT is gone), and migrates the few
remaining clients over to SectionMemoryManager.

http://llvm.org/PR20848



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218316 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-23 16:56:02 +00:00
Justin Bogner
7df63b7d54 llvm-cov: Allow creating CoverageMappings from filenames
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218185 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-20 17:19:52 +00:00
Justin Bogner
9eb38163a5 llvm-cov: Disentangle the coverage data logic from the display (NFC)
This splits the logic for actually looking up coverage information
from the logic that displays it. These were tangled rather thoroughly
so this change is a bit large, but it mostly consists of moving things
around. The coverage lookup logic itself now lives in the library,
rather than being spread between the library and the tool.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218184 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-20 15:31:56 +00:00
Justin Bogner
73edcffc8f llvm-cov: Move some reader debug output out of the tool.
This debug output is really for testing CoverageMappingReader, not the
llvm-cov tool. Move it to where it can be more useful.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218183 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-20 15:31:51 +00:00
David Majnemer
c7210b3f0b llvm-readobj: pretty-print special COFF section names
Print IMAGE_SYM_DEBUG and the like instead of (-2).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218172 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-20 00:25:06 +00:00
Justin Bogner
297149bafc llvm-cov: Return unique_ptrs instead of filling objects (NFC)
Having create* functions return the object they create is more
readable than using an in-out parameter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218139 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-19 19:07:17 +00:00
Justin Bogner
42b96889d1 llvm-cov: Fix dropped lines when filters were applied
Uncovered lines in the middle of a covered region weren't being shown
when filtering to a particular function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218109 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-19 08:13:16 +00:00
Justin Bogner
ddbcfa0b2f llvm-cov: Generalize -filename-equivalence
The filename-equivalence flag allows you to show coverage when your
source files don't have the same full paths as those that generated
the data. This is mostly useful for writing tests in a cross-platform
way.

This wasn't triggering in cases where the filename was derived
directly from the coverage data, which meant certain types of test
case were impossible to write. This patch fixes that, and following
patches involve tests that need this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218108 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-19 08:13:12 +00:00
Peter Collingbourne
394be6c159 LTO: introduce object file-based on-disk module format.
This format is simply a regular object file with the bitcode stored in a
section named ".llvmbc", plus any number of other (non-allocated) sections.

One immediate use case for this is to accommodate compilation processes
which expect the object file to contain metadata in non-allocated sections,
such as the ".go_export" section used by some Go compilers [1], although I
imagine that in the future we could consider compiling parts of the module
(such as large non-inlinable functions) directly into the object file to
improve LTO efficiency.

[1] http://golang.org/doc/install/gccgo#Imports

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218078 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-18 21:28:49 +00:00
Justin Bogner
e3d674f88d llvm-cov: Simplify FunctionInstantiationSetCollector (NFC)
- Replace std::unordered_map with DenseMap
- Use std::pair instead of manually combining two unsigneds
- Assert if insert is called with invalid arguments
- Avoid an unnecessary copy of a std::vector

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218074 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-18 20:31:26 +00:00
Patrik Hagglund
6c0e053dc9 Alternative (to r216344) fix of gcc -Wpedantic.
As suggested by David Blaikie, this may be easier to read.

The original warning was:

../tools/llvm-cov/llvm-cov.cpp:53:49: error: ISO C++ forbids zero-size array 'argv' [-Werror=pedantic]
       std::string Invocation(std::string(argv[0]) + " " + argv[1]);

It seems to be the case that GCC's warning gets confused and thinks
'argv' is a declaration here. GCC bugzilla issue #61259.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218048 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-18 11:52:57 +00:00
Justin Bogner
5fbcc30184 llvm-cov: Push some more debug output into the View (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217984 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-17 21:48:52 +00:00
Rafael Espindola
2bfef929c0 Internalize common symbols when we can.
This fixes pr20974.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217981 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-17 20:41:13 +00:00
Justin Bogner
b3edb56485 llvm-cov: Rework the API for getting the coverage of a file (NFC)
This encapsulates how we handle the coverage regions of a file or
function. In the old model, the user had to deal with nested regions,
so they needed to maintain their own auxiliary data structures to get
any useful information out of this. The new API provides a sequence of
non-overlapping coverage segments, which makes it possible to render
coverage information in a single pass and avoids a fair amount of
extra work.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217975 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-17 18:23:47 +00:00
Justin Bogner
0a277ea23d LineIterator: Provide a variant that keeps blank lines
It isn't always useful to skip blank lines, as evidenced by the
somewhat awkward use of line_iterator in llvm-cov. This adds a knob to
control whether or not to skip blanks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217960 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-17 15:43:01 +00:00
Justin Bogner
217ab20074 llvm-cov: Fix a typo
It doesn't make sense for this default parameter to be false, since
false makes the function a no-op.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217945 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-17 08:12:12 +00:00
Justin Bogner
cc0c4e7cac Add move constructors/assignment to make MSVC happy after r217940
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217941 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-17 06:32:48 +00:00
Justin Bogner
d1b4e60339 llvm-cov: Distinguish expansion/instantiation from SourceCoverageView
SourceCoverageView currently has "Kind" and a list of child views, all
of which must have either an expansion or an instantiation Kind. In
addition to being an error-prone design, this makes it awkward to
differentiate between the two child types and adds a number of
optionally used members to the type.

Split the subview types into their own separate objects, and maintain
lists of each rather than one combined "Children" list.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217940 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-17 05:33:20 +00:00
Nick Kledzik
2b90611892 [llvm-objdump] properly use c_str() with format("%s"). Improve getLibraryShortNameByIndex() error handling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217930 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-17 00:25:22 +00:00
Nick Kledzik
ce90652489 [llvm-objdump] improve error reporting of bad mach-o ordinals
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217909 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-16 22:03:13 +00:00
Kevin Enderby
fdedee296f Hookup the MCSymbolizer to llvm-objdump’s disassembly for Mach-O files.
First step done in this commit is to get flush out enough of the
SymbolizerGetOpInfo() routine to symbolic an X86_64 hello world .o and
its loading of the literal string and call to printf.  Also the code to
symbolicate the X86_64_RELOC_SUBTRACTOR relocation and a test is also
added to show a slightly more complicated case.

Next will be to flush out enough of SymbolizerSymbolLookUp() to get the
literal string “Hello world” printed as a comment on the instruction that load
the pointer to it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217893 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-16 18:00:57 +00:00
Justin Bogner
d41bba158c llvm-cov: Rename a variable and clean up its usage
Offset is a terrible name for an indentation / nesting level, and it
confuses me every time I look at this code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217861 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-16 06:21:57 +00:00
David Majnemer
50c1eff629 yaml2obj: Support bigobj
Teach yaml2obj how to make a bigobj COFF file.  Like the rest of LLVM,
we automatically decide whether or not to use regular COFF or bigobj
COFF on the fly depending on how many sections the resulting object
would have.

This ends the task of adding bigobj support to LLVM.

N.B. This was tested by forcing yaml2obj to be used in bigobj mode
regardless of the number of sections.  While a dedicated test was
written, the smallest I could make it was 36 MB (!) of yaml and it still
took a significant amount of time to execute on a powerful machine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217858 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-16 03:52:46 +00:00
Nick Kledzik
367cf70f27 [llvm-objdump] for mach-o add -bind, -lazy-bind, and -weak-bind options
This finishes the ability of llvm-objdump to print out all information from
the LC_DYLD_INFO load command.

The -bind option prints out symbolic references that dyld must resolve 
immediately.

The -lazy-bind option prints out symbolc reference that are lazily resolved on 
first use.

The -weak-bind option prints out information about symbols which dyld must
try to coalesce across images.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217853 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-16 01:41:51 +00:00
Justin Bogner
16bd30fa48 llvm-cov: Make debug output more consistent
This changes the debug output of the llvm-cov tool to consistently
write to stderr, and moves the highlighting output closer to where
it's relevant.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217838 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-15 22:23:29 +00:00
Justin Bogner
47a75481e2 llvm-cov: Fix an issue with showing regions but not counts
In r217746, though it was supposed to be NFC, I broke llvm-cov's
handling of showing regions without showing counts. This should've
shown up in the existing tests, except they were checking debug output
that was displayed regardless of what was actually output. I've moved
the relevant debug output to a more appropriate place so that the
tests catch this kind of thing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217835 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-15 22:12:28 +00:00
David Majnemer
f1198da05c MC: Add support for BigObj
Teach WinCOFFObjectWriter how to write -mbig-obj style object files;
these object files allow for more sections inside an object file.

Our support for BigObj is notably different from binutils and cl: we
implicitly upgrade object files to BigObj instead of asking the user to
compile the same file *again* but with another flag.  This matches up
with how LLVM treats ELF variants.

This was tested by forcing LLVM to always emit BigObj files and running
the entire test suite.  A specific test has also been added.

I've lowered the maximum number of sections in a normal COFF file,
VS "14" CTP 3 supports no more than 65279 sections.  This is important
otherwise we might not switch to BigObj quickly enough, leaving us with
a COFF file that we couldn't link.

yaml2obj support is all that remains to implement.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217812 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-15 19:42:42 +00:00
Justin Bogner
b1287f54cf llvm-cov: Clean up some redundancy in the view API (NFC)
This removes the need to pass a starting and ending line when creating
a SourceCoverageView, since these are easy to determine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217746 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-15 03:41:04 +00:00
Justin Bogner
baca001683 llvm-cov: Simplify CounterMappingRegion, pushing logic to its user
A single function in SourceCoverageDataManager was the only user of
some of the comparisons in CounterMappingRegion, and at this point we
know that only one file is relevant. This lets us use slightly simpler
logic directly in the client.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217745 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-15 03:41:01 +00:00
Nick Kledzik
a77096bb53 [llvm-objdump] Use PRIX64 with format()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217724 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-13 00:18:40 +00:00
Nick Kledzik
a240fc5cb9 [llvm-objdump] support -rebase option for mach-o to dump rebasing info
Similar to my previous -exports-trie option, the -rebase option dumps info from
the LC_DYLD_INFO load command. The rebasing info is a list of the the locations
that dyld needs to adjust if a mach-o image is not loaded at its preferred 
address. Since ASLR is now the default, images almost never load at their
preferred address, and thus need to be rebased by dyld.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217709 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-12 21:34:15 +00:00
Justin Bogner
8f3096162c llvm-cov: Move FunctionCoverageMapping into CoverageMapping.h (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217657 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-12 06:52:44 +00:00
Justin Bogner
a476ce78a0 Revert "llvm-cov: Remove an overly system specific test"
This fixes a call to sys::fs::equivalent that should've been to
CodeCoverageTool::equivalentFiles, which lets us restore the test of
r217476 that was removed in r217478.

This reverts r217478, but the test works this time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217646 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-11 23:20:48 +00:00
Rui Ueyama
f70f3d4708 Support: Delete {aligned_,}{u,}{little,big}8_t
The byte has no endianness, so these types don't make sense.
uint8_t should be used instead.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217631 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-11 21:46:33 +00:00
Rafael Espindola
e257ec6e5e Use the simpler sys::fs:;exists. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217617 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-11 18:44:26 +00:00
Ismail Pazarbasi
9869724b73 Added missing LLVM_NOEXCEPT to the definition of _obj2yaml_error_category::name
LLVM_NOEXCEPT was added in r210591.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217603 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-11 17:19:54 +00:00
Rafael Espindola
3b670550ad Add doInitialization/doFinalization to DataLayoutPass.
With this a DataLayoutPass can be reused for multiple modules.

Once we have doInitialization/doFinalization, it doesn't seem necessary to pass
a Module to the constructor.

Overall this change seems in line with the idea of making DataLayout a required
part of Module. With it the only way of having a DataLayout used is to add it
to the Module.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217548 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-10 21:27:43 +00:00
Rafael Espindola
3c278b1c12 Remember to eraseFromParent after replaceAllUsesWith.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217536 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-10 19:39:41 +00:00
David Majnemer
b3a86a097b Object: Add support for bigobj
This adds support for reading the "bigobj" variant of COFF produced by
cl's /bigobj and mingw's -mbig-obj.

The most significant difference that bigobj brings is more than 2**16
sections to COFF.

bigobj brings a few interesting differences with it:
- It doesn't have a Characteristics field in the file header.
- It doesn't have a SizeOfOptionalHeader field in the file header (it's
  only used in executable files).
- Auxiliary symbol records have the same width as a symbol table entry.
  Since symbol table entries are bigger, so are auxiliary symbol
  records.

Write support will come soon.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217496 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-10 12:51:52 +00:00
Justin Bogner
26f301f84b llvm-cov: Fix a misuse of ArrayRef::slice I introduced in r217430
It appears this code was completely untested, so using ArrayRef wrong
didn't break anything obvious.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217476 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-10 06:06:07 +00:00
Rafael Espindola
19f3868e91 Handle common linkage correctly in the gold plugin.
This is the plugin version of pr20882.

This handles the case of every common symbol being in the IR. We will need some
support from gold to handle the case where some symbols are in ELF and some in
the IR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217458 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-09 20:08:22 +00:00
Tim Northover
4faf24b6b7 llvm-objdump: don't crash when __compact_unwind has no relocs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217433 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-09 10:45:06 +00:00
Justin Bogner
ff6eb4fec5 llvm-cov: Use ArrayRef::slice (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217430 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-09 09:15:52 +00:00
Justin Bogner
39d5e80b44 llvm-cov: Combine two types that were nearly identical (NFC)
llvm-cov had a SourceRange type that was nearly identical to a
CountedRegion except that it shaved off a couple of fields. There
aren't likely to be enough of these for the minor memory savings to be
worth the extra complexity here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217417 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-09 05:32:18 +00:00
Justin Bogner
74a60259a5 llvm-cov: Rename MappingRegion to coverage::CountedRegion (NFC)
This name was too similar to CoverageMappingRegion, and the type
really belongs in the coverage library anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217416 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-09 05:32:14 +00:00
Justin Bogner
78834e522f llvm-cov: Use ErrorOr rather than an error_code* (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217404 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-08 21:04:00 +00:00
Justin Bogner
69062a3c65 llvm-cov: Remove dead code
FunctionCoverageMapping::PrettyName was from a version of the tool
during review, and isn't actually used currently.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217398 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-08 19:51:21 +00:00
Kevin Enderby
37598b62a7 Adds the next bit of support for llvm-objdump’s -private-headers for executable Mach-O files.
This adds the printing of more load commands, so that the normal load commands
in a typical X86 Mach-O executable can all be printed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217172 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-04 16:54:47 +00:00
Lang Hames
5ade584a96 [MCJIT] Add command-line argument to llvm-rtdyld to specify target addresses for
sections.

This allows fine-grained control of the memory layout of hypothetical target
processes for testing purposes.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217122 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-04 04:19:54 +00:00
Justin Bogner
b79ed97962 llvm-cov: Don't pointlessly create a unique_ptr (NFC)
There's no ownership going on here, and no reason to heap allocate
this object.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217113 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-04 00:04:54 +00:00
Chris Bieneman
901166c939 Enabling LLVM & Clang to be cross-compiled using CMake from a single configuration command line
The basic idea is similar to the existing cross compilation support. A directory must be configured to build host versions of tablegen tools and llvm-config. This directory can be user provided (and configured), or it can be created during the build. During a build the native build directory will be configured and built to supply the tablegen tools used during the build. A user could also explicitly provide the tablegen executables to run on the CMake command line.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217105 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-03 23:21:18 +00:00
David Blaikie
96a8ccfab7 unique_ptrify a bunch of stuff through RuntimeDyld::loadObject
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217065 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-03 19:48:09 +00:00
David Blaikie
faa7461fc3 unique_ptrify IRObjectFile::createIRObjectFile
I took a guess at the changes to the gold plugin, because that doesn't
seem to build by default for me. Not sure what dependencies I might be
missing for that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217056 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-03 17:59:23 +00:00
Rafael Espindola
6d66a1cd2f Pass a && to getLazyBitcodeModule.
This forces callers to use std::move when calling it. It is somewhat odd to have
code with std::move that doesn't always move, but it is also odd to have code
without std::move that sometimes moves.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217049 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-03 17:31:46 +00:00
Alexander Potapenko
42ebff8c99 Follow-up for r217020: actually commit the fix for PR20800,
revert the accidentally committed changes to LLVMSymbolize.cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217021 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-03 07:37:20 +00:00
Alexander Potapenko
fac68d2d70 Fix PR20800: correctly calculate the offset of the subq instruction when generating compact unwind info.
This CL replaces the constant DarwinX86AsmBackend.PushInstrSize with a method
that lets the backend account for different sizes of "push %reg" instruction
sizes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217020 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-03 07:11:34 +00:00
Lang Hames
ef279f96e5 [MCJIT] Make llvm-rtdyld process eh_frame sections in -verify mode (accidentally
left out of r217010).

Also remove a crufty debugging output statement that was accidentally left in.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217011 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-03 05:42:52 +00:00
Nick Kledzik
3ab3a82f72 Replace printf with outs() <<
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217005 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-03 01:12:52 +00:00
Sean Silva
73d86aa56a Nuke MCAnalysis.
The code is buggy and barely tested. It is also mostly boilerplate.
(This includes MCObjectDisassembler, which is the interface to that
functionality)

Following an IRC discussion with Jim Grosbach, it seems sensible to just
nuke the whole lot of functionality, and dig it up from VCS if
necessary (I hope not!).

All of this stuff appears to have been added in a huge patch dump (look
at the timeframe surrounding e.g. r182628) where almost every patch
seemed to be untested and not reviewed before being committed.
Post-review responses to the patches were never addressed. I don't think
any of it would have passed pre-commit review.

I doubt anyone is depending on this, since this code appears to be
extremely buggy. In limited testing that Michael Spencer and I did, we
couldn't find a single real-world object file that wouldn't crash the
CFG reconstruction stuff. The symbolizer stuff has O(n^2) behavior and
so is not much use to anyone anyway. It seemed simpler to remove them as
a whole. Most of this code is boilerplate, which is the only way it was
able to scrape by 60% coverage.

HEADSUP: Modules folks, some files I nuked were referenced from
include/llvm/module.modulemap; I just deleted the references. Hopefully
that is the right fix (one was a FIXME though!).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216983 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-02 22:32:20 +00:00
Eric Christopher
d5dd8ce2a5 Reinstate "Nuke the old JIT."
Approved by Jim Grosbach, Lang Hames, Rafael Espindola.

This reinstates commits r215111, 215115, 215116, 215117, 215136.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216982 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-02 22:28:02 +00:00
Nick Kledzik
9bf0327ea7 Code review tweaks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216931 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-02 18:50:24 +00:00
Jordan Rose
d421075d0c Teach llvm-bcanalyzer to use one stream's BLOCKINFO to read another stream.
This allows streams that only use BLOCKINFO for debugging purposes to omit
the block entirely. As long as another stream is available with the correct
BLOCKINFO, the first stream can still be analyzed and dumped.

As part of this commit, BitstreamReader gets a move constructor and move
assignment operator, as well as a takeBlockInfo method.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216826 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-30 17:07:55 +00:00
Craig Topper
3af13568fb Remove 'virtual' keyword from methods markedwith 'override' keyword.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216823 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-30 16:48:34 +00:00
Craig Topper
847998f0dd Use StringRef to avoid copies and simplify code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216822 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-30 16:48:22 +00:00
Craig Topper
24ae56d4c9 Fix some cases where StringRef was being passed by const reference. Remove const from some other StringRefs since its implicitly const already.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216820 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-30 16:48:02 +00:00
Nick Kledzik
aa4d2acf37 Object/llvm-objdump: allow dumping of mach-o exports trie
MachOObjectFile in lib/Object currently has no support for parsing the rebase, 
binding, and export information from the LC_DYLD_INFO load command in final 
linked mach-o images. This patch adds support for parsing the exports trie data
structure. It also adds an option to llvm-objdump to dump that export info.

I did the exports parsing first because it is the hardest. The information is 
encoded in a trie structure, but the standard ObjectFile way to inspect content 
is through iterators. So I needed to make an iterator that would do a 
non-recursive walk through the trie and maintain the concatenation of edges 
needed for the current string prefix.

I plan to add similar support in MachOObjectFile and llvm-objdump to 
parse/display the rebasing and binding info too.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216808 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-30 00:20:14 +00:00
Kevin Enderby
e306159429 Next bit of support for llvm-objdump’s -private-headers for Mach-O files.
This adds the printing of the LC_SEGMENT load command and sections,
LC_SYMTAB and LC_DYSYMTAB load commands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216795 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-29 22:30:52 +00:00
Rafael Espindola
b5e9bf06ad Don't create a MemoryBuffer just to get the MemoryBufferRef. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216608 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-27 20:25:55 +00:00
David Blaikie
819242a446 Convert a few more cases of direct intialization of unique_ptrs from MemoryBuffer::getMemBuffer to move initialization now that it returns by unique_ptr instead of raw pointer.
Cleanup/improvements following r216583.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216605 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-27 20:14:18 +00:00
Rafael Espindola
1a7f705fba Return a std::unique_ptr when creating a new MemoryBuffer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216583 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-27 20:03:13 +00:00
Craig Topper
3512034554 Simplify creation of a bunch of ArrayRefs by using None, makeArrayRef or just letting them be implicitly created.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216525 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-27 05:25:25 +00:00
Rafael Espindola
fb1af0a48a Pass a std::unique_ptr<MemoryBuffer>& to getLazyBitcodeModule.
By taking a reference we can do the ownership transfer in one place instead of
expecting every caller to do it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216492 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26 22:00:09 +00:00
Rafael Espindola
2292996e1a Pass a MemoryBufferRef when we can avoid taking ownership.
The attached patch simplifies a few interfaces that don't need to take
ownership of a buffer.

For example, both parseAssembly and parseBitcodeFile will parse the
entire buffer before returning. There is no need to take ownership.

Using a MemoryBufferRef makes it obvious in the type signature that
there is no ownership transfer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216488 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26 21:49:01 +00:00
Rafael Espindola
af07403c3e Give ExecutionEngine of top level buffers.
Long term the idea if for the engine to not own the buffers, but for now
this is consistent with the rest of the API.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216484 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26 21:04:04 +00:00
Rafael Espindola
de2d08ea17 Invert the condition to have a single return.
Thanks to David Blaikie for the suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216468 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26 18:03:35 +00:00
Rafael Espindola
81e49922a8 Return a std::unique_ptr from the IRReader.h functions. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216466 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26 17:29:46 +00:00
Rafael Espindola
1bfd87a150 Return a std::unique_ptr from parseInputFile and propagate. NFC.
The memory management in BugPoint is fairly convoluted, so this just unwraps
one layer by changing the return type of functions that always return
owned Modules.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216464 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26 17:19:03 +00:00
Rafael Espindola
8c96862847 Modernize raw_fd_ostream's constructor a bit.
Take a StringRef instead of a "const char *".
Take a "std::error_code &" instead of a "std::string &" for error.

A create static method would be even better, but this patch is already a bit too
big.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216393 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-25 18:16:47 +00:00
Craig Topper
273fd11da9 Use range based for loops to avoid needing to re-mention SmallPtrSet size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216351 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-24 23:23:06 +00:00
Aaron Ballman
5cb5e7e323 This code is from r216285, which did not go out to the mailing list for some reason.
The switch statement would never fire due to the preceding break statement. Also, the switch statement has a default label with no case labels. Simplified the code, and allow it to execute.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216346 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-24 13:25:16 +00:00
Patrik Hagglund
401ca95387 Silence gcc -Wpedantic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216344 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-24 09:12:33 +00:00
Rafael Espindola
03d2823e02 Add support for comdats to the gold plugin.
There are two parts to this. First, the plugin needs to tell gold the comdat by
setting comdat_key.

What gets things a bit more complicated is that gold only seems
symbols. In particular, if A is an alias to B, it only sees the symbols
A and B. It can then ask us to keep symbol A but drop symbol B. What
we have to do instead is to create an internal version of B and make A
an alias to that.

At some point some of this logic should be moved to lib/Linker so that
we don't map a Constant to an internal version just to have lib/Linker
map that again to the destination module.

The reason for implementing this in tools/gold for now is simplicity.
With it in place it should be possible to update clang to use comdats
for constructors and destructors on ELF without breaking the LTO
bootstrap. Once that is done I intend to come back and improve the
interface lib/Linker exposes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216302 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-22 23:26:10 +00:00
Alex Lorenz
6c7a6a1ba2 llvm-cov: add code coverage tool that's based on coverage mapping format and clang's pgo.
This commit expands llvm-cov's functionality by adding support for a new code coverage
tool that uses LLVM's coverage mapping format and clang's instrumentation based profiling.
The gcov compatible tool can be invoked by supplying the 'gcov' command as the first argument,
or by modifying the tool's name to end with 'gcov'.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216300 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-22 22:56:03 +00:00
Kevin Enderby
d9757b42ad Add the start of the support for llvm-objdump’s -private-headers for Mach-O files.
This adds the printing of the mach header. Load command printing will be next.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216285 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-22 20:35:18 +00:00
Robin Morisset
cf165c36ee Rename AtomicExpandLoadLinked into AtomicExpand
AtomicExpandLoadLinked is currently rather ARM-specific. This patch is the first of
a group that aim at making it more target-independent. See
http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-August/075873.html
for details

The command line option is "atomic-expand"

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216231 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-21 21:50:01 +00:00
David Blaikie
95ca0fb247 Explicitly pass ownership of the MemoryBuffer to AddNewSourceBuffer using std::unique_ptr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216223 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-21 20:44:56 +00:00
Rafael Espindola
3fd7e37b34 Rewrite the gold plugin to fix pr19901.
There is a fundamental difference between how the gold API and lib/LTO view
the LTO process.

The gold API talks about a particular symbol in a particular file. The lib/LTO
API talks about a symbol in the merged module.

The merged module is then defined in terms of the IR semantics. In particular,
a linkonce_odr GV is only copied if it is used, since it is valid to drop
unused linkonce_odr GVs.

In the testcase in pr19901 both properties collide. What happens is that gold
asks us to keep a particular linkonce_odr symbol, but the IR linker doesn't
copy it to the merged module and we never have a chance to ask lib/LTO to keep
it.

This patch fixes it by having a more direct implementation of the gold API. If
it asks us to keep a symbol, we change the linkage so it is not linkonce. If it
says we can drop a symbol, we do so. All of this before we even send the module
to lib/Linker.

Since now we don't have to produce LTO_SYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDEN,
during symbol resolution we can use a temporary LLVMContext and do lazy
module loading. This allows us to keep the minimum possible amount of
allocated memory around. This should also allow as much parallelism as
we want, since there is no shared context.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216215 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-21 20:28:55 +00:00
Rafael Espindola
7b4eb02b6d Move some logic to populateLTOPassManager.
This will avoid code duplication in the next commit which calls it directly
from the gold plugin.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216211 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-21 20:03:44 +00:00
Rafael Espindola
9ca2a9ae4e llvm-gcc is dead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216206 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-21 19:22:24 +00:00
Rafael Espindola
0b994a70b0 Handle inlining in populateLTOPassManager like in populateModulePassManager.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216178 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-21 13:35:30 +00:00
Rafael Espindola
47199c3d0c Move DisableGVNLoadPRE from populateLTOPassManager to PassManagerBuilder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216174 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-21 13:13:17 +00:00
Elena Demikhovsky
6623af7892 IntelJITEventListener updates to fix breaks by recent changes to EngineBuilder and DIContext.
By Arch Robison.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216159 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-21 07:01:55 +00:00
Rafael Espindola
4b67b5a958 Quick fix for an use after free.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216071 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-20 15:19:37 +00:00
Duncan P. N. Exon Smith
7838818ad7 IR: Implement uselistorder assembly directives
Implement `uselistorder` and `uselistorder_bb` assembly directives,
which allow the use-list order to be recovered when round-tripping to
assembly.

This is the bulk of PR20515.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216025 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-19 21:30:15 +00:00
Duncan P. N. Exon Smith
13f5c5896d verify-uselistorder: Force -preserve-bc-use-list-order
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216022 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-19 21:08:27 +00:00
Rafael Espindola
548f2b6e8f Don't own the buffer in object::Binary.
Owning the buffer is somewhat inflexible. Some Binaries have sub Binaries
(like Archive) and we had to create dummy buffers just to handle that. It is
also a bad fit for IRObjectFile where the Module wants to own the buffer too.

Keeping this ownership would make supporting IR inside native objects
particularly painful.

This patch focuses in lib/Object. If something elsewhere used to own an Binary,
now it also owns a MemoryBuffer.

This patch introduces a few new types.

* MemoryBufferRef. This is just a pair of StringRefs for the data and name.
  This is to MemoryBuffer as StringRef is to std::string.
* OwningBinary. A combination of Binary and a MemoryBuffer. This is needed
  for convenience functions that take a filename and return both the
  buffer and the Binary using that buffer.

The C api now uses OwningBinary to avoid any change in semantics. I will start
a new thread to see if we want to change it and how.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216002 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-19 18:44:46 +00:00
Rafael Espindola
9b29ff99c0 Modernize the .ll parsing interface.
* Use StringRef instead of std::string&
* Return a std::unique_ptr<Module> instead of taking an optional module to write
  to (was not really used).
* Use current comment style.
* Use current naming convention.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215989 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-19 16:58:54 +00:00
Rafael Espindola
3f4ed32b43 Make it explicit that ExecutionEngine takes ownership of the modules.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215967 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-19 04:04:25 +00:00
Duncan P. N. Exon Smith
36c150801a verify-uselistorder: Call verifyModule() and improve output
Call `verifyModule()` after parsing and after every transformation.
Also convert some `DEBUG(dbgs())` to `errs()` to increase visibility
into what's going on.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215951 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-18 23:44:14 +00:00
Kevin Enderby
f759032ccd Make llvm-objdump handle both arm and thumb disassembly from the same Mach-O
file with -macho, the Mach-O specific object file parser option.

After some discussion I chose to do this implementation contained in the logic
of llvm-objdump’s MachODump.cpp using a second disassembler for thumb when
needed and with updates mostly contained in the MachOObjectFile class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215931 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-18 20:21:02 +00:00
Rafael Espindola
78e8d52a58 llvm-objdump: don't print relocations in non-relocatable files.
This matches the behavior of GNU objdump.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215844 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-17 19:09:37 +00:00
Rafael Espindola
4c511cd88f Fix an off-by-one bug in the target independent llvm-objdump.
It would prevent the display of a single byte instruction before a label.

Patch by Steve King!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215837 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-17 16:31:39 +00:00
Aaron Ballman
1ab70ef650 Silencing some -Wcast-qual warnings and removing some C-style casts at the same time. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215643 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-14 13:53:19 +00:00
Rafael Espindola
d6448b21bf Simplify ownership with std::unique_ptr. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215566 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-13 18:49:01 +00:00
Benjamin Kramer
00e08fcaa0 Canonicalize header guards into a common format.
Add header guards to files that were missing guards. Remove #endif comments
as they don't seem common in LLVM (we can easily add them back if we decide
they're useful)

Changes made by clang-tidy with minor tweaks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215558 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-13 16:26:38 +00:00
Tim Northover
48bfab80aa llvm-objdump: print contents of MachO __unwind_info sections
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215437 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-12 11:52:59 +00:00
Rafael Espindola
b2d2f28351 Fix using -plugin-opt=apiflie when also using -plugin-opt=emit-llvm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215378 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-11 19:06:54 +00:00
Tim Northover
835cfaa11b llvm-objdump: fix remaining use of %x format specifier for 64-bit values
Third time lucky. This should finally fix the ARM (& MIPS, I think) bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215349 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-11 09:14:06 +00:00
Rafael Espindola
0bd9423c27 getLoadName is only implemented for ELF, make it ELF only.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215219 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-08 16:39:22 +00:00
Rafael Espindola
015f57679d Use a simpler predicate. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215218 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-08 16:30:17 +00:00
Tim Northover
b56b256896 llvm-objdump: add missing % in format specifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215198 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-08 12:08:51 +00:00
Tim Northover
5ccbb28fc9 llvm-objdump: use portable format specifiers for info.
ARM bots (& others, I think, now that I look) were failing because we
were using incorrect printf-style format specifiers. They were wrong
on almost any platform, actually, just mostly harmlessly so.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215196 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-08 12:00:09 +00:00
Eric Christopher
aa5b9c0f6f Temporarily Revert "Nuke the old JIT." as it's not quite ready to
be deleted. This will be reapplied as soon as possible and before
the 3.6 branch date at any rate.

Approved by Jim Grosbach, Lang Hames, Rafael Espindola.

This reverts commits r215111, 215115, 215116, 215117, 215136.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215154 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-07 22:02:54 +00:00
Rafael Espindola
7b232e2bb6 fix configure+make build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215116 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-07 14:38:49 +00:00
Rafael Espindola
875710a2fd Nuke the old JIT.
I am sure we will be finding bits and pieces of dead code for years to
come, but this is a good start.

Thanks to Lang Hames for making MCJIT a good replacement!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215111 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-07 14:21:18 +00:00
Kevin Enderby
75d423feed Add the -mcpu= option to llvm-objdump for use with the disassemblers.
Also make the disassembler created with the Mach-O parser (the -m option)
pick up the Target specific attributes specified with -mattr option.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215032 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-06 23:24:41 +00:00
Lang Hames
416ea4bfa7 [MCJIT] Make llvm-rtdyld check RuntimeDyld's error state when running in -verify
mode.

This will cause -verify mode to report failure when RuntimeDyld encounters an
internal error (e.g. overflows in relocation computations). Previously we had
let these errors slip past unreported.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214925 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-05 20:51:46 +00:00
Rafael Espindola
0ca286752e Don't internalize all but main by default.
This is mostly a cleanup, but it changes a fairly old behavior.

Every "real" LTO user was already disabling the silly internalize pass
and creating the internalize pass itself. The difference with this
patch is for "opt -std-link-opts" and the C api.

Now to get a usable behavior out of opt one doesn't need the funny
looking command line:

opt -internalize -disable-internalize -internalize-public-api-list=foo,bar -std-link-opts

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214919 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-05 20:10:38 +00:00
Eric Christopher
9f85dccfc6 Remove the TargetMachine forwards for TargetSubtargetInfo based
information and update all callers. No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214781 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-04 21:25:23 +00:00
Duncan P. N. Exon Smith
1d3169155b verify-uselistorder: Reverse use-lists at every verification
Updated `verify-uselistorder` to more than double the number of use-list
orders it checks.

  - Every time it verifies an order, it then reverses the order and
    verifies again.

  - It now verifies the initial order, before running any shuffles.

Changed the default to `-num-shuffles=1`, since this is already four
checks, and after r214584 shuffling is guaranteed to make a new order.

This is part of PR5680.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214596 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-01 23:49:41 +00:00
Duncan P. N. Exon Smith
4277019a75 verify-uselistorder: Add missing static
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214595 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-01 23:31:13 +00:00
Duncan P. N. Exon Smith
b2b0ad4c75 verify-uselistorder: Move shuffleUseLists() out of lib/IR
`shuffleUseLists()` is only used in `verify-uselistorder`, so move it
there to avoid bloating other executables.  As a drive-by, update some
of the header docs.

This is part of PR5680.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214592 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-01 23:03:36 +00:00
Duncan P. N. Exon Smith
236c1ac873 verify-uselistorder: Make the verification logic easier to reuse
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214587 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-01 22:52:06 +00:00
Rafael Espindola
fff7ba35a3 Use object::Archive::create instead of new object::Archive.
Also fix the error handling. No testcaes, issue found by inspection.

Thanks to David Blaikie for the suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214535 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-01 18:31:17 +00:00
Rafael Espindola
6312816b42 Replace comment about ownership with std::unique_ptr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214533 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-01 18:09:32 +00:00
Rafael Espindola
09237b8968 Remove lto_codegen_set_attr.
It was never exported, so no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214519 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-01 14:57:05 +00:00
Rafael Espindola
9aa0b5e11e Remove some calls to std::move.
Instead of moving out the data in a ErrorOr<std::unique_ptr<Foo>>, get
a reference to it.

Thanks to David Blaikie for the suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214516 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-01 14:31:55 +00:00
Tim Northover
f28a36e527 llvm-objdump: implement printing for MachO __compact_unwind info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214509 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-01 13:07:19 +00:00
Sylvestre Ledru
2fd13bbae0 Revert of 214418:
"Create a default symver on Linux like ELF OSes."

Fails the build under Debian with ld.gold:
/usr/bin/ld.gold: --default-symver: unknown option




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214482 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-01 06:16:03 +00:00
Rafael Espindola
03c8d18ced Replaces a few pointers with references in llvm-nm.cpp.
This opens the way for a few std::uinque_ptr cleanups.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214439 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-31 21:00:10 +00:00
Hans Wennborg
36daac3759 msbuild integration: remove duplicated lines and BOM from 2014 integration (PR20341)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214435 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-31 20:33:22 +00:00
Rafael Espindola
81becb73ab Use a reference instead of a pointer.
This makes using a std::unique_ptr in the caller more convenient.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214433 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-31 20:19:36 +00:00
Rafael Espindola
72c5355bbe Remove unused argument.
Thanks to Justin Bogner for noticing it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214426 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-31 19:32:04 +00:00
Rafael Espindola
1023307a7d Move MCObjectSymbolizer.h to MC/MCAnalysis.
The cpp file is already in lib/MC/MCAnalysis.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214424 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-31 19:29:23 +00:00
Duncan P. N. Exon Smith
94f7c7aeaa verify-uselistorder: Change the default -num-shuffles=5
Change the default for `-num-shuffles` to 5 and better document the
algorithm in the header docs of `verify-uselistorder`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214419 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-31 18:46:24 +00:00
Eric Christopher
26d83150b4 Create a default symver on Linux like ELF OSes.
Patch by Adam Jackson.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214418 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-31 18:43:43 +00:00
Rafael Espindola
79002da926 Use std::unique_ptr to make the ownership explicit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214377 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-31 03:12:45 +00:00
Duncan P. N. Exon Smith
89c4197256 Rename llvm-uselistorder => verify-uselistorder
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214318 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-30 17:11:27 +00:00
Duncan P. N. Exon Smith
4a9efdaf9f llvm-uselistorder: Improve the tool description
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214317 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-30 16:59:19 +00:00
Duncan P. N. Exon Smith
e188fa672b llvm-uselistorder: Fix memory leak from r214125
Turns out `parseBitcodeFile()` does *not* take ownership of the buffer.
This was already clear in the header docs, but I obviously didn't read
them (having noticed that it gets stored in a `unique_ptr<>`).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214313 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-30 16:50:22 +00:00
Lang Hames
e1681c941e [MCJIT] Actually remap sections based llvm-rtdyld options added in r214255.
This line was accidentally left out of that patch.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214282 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-30 03:12:41 +00:00