Commit Graph

194887 Commits

Author SHA1 Message Date
Duncan P. N. Exon Smith 02f4bbc588 DebugInfo: Fix invalid file reference in CodeGen/X86/unknown-location.ll
There are two types of files in the old (current) debug info schema.

    !0 = !{!"some/filename", !"/path/to/dir"}
    !1 = !{!"0x29", !0} ; [ DW_TAG_file_type ]

!1 has a wrapper class called `DIFile` which inherits from `DIScope` and
is referenced in 'scope' fields.

!0 is called a "file node", and debug info nodes with a 'file' field
point at one of these directly -- although they're built in `DIBuilder`
by sending in a `DIFile` and reaching into it.

In the new hierarchy, I unified these nodes as `MDFile` (which `DIFile`
is a lightweight wrapper for) in r230057.  Moving the new hierarchy into
place (and upgrading testcases) caused CodeGen/X86/unknown-location.ll
to start failing -- apparently "0x29" was previously showing up in the
linetable as a filename, causing:

    .loc 2 4 3

(where 2 points at filename "0x29") instead of:

    .loc 1 4 3

(where 1 points at the actual filename).

Change the testcase to use the old schema correctly.

llvm-svn: 230880
2015-02-28 23:52:24 +00:00
Duncan P. N. Exon Smith 9c3b89448a DebugInfo: Use TempMDNode in DIDescriptor::replaceAllUsesWith()
Start using `TempMDNode` in `DIDescriptor::replaceAllUsesWith()`
(effectively `std::unique_ptr<MDNode, MDNode::deleteTemporary>`).

Besides making ownership more explicit, this prepares for when
`DIDescriptor` refers to nodes that are *not* `MDTuple`.  The old logic
for "replacing" a node with itself used `MDNode::get()` to return a new
(uniqued) `MDTuple`, while the new logic just defers to
`MDNode::replaceWithUniqued()` (which also typically saves an allocation
and RAUW traffic by mutating the temporary in place).

llvm-svn: 230879
2015-02-28 23:48:02 +00:00
Sanjay Patel db962e2afb fixed to test only the feature, not the feature and a CPU
llvm-svn: 230878
2015-02-28 23:47:09 +00:00
Duncan P. N. Exon Smith 16d182acb9 Optimize metadata node fields for CHECK-ability
While gaining practical experience hand-updating CHECK lines (for moving
the new debug info hierarchy into place),  I learnt a few things about
CHECK-ability of the specialized node assembly output.

  - The first part of a `CHECK:` is to identify the "right" node (this
    is especially true if you intend to use the new `CHECK-SAME`
    feature, since the first CHECK needs to identify the node correctly
    before you can split the line).
      - If there's a `tag:`, it should go first.
      - If there's a `name:`, it should go next (followed by the
        `linkageName:`, if any).
      - If there's a `scope:`, it should follow after that.
  - When a node type supports multiple DW_TAGs, but one is implied by
    its name and is overwhelmingly more common, the `tag:` field is
    terribly uninteresting unless it's different.
      - `MDBasicType` is almost always `DW_TAG_base_type`.
      - `MDTemplateValueParameter` is almost always
        `DW_TAG_template_value_parameter`.
  - Printing `name: ""` doesn't improve CHECK-ability, and there are far
    more nodes than I realized that are commonly nameless.
  - There are a few other fields that similarly aren't very interesting
    when they're empty.

This commit updates the `AsmWriter` as suggested above (and makes
necessary changes in `LLParser` for round-tripping).

llvm-svn: 230877
2015-02-28 23:21:38 +00:00
Sanjay Patel 1c3eaecc09 fix typo; NFC
llvm-svn: 230876
2015-02-28 22:25:06 +00:00
Duncan P. N. Exon Smith c296fcc39e AsmWriter: Escape string fields in metadata
Properly escape string fields in metadata.  I've added a spot-check with
direct coverage for `MDFile::getFilename()`, but we'll get more coverage
once the hierarchy is moved into place (since this comes up in various
checked-in testcases).

I've replicated the `if` logic using the `ShouldSkipEmpty` flag
(although a follow-up commit is going to change how often this flag is
specified); no NFCI other than escaping the string fields.

llvm-svn: 230875
2015-02-28 22:20:16 +00:00
Hans Wennborg 521a941074 Revert r229678 "tsan: fix signal handling during stop-the-world"
This was causing Chromium's browser_tests to flakily segfault during
leak check.

llvm-svn: 230874
2015-02-28 22:18:11 +00:00
Duncan P. N. Exon Smith 79cf9705c7 AsmWriter: Extract writeStringField(), NFCI
Extract logic for escaping a string field in the new debug info
hierarchy from `GenericDebugNode`.  A follow-up commit will use it far
more widely (hence the dead code for `ShouldSkipEmpty`).

llvm-svn: 230873
2015-02-28 22:16:56 +00:00
Duncan P. N. Exon Smith 3a46c142bf Fix buildbot issues for MDScope::getFile() after r230871
I hope this extra cast will make everyone happy...

llvm-svn: 230872
2015-02-28 21:58:10 +00:00
Duncan P. N. Exon Smith 2c6a0a905c IR: Specialize MDScope::getFile() for MDFile
Fix `MDScope::getFile()` so that it correctly returns a valid `MDFile`
even when it's an instance of `MDFile`.  This logic is necessary because
of r230057.  I'm working on moving the new hierarchy into place
out-of-tree (on track to commit Monday morning, BTW), and this was
exposed by a few failing tests.

llvm-svn: 230871
2015-02-28 21:47:02 +00:00
Duncan P. N. Exon Smith a951165e5a Fix line endings on Transforms/Inline/inline_dbg_declare.ll
llvm-svn: 230870
2015-02-28 21:38:32 +00:00
Saleem Abdulrasool 06609c64d7 build: remove the stub linux SDK
The SDK is insufficient to really build much.  The builtins can be built
standalone now which is what the stub SDK was meant to permit.  Remove the
unnecessary files.

llvm-svn: 230869
2015-02-28 20:30:11 +00:00
Zachary Turner ccf0415973 [llvm-pdbdump] Better error handling.
Previously it was impossible to distinguish between "There is
no PDB implementation for this platform" and "I tried to load
the PDB, but couldn't find the file", making it hard to figure
out if you built llvm-pdbdump incorrectly or if you just mistyped
a file name.

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

llvm-svn: 230868
2015-02-28 20:23:18 +00:00
Saleem Abdulrasool 66d4c6e78c cmath: account for MSVCRT 12.0 changes
MSVCRT 12.0 introduces better compatibility for C99. This includes a number of
math routines that were previously undefined. Use the crtversion.h header to
detect the version of MSVCRT being targeted and avoid re-declaring the
variables.

Since copysign has been introduced in MSVCRT, importing the definition via using
makes it difficult to provide overloads (due to minor differences between
throw () and noexcept. Avoid defining the overloads on newer MSVCRT
targets.

llvm-svn: 230867
2015-02-28 20:18:39 +00:00
Benjamin Kramer 4b7dd64d82 IndexedMap: Default to SmallVector<T, 0>
This looks ridiculous but SmallVector's realloc tricks really help with
large vectors of PODs, such as our virtreg IndexedMap.

llvm-svn: 230866
2015-02-28 20:15:07 +00:00
Benjamin Kramer 49a1132976 DwarfAccelTable: We know how many hashes we have in the output, just reserve the precise number
llvm-svn: 230865
2015-02-28 20:15:00 +00:00
Benjamin Kramer 48ea372d90 StackColoring: Move set instead of copying. NFC.
llvm-svn: 230864
2015-02-28 20:14:38 +00:00
Benjamin Kramer 4c5dcb0a83 LiveRange: Replace a creative vector erase loop with std::remove_if.
I didn't see this so far because it scans backwards, but that doesn't
make it any less quadratic. NFC.

llvm-svn: 230863
2015-02-28 20:14:27 +00:00
Nick Lewycky 79a8c4b0cd Revert r230812. Do not break builds for no reason.
llvm-svn: 230862
2015-02-28 19:43:20 +00:00
Mehdi Amini 04f0f5ba61 Fixup for recent -fast-isel-abort change: code didn't match description
Level 1 should abort for all instructions but call/terminators/args.
Instead it was aborting only if the level was > 2

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 230861
2015-02-28 19:34:54 +00:00
Craig Topper 782d620657 [X86] Remove the blendpd/blendps/pblendw/pblendd intrinsics. They can represented by shuffle_vector instructions.
llvm-svn: 230860
2015-02-28 19:33:17 +00:00
Zachary Turner 9e1ce99d81 [raw_ostream] When printing color on Windows, use correct bg color.
When using SetConsoleTextAttribute() to set the foreground or
background color, if you don't explicitly set both colors, then
a default value of black will be chosen for whichever you don't
specify a value for.

This is annoying when you have a non default console background
color, for example, and you try to set the foreground color.

This patch gets the existing fg/bg color and when you set one
attribute, sets the opposite attribute to its existing color
prior to comitting the update.

Reviewed by: Aaron Ballman
Differential Revision: http://reviews.llvm.org/D7967

llvm-svn: 230859
2015-02-28 19:08:27 +00:00
Alexei Starovoitov 1b7b56fbcc bpf: fix build
complete the plumbing of passing TargetRegisterInfo through
computeRegisterProperties started by r230583

llvm-svn: 230858
2015-02-28 18:03:04 +00:00
Johannes Doerfert 7b1b724c89 Update obsolete comment
llvm-svn: 230857
2015-02-28 17:10:06 +00:00
Benjamin Kramer cb570f1bc9 TRE: Just erase dead BBs and tweak the iteration loop not to increment the deleted BB iterator.
Leaving empty blocks around just opens up a can of bugs like PR22704. Deleting
them early also slightly simplifies code.

Thanks to Sanjay for the IR test case.

llvm-svn: 230856
2015-02-28 16:47:27 +00:00
Yaron Keren 96e68a0c47 Silence variable set but not used warning in CodeGenRegisters.cpp, NFC.
llvm-svn: 230854
2015-02-28 15:54:04 +00:00
Yaron Keren d602c35eca Silence three more variable set but not used warnings, NFC.
llvm-svn: 230853
2015-02-28 15:29:17 +00:00
Johannes Doerfert d40991bf83 Format non-affine subregions news item
llvm-svn: 230852
2015-02-28 14:48:15 +00:00
Johannes Doerfert c28197e619 Add non-affine subregions to the news
llvm-svn: 230851
2015-02-28 14:46:26 +00:00
Peter Zotov 81c0d9f900 [OCaml] Generate documentation again with autoconf buildsystem.
Patch by Evangelos Foutras:

r220899 started using ocamlfind to build the OCaml bindings but
docs/Makefile still contains references to the OCAMLDOC macro which
is no longer being defined. The result is that OCaml documentation
isn't generated/installed.

llvm-svn: 230850
2015-02-28 13:48:23 +00:00
Benjamin Kramer 5fbfe2ffdc Convert push_back loops into append calls.
No functionality change intended.

llvm-svn: 230849
2015-02-28 13:20:15 +00:00
Yaron Keren 42a7adf171 Silence variable set but not used warning, NFC.
llvm-svn: 230848
2015-02-28 13:11:24 +00:00
Kuba Brecka ca48abc9b3 Fix OS X build failure with Command Line Tools and without full Xcode installation
On OS X, if you don't have a full Xcode installation, but just the Command Line Tools package, xcrun and xcodebuild don't return a valid SDK root path. In these cases, let's use "/" as the SDK root (which is where the headers and libraries are installed).

Reviewed at http://reviews.llvm.org/D7641

llvm-svn: 230847
2015-02-28 12:25:10 +00:00
Benjamin Kramer f1362f6196 ArrayRefize memory operand folding. NFC.
llvm-svn: 230846
2015-02-28 12:04:00 +00:00
Benjamin Kramer 4f6ac16292 Replace std::copy with a back inserter with vector append where feasible
All of the cases were just appending from random access iterators to a
vector. Using insert/append can grow the vector to the perfect size
directly and moves the growing out of the loop. No intended functionalty
change.

llvm-svn: 230845
2015-02-28 10:11:12 +00:00
Eric Christopher b759340fc8 Remove option.ll as part of the Forward Control Flow Integrity
removal.

llvm-svn: 230844
2015-02-28 10:04:18 +00:00
Richard Smith 8825f280e1 Add change accidentally missed from r230840.
llvm-svn: 230843
2015-02-28 09:58:41 +00:00
Kuba Brecka 8f23ce244c Symbolizer refactoring: SymbolizerTool and better interface
Reviewed at: http://reviews.llvm.org/D7936

llvm-svn: 230842
2015-02-28 09:39:05 +00:00
Filipe Cabecinhas d0dc529da3 Add PS4's autolink syntax to autolink.m's CHECK lines.
llvm-svn: 230841
2015-02-28 07:35:07 +00:00
Richard Smith c3a532576c [modules] Avoid adding a redecl chain to the 'pending out of date' list as the
very first step in updating it.

llvm-svn: 230840
2015-02-28 05:57:02 +00:00
Richard Smith 37bd29a5e6 Give better diagnostics when -fmodule-file= finds a bad file: if the file is
found indirectly, explain how we got there, and distinguish between 'file not
found' and 'file found but invalid'.

llvm-svn: 230839
2015-02-28 03:09:52 +00:00
Petar Jovanovic 9ef0d1c145 [MIPS] Add missing header for syscall
The syscall function itself is declared in <unistd.h>
Compiling compiler-rt with -Werror-implicit-function-declaration will
cause a build failure. This change fixes it.

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

llvm-svn: 230838
2015-02-28 02:32:55 +00:00
Saleem Abdulrasool 48205982a3 Unwind: make it build on Darwin again
The support for the LSB eh_frame_hdr extension was overzealous in trying to
include headers.  Be more careful to permit building on Darwin.

llvm-svn: 230837
2015-02-28 02:23:54 +00:00
Philip Reames 28e61ce60f [RewriteStatepointsForGC] Reduce indentation via early continue [NFC]
llvm-svn: 230836
2015-02-28 01:57:44 +00:00
Philip Reames 2e5bcbe8d5 [RewriteStatepointsForGC] Fix another order of iteration bug
It turns out the naming of inserted phis and selects is sensative to the order in which two sets are iterated.  We need to nail this down to avoid non-deterministic output and possible test failures.  

The modified test is the one I first noticed something odd in.  The change is making it more strict to report the error.  With the test change, but without the code change, the test fails roughly 1 in 5.  With the code change, I've run ~30 runs without error.

Long term, the right fix here is to adjust the naming scheme.  I'm checking in this hack to avoid any possible non-determinism in the tests over the weekend.  HJust because I only noticed one case doesn't mean it's actually the only case.  I hope to get to the right change Monday.

std->llvm data structure changes bugfix change #3

llvm-svn: 230835
2015-02-28 01:52:09 +00:00
Richard Smith 36befcee75 [modules] Deduplicate when merging lists of template specializations from imported modules.
llvm-svn: 230834
2015-02-28 01:45:19 +00:00
Alexey Samsonov 34dc40730a [ASan] debug_stacks.cc was passing on ARM by accident, disable this test there for now.
llvm-svn: 230833
2015-02-28 01:35:46 +00:00
Vince Harron e6909e7886 Temporarily XFAIL TestLaunchWithShellExpand to get the build green
llvm-svn: 230832
2015-02-28 01:10:57 +00:00
Vince Harron 5a6b8aa4dd Use -fstandalone-debug for few tests to get around a Clang optimization
clang-3.5+ outputs FullDebugInfo by default for Darwin/FreeBSD targets.
Other targets do not, which causes several tests to fail.  This flag
enables FullDebugInfo for all targets.

Fixes the following tests:

TestCallStdStringFunction.py
TestDataFormatterSkipSummary.py
TestDataFormatterStdIterator.py
TestDataFormatterStdList.py
TestDataFormatterStdString.py
TestSBValuePersist.py
TestStringPrinter.py
TestTypeCompletion.py

llvm-svn: 230831
2015-02-28 01:07:50 +00:00
Richard Smith 91c18de755 Rework our handling of key functions. We used to track a complete list of all
dynamic classes in the translation unit and check whether each one's key
function is defined when we got to the end of the TU (and when we got to the
end of each module). This is really terrible for modules performance, since it
causes unnecessary deserialization of every dynamic class in every compilation.

We now use a much simpler (and, in a modules build, vastly more efficient)
system: when we see an out-of-line definition of a virtual function, we check
whether that function was in fact its class's key function. (If so, we need to
emit the vtable.)

llvm-svn: 230830
2015-02-28 01:01:56 +00:00