Commit Graph

7763 Commits

Author SHA1 Message Date
Adrian McCarthy
11e1d83ce5 NFC: Rename (PDB) RawSession to NativeSession
This eliminates one overload on the term Raw.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293104 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-25 22:38:55 +00:00
Kevin Enderby
0702b34637 Add a warning when the llvm-nm -print-size flag is used on a Mach-O file as
Mach-O files don’t have size information about the symbols in the object file
format unlike ELF.

Also add the part of the fix to llvm-nm that was missed with r290001 so
-arch armv7m works.

rdar://25681018


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293099 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-25 21:33:38 +00:00
Zachary Turner
a74ee64df5 [pdb] Correctly parse the hash adjusters table from TPI stream.
This is not a list of pairs, it is a hash table data structure. We now
correctly parse this out and dump it from llvm-pdbdump.

We still need to understand the conditions that lead to a type
getting an entry in the hash adjuster table.  That will be done
in a followup investigation / patch.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293090 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-25 21:17:40 +00:00
Konstantin Zhuravlyov
eb91947709 [AMDGPU] Bump up n_type for metadata v2
Differential Revision: https://reviews.llvm.org/D29115


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293083 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-25 20:47:17 +00:00
Dean Michael Berris
420c0701f8 Implemented color coding and Vertex labels in XRay Graph
Summary:
A patch to enable the llvm-xray graph subcommand to color edges and
vertices based on statistics and to annotate vertices with statistics.

Depends on D27243

Reviewers: dblaikie, dberris

Reviewed By: dberris

Subscribers: mgorny, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293031 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-25 07:14:43 +00:00
Peter Collingbourne
6e6c6de33b gold-plugin: Add the file path to the file open error diagnostic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293013 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-25 03:35:28 +00:00
Kevin Enderby
af0e1c5e93 Add support for the x86_thread_state32_t and
in llvm-objdump for Mach-O files add the printing of the
x86_thread_state32_t in the same format as
otool-classic(1) on darwin.

To do this the 32-bit x86 general tread state
needed to be defined in include/llvm/Support/MachO.h .

rdar://30110111


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292829 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 21:13:29 +00:00
Steven Wu
6d5a027d71 Add LC_BUILD_VERSION load command
Summary:
Add a new load command LC_BUILD_VERSION. It is a generic version of
LC_*_VERSION_MIN load_command used on Apple platforms. Instead of having
a seperate load command for each platform, LC_BUILD_VERSION is recording
platform info as an enum. It also records SDK version, min_os, and tools
that used to build the binary.

rdar://problem/29781291

Reviewers: enderby

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292824 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 20:07:55 +00:00
Saleem Abdulrasool
4133d85d33 llvm-cxxfilt: support -_
Add the `--strip-underscore` option to llvm-cxxfilt to strip the leading
underscore.  This is useful for when dealing with targets which add a
leading underscore.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292759 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-22 17:41:10 +00:00
Saleem Abdulrasool
4c5684d092 llvm-strings: remove default for -Wcovered-switch-default
Fix the -Werror build by removing the unnecessary default case in the
covered switch.  NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292708 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-21 02:52:29 +00:00
Saleem Abdulrasool
6d72920b21 llvm-strings: add support for -t
Allow printing the file content offset via the `-t` or `--radix` option.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292707 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-21 02:36:28 +00:00
Saleem Abdulrasool
5e8f18007b llvm-cxxfilt: support the -s option
This is a stub implementation of the `-s` or `--format` option that
allows the user to specify the demangling style.  Since we only support
the Itanium (GNU) style demangling, auto is synonymous with `gnu`.
Simply swallow the option to permit some level of commandline
compatibility.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292706 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-21 02:36:26 +00:00
Zachary Turner
9c1e7a6062 [pdb] Write the Named Stream mapping to Yaml and binary.
Differential Revision: https://reviews.llvm.org/D28919

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292665 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-20 22:42:09 +00:00
Zachary Turner
b7d2cf75d1 [pdb] Merge NamedStreamMapBuilder and NamedStreamMap.
While the builder pattern has proven useful for certain other
larger types, in this case it was hampering the ability to use
the data structure, as for runtime access we need a map that
we can efficiently read from and write to.  So the two are merged
into a single data structure that can efficiently be read to,
written from, deserialized from bytes, and serialized to bytes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292664 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-20 22:41:40 +00:00
Saleem Abdulrasool
81f64e2be0 llvm-cxxfilt: add missing includes from previous change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292580 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-20 05:33:22 +00:00
Saleem Abdulrasool
08015a574d llvm-cxxfilt: fix program description
Fix a silly copy-paste error in the tool description.  Take the
opportunity to add crash stack printing which will hopefully never be
needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292579 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-20 05:27:09 +00:00
Saleem Abdulrasool
81cf2fa17a llvm-cxxfilt: support -t to demangle types
By default c++filt demangles functions, though you can optionally pass
`-t` to have it decode types as well, behaving nearly identical to
`__cxa_demangle`.  Add support for this mode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292576 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-20 04:25:26 +00:00
Kevin Enderby
045015ed1f Add support for the new LC_NOTE load command.
It describes a region of arbitrary data included in a Mach-O file.
Its initial use is to record extra data in MH_CORE files.

rdar://30001545
rdar://30001731


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292500 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-19 17:36:31 +00:00
Mike Aizatsky
e7be0ad634 [sancov] applying blacklist to covered points too
Differential Revision: https://reviews.llvm.org/D28872

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292468 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-19 03:49:18 +00:00
Saleem Abdulrasool
08b49042cb llvm-cxxfilt: filter out invalid manglings
c++filt does not attempt to demangle symbols which do not match its
expected format.  This means that the symbol must start with _Z or ___Z
(block invocation function extension).  Any other symbols are returned
as is.  Note that this is different from the behaviour of __cxa_demangle
which will demangle fragments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292467 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-19 02:58:46 +00:00
Sam Parker
aa96763063 [ARM] Create objdump subtarget from build attrs
Enable an ELFObjectFile to read the its arm build attributes to
produce a target triple with a specific ARM architecture.
llvm-objdump now uses this functionality to automatically produce
a more accurate target.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292366 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-18 13:52:12 +00:00
Pavel Labath
c52f4a4684 Remove pid_t usage from llvm-xray
This type is not available on windows.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292206 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 09:39:31 +00:00
Matt Arsenault
8b76c990ba llc: Update link components
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292198 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 05:47:03 +00:00
Matt Arsenault
0f55cd487f llc: Update LLVMBuild
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292196 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 05:34:08 +00:00
Matt Arsenault
878b099978 llc: Initialize more passes
Targets can add these. Initialize them so -print-before/-print-after
etc. work.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292195 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 05:11:25 +00:00
Davide Italiano
d97e73205c [llvm-objdump] Dump PT_NOTE as part of -p.
PR: 31641

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292170 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 23:13:46 +00:00
Davide Italiano
d871b20cb5 [llvm-objdump] Dump PT_GNU_RELRO as part of -p.
PR: 31641

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292169 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 22:58:26 +00:00
Davide Italiano
91010967e3 [llvm-objdump] Dump PT_OPENBSD_{BOOTDATA,RANDOMIZE,WXNEEDED}.
PR: 31641

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292167 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 22:01:41 +00:00
David Blaikie
1854d25176 Add missing header to see if that clears up the build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292166 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 21:40:08 +00:00
David Blaikie
aab72f0669 Attempt to fix the MSVC build by using llvm::errc instead of std::errc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292163 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 21:20:51 +00:00
David Blaikie
061ca191c0 [XRay] Implement the llvm-xray graph subcommand
Here we define the `graph` subcommand which generates a graph from the function
call information and uses it to present the call information graphically with
additional annotations.

Reviewers: dblaikie, dberris

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292156 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 20:36:26 +00:00
Pavel Labath
8a1006b50d [llvm-xray] Fix android build
std::to_string is not available in the android ndk. Using llvm::to_string
instead.

Committing as obvious.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292143 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 16:38:23 +00:00
Daniel Jasper
8b122d0496 Fix un-initialized error introduced by r291959.
This is uncovered when running tools/dsymutil/X86/empty_range.s.test
with ASAN. Haven't investigate yet, whether that means there is an ODR
violation in that test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292065 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-15 16:42:36 +00:00
Greg Clayton
b24afca5be Add a variant of DWARFDie::find() and DWARFDie::findRecursively() that takes a llvm::ArrayRef<dwarf::Attribute>.
This allows us efficiently look for more than one attribute, something that is quite common in DWARF consumption.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291967 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 22:32:12 +00:00
Greg Clayton
beabb639c5 Cleanup how DWARFDie attributes are accessed and decoded.
Removed all DWARFDie::getAttributeValueAs*() calls.
Renamed:
  Optional<DWARFFormValue> DWARFDie::getAttributeValue(dwarf::Attribute);
To:
  Optional<DWARFFormValue> DWARFDie::find(dwarf::Attribute);
Added:
  Optional<DWARFFormValue> DWARFDie::findRecursively(dwarf::Attribute);
  
All decoding of Optional<DWARFFormValue> values are now done using the dwarf::to*() functions from DWARFFormValue.h:

Old code:
  
  auto DeclLine = DWARFDie.getAttributeValueAsSignedConstant(DW_AT_decl_line).getValueOr(0);
  
New code:

  auto DeclLine = toUnsigned(DWARFDie.find(DW_AT_decl_line), 0);
  
This composition helps us since we can now easily do:

  auto DeclLine = toUnsigned(DWARFDie.findRecursively(DW_AT_decl_line), 0);
  
This allows us to easily find attribute values in the current DIE only (the first new code above) or in any DW_AT_abstract_origin or DW_AT_specification Dies using the line above. Note that the code line length is shorter and more concise.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291959 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 21:08:18 +00:00
Ivan Krasin
d6d6b83a0b Revert r291903 and r291898. Reason: they break check-lld on the bots.
Summary:
Revert [ARM] Fix ubig32_t read in ARMAttributeParser

Now using support functions to read data instead of trying to
perform casts.
===========================================================

Revert [ARM] Enable objdump to construct triple for ARM

Now that The ARMAttributeParser has been moved into the library,
it has been modified so that it can parse the attributes without
printing them and stores them in a map. ELFObjectFile now queries
the attributes to fill out the architecture details of a provided
triple for 'arm' and 'thumb' targets. llvm-objdump uses this new
functionality.

Subscribers: llvm-commits, samparker, aemerson, mgorny

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291911 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 16:45:15 +00:00
George Rimar
06943952f3 [llvm-dwp] - Reuse object::Decompressor class
One more place where Decompressor class can be reused.

Differential revision: https://reviews.llvm.org/D28679



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291906 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 15:58:55 +00:00
Sam Parker
6968dd2f43 [ARM] Enable objdump to construct triple for ARM
Now that The ARMAttributeParser has been moved into the library,
it has been modified so that it can parse the attributes without
printing them and stores them in a map. ELFObjectFile now queries
the attributes to fill out the architecture details of a provided
triple for 'arm' and 'thumb' targets. llvm-objdump uses this new
functionality.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291898 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 11:04:21 +00:00
Sam Parker
93a4a6e681 [ARM] Moved ARMAttributeParser to Support
Moved ARMAttributeParser out of llvm-readobj and into the support
library.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291896 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 10:50:01 +00:00
NAKAMURA Takumi
bda0ff2479 xray-account: Avoid std::errc::bad_message to appease mingw.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291863 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 00:17:15 +00:00
Zachary Turner
233ecbde65 [llvm-pdbdump] Add a compact dump mode.
Differential Revision: https://reviews.llvm.org/D28545

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291849 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 22:28:15 +00:00
Chris Bieneman
15135b3b8a [ObjectYAML] Pull yaml2dwarf out of yaml2obj for reuse
This patch pulls the yaml2dwarf code out of yaml2obj into a new set of DWARF emitter functions in the DWARFYAML namespace. This will enable the YAML->DWARF code to be used inside DWARF tests by populating the DWARFYAML structs and calling the Emitter functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291828 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 21:35:21 +00:00
Marcello Maggioni
eea6148176 [llvm-config] Fix obviously wrong code in parsing DyLib components.
The code parsing the string was using the offset returned from
StringRef::find() wrong, assuming it was relative to the staring
offset that is passed to the function, but the returned offset
is always relative to the beginning of the line.

This causes odd behaviour while parsing the component string.
Spotted thanks to the newly added test:

tools/llvm-config/booleans.test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291803 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 19:47:38 +00:00
Hans Wennborg
fa3329aff5 Avoid std::errc::protocol_* to appease mingw
Like r291636 and r285261.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291786 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 18:33:14 +00:00
Simon Pilgrim
e821446fbc Fix windows buildbots building llvm-xray
2 issues:
1 - replaced unix-style pid_t with cross-platform llvm::sys::ProcessInfo::ProcessId 
2 - fixed shadow variable warning in lambda expression

Reviewed by @filcab

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291760 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 11:13:51 +00:00
Dean Michael Berris
182166ec7e [XRay] Include <numeric> for std::accumulate.
Fix-up following D24377.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291750 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 07:43:54 +00:00
Dean Michael Berris
c4416a6dc0 [XRay] Implement the llvm-xray account subcommand
Summary:
This is the third of a multi-part change to implement subcommands for
the `llvm-xray` tool.

Here we define the `account` subcommand which does simple function call
accounting, generating basic statistics on function calls we find in an
XRay log/trace. We support text output and csv output for this
subcommand.

This change also supports sorting, summing, and filtering the top N
results.

Part of this tool will later be turned into a library that could be used
for basic function call accounting.

Depends on D24376.

Reviewers: dblaikie, echristo

Subscribers: mehdi_amini, dberris, beanz, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291749 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 07:38:13 +00:00
Zachary Turner
4509ae413a [CodeView] Finish decoupling TypeDatabase from TypeDumper.
Previously the type dumper itself was passed around to a lot of different
places and manipulated in ways that were more appropriate on the type
database. For example, the entire TypeDumper was passed into the symbol
dumper, when all the symbol dumper wanted to do was lookup the name of a
TypeIndex so it could print it. That's what the TypeDatabase is for --
mapping type indices to names.

Another example is how if the user runs llvm-pdbdump with the option to
dump symbols but not types, we still have to visit all types so that we
can print minimal information about the type of a symbol, but just without
dumping full symbol records. The way we did this before is by hacking it
up so that we run everything through the type dumper with a null printer,
so that the output goes to /dev/null. But really, we don't need to dump
anything, all we want to do is build the type database. Since
TypeDatabaseVisitor now exists independently of TypeDumper, we can do
this. We just build a custom visitor callback pipeline that includes a
database visitor but not a dumper.

All the hackery around printers etc goes away. After this patch, we could
probably even delete the entire CVTypeDumper class since really all it is
at this point is a thin wrapper that hides the details of how to build a
useful visitation pipeline. It's not a priority though, so CVTypeDumper
remains for now.

After this patch we will be able to easily plug in a different style of
type dumper by only implementing the proper visitation methods to dump
one-line output and then sticking it on the pipeline.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291724 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 23:24:22 +00:00
Greg Clayton
a9a480efd1 Remove all variants of DWARFDie::getAttributeValueAs...() that had parameters that specified default values.
Now we only support returning Optional<> values and have changed all clients over to use Optional::getValueOr().

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291686 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 17:43:37 +00:00
Chandler Carruth
c68d25fb58 [PM] Separate the LoopAnalysisManager from the LoopPassManager and move
the latter to the Transforms library.

While the loop PM uses an analysis to form the IR units, the current
plan is to have the PM itself establish and enforce both loop simplified
form and LCSSA. This would be a layering violation in the analysis
library.

Fundamentally, the idea behind the loop PM is to *transform* loops in
addition to running passes over them, so it really seemed like the most
natural place to sink this was into the transforms library.

We can't just move *everything* because we also have loop analyses that
rely on a subset of the invariants. So this patch splits the the loop
infrastructure into the analysis management that has to be part of the
analysis library, and the transform-aware pass manager.

This also required splitting the loop analyses' printer passes out to
the transforms library, which makes sense to me as running these will
transform the code into LCSSA in theory.

I haven't split the unittest though because testing one component
without the other seems nearly intractable.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291662 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 09:43:56 +00:00