platform/upstream/llvm.git
9 years agoFix Mingw build.
Hafiz Abid Qadeer [Wed, 11 Feb 2015 10:14:13 +0000 (10:14 +0000)]
Fix Mingw build.

Following changes are done.

Add missing headers.
Replace _snprintf with snprintf. It is already changed to _snprintf for MSVC.
Add a file in the build for autoconf.
Call DynamicLoaderWindows::Terminate and DynamicLoaderWindows::Initialize only for MSVC build.

Reviewed in http://reviews.llvm.org/D7536.

llvm-svn: 228822

9 years ago[LoopReroll] Introduce the concept of DAGRootSets.
James Molloy [Wed, 11 Feb 2015 09:19:47 +0000 (09:19 +0000)]
[LoopReroll] Introduce the concept of DAGRootSets.

A DAGRootSet models an induction variable being used in a rerollable
loop. For example:

   x[i*3+0] = y1
   x[i*3+1] = y2
   x[i*3+2] = y3

   Base instruction -> i*3
                    +---+----+
                   /    |     \
               ST[y1]  +1     +2  <-- Roots
                        |      |
                      ST[y2] ST[y3]

There may be multiple DAGRootSets, for example:

   x[i*2+0] = ...   (1)
   x[i*2+1] = ...   (1)
   x[i*2+4] = ...   (2)
   x[i*2+5] = ...   (2)
   x[(i+1234)*2+5678] = ... (3)
   x[(i+1234)*2+5679] = ... (3)

This concept is similar to the "Scale" member used previously, but allows
multiple independent sets of roots based off the same induction variable.

llvm-svn: 228821

9 years agoAsmParser: Validate alloca's type
David Majnemer [Wed, 11 Feb 2015 09:13:11 +0000 (09:13 +0000)]
AsmParser: Validate alloca's type

An alloca's type should be weird things like metadata.

llvm-svn: 228820

9 years agoDataLayout: Report when the preferred alignment is less than the ABI
David Majnemer [Wed, 11 Feb 2015 09:13:09 +0000 (09:13 +0000)]
DataLayout: Report when the preferred alignment is less than the ABI

llvm-svn: 228819

9 years agoVerifier: Check for null operands in !llvm.module.flags
David Majnemer [Wed, 11 Feb 2015 09:13:06 +0000 (09:13 +0000)]
Verifier: Check for null operands in !llvm.module.flags

llvm-svn: 228818

9 years ago[X86] Split information collection from actual transformation in call frame optimization
Michael Kuperstein [Wed, 11 Feb 2015 08:53:55 +0000 (08:53 +0000)]
[X86] Split information collection from actual transformation in call frame optimization

This splits collecting information from actually performing the transformation, so that we can add a heuristic in between the two.
NFC.

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

llvm-svn: 228817

9 years ago[PBQP] Cautiously update edge costs in the solver
Arnaud A. de Grandmaison [Wed, 11 Feb 2015 08:25:36 +0000 (08:25 +0000)]
[PBQP] Cautiously update edge costs in the solver

The NodeMetadata are maintained in an incremental way. When an edge between
2 nodes has its cost updated, in the course of graph reduction for example,
the NodeMetadata need first to have the old edge cost removed, then the new
edge cost added. Only once the NodeMetadata have been fully updated, it
becomes safe to consider promoting the nodes to the
ConservativelyAllocatable or OptimallyReducible sets. Previously, this
promotion was occuring right after the removing the old cost, and this was
breaking the assumption that a ConservativelyAllocatable should not be
spilled.

This patch also adds asserts to:
 - enforces the invariant that a node's reduction can not be downgraded,
 - only not provably allocatable or optimally reducible nodes can be spilled.

llvm-svn: 228816

9 years agoVerifier: Make sure !llvm.ident's operand isn't null
David Majnemer [Wed, 11 Feb 2015 08:23:20 +0000 (08:23 +0000)]
Verifier: Make sure !llvm.ident's operand isn't null

llvm-svn: 228815

9 years agoFix amount of diagnostic classes
Alex Denisov [Wed, 11 Feb 2015 07:56:16 +0000 (07:56 +0000)]
Fix amount of diagnostic classes

llvm-svn: 228814

9 years agoAsmParser: Don't crash when insertvalue has bad operands
David Majnemer [Wed, 11 Feb 2015 07:43:58 +0000 (07:43 +0000)]
AsmParser: Don't crash when insertvalue has bad operands

llvm-svn: 228813

9 years agoAsmParser: Switch some vectors to maps
David Majnemer [Wed, 11 Feb 2015 07:43:56 +0000 (07:43 +0000)]
AsmParser: Switch some vectors to maps

This speeds up parsing .ll files with metadata nodes with large IDs.

llvm-svn: 228812

9 years agoFix build for CMake < 2.8.12.
Peter Collingbourne [Wed, 11 Feb 2015 05:58:57 +0000 (05:58 +0000)]
Fix build for CMake < 2.8.12.

llvm-svn: 228810

9 years agounwind: tweak inclusion ordering to work around GCC
Saleem Abdulrasool [Wed, 11 Feb 2015 05:20:53 +0000 (05:20 +0000)]
unwind: tweak inclusion ordering to work around GCC

This is a slightly convoluted workaround.  GCC does not support the
__has_feature extension of clang, and this results in some issues with
static_asserts.  config.h defines static_assert as a macro with a C-specific
trickery.  This then propagates into the C++ headers included after config.h,
which are used with C++11 mode, enabling constexpr constructors.  The macro'ed
static_assert does not get treated as the static_assert builtin, and will cause
an error due to a non-empty constexpr constructor.  Tweaking the include order
permits the use of libc++ headers to build libunwind with GCC on Linux.

llvm-svn: 228809

9 years agounwind: clean up some -Werror=return-type warnings
Saleem Abdulrasool [Wed, 11 Feb 2015 05:20:50 +0000 (05:20 +0000)]
unwind: clean up some -Werror=return-type warnings

Mark that the functions always return or abort if the register class is
unhandled.  Avoid placing the abort in the switch to permit -Wswitch-cover to
catch missing values.

llvm-svn: 228808

9 years agounwind: clean up more -Wformat warnings
Saleem Abdulrasool [Wed, 11 Feb 2015 05:20:47 +0000 (05:20 +0000)]
unwind: clean up more -Wformat warnings

This makes compilation on ARM -Wformat clean with GCC.  NFC.

llvm-svn: 228807

9 years agounwind: clean up straggling -Wundef warning
Saleem Abdulrasool [Wed, 11 Feb 2015 05:20:44 +0000 (05:20 +0000)]
unwind: clean up straggling -Wundef warning

Conservatively define __ARM_ARCH to 4 in the case that it is undefined (e.g.
with GCC).

llvm-svn: 228806

9 years agounwind: silence -Wconversion warnings
Saleem Abdulrasool [Wed, 11 Feb 2015 05:20:42 +0000 (05:20 +0000)]
unwind: silence -Wconversion warnings

Clean up implicit uint8_t to uint32_t conversion warnings identified by GCC.

llvm-svn: 228805

9 years agoClean up test/tools/lldb-mi/TestMiNotification.py (MI)
Ilia K [Wed, 11 Feb 2015 05:02:44 +0000 (05:02 +0000)]
Clean up test/tools/lldb-mi/TestMiNotification.py (MI)

llvm-svn: 228804

9 years agoFix segfault notification in lldb-mi
Ilia K [Wed, 11 Feb 2015 04:58:41 +0000 (04:58 +0000)]
Fix segfault notification in lldb-mi

Summary:
This patch adds system exception handling in lldb-mi + tests.

All tests pass on OS X.

Reviewers: zturner, abidh, clayborg

Reviewed By: clayborg

Subscribers: emaste, lldb-commits, zturner, clayborg, abidh

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

llvm-svn: 228803

9 years agoFix CMIUtilString::SplitConsiderQuotes (MI)
Ilia K [Wed, 11 Feb 2015 04:52:54 +0000 (04:52 +0000)]
Fix CMIUtilString::SplitConsiderQuotes (MI)

Summary:
This method doesn't work properly. Here is an example:
```
CMIUtilString test("\"hello\" \"\\\" world \\\" !\"");
CMIUtilString::VecString_t res;
test.SplitConsiderQuotes(" ", res);
```

Before this patch the result was as following:
```
(lldb) print res
(CMIUtilString::VecString_t) $1 = size=4 {
  [0] = (std::__1::string = "\"hello\"")
  [1] = (std::__1::string = "\"\\\"")
  [2] = (std::__1::string = "world")
  [3] = (std::__1::string = "\\\" !\"")
}
```

This patch fixes that error and now it looks like following:
```
(lldb) print res
(CMIUtilString::VecString_t) $1 = size=2 {
  [0] = (std::__1::string = "\"hello\"")
  [1] = (std::__1::string = "\"\\\" world \\\" !\"")
}
```

Reviewers: abidh, emaste, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, emaste, clayborg, abidh

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

llvm-svn: 228802

9 years agoClose terminal after LaunchInTerminalTestCase test
Ilia K [Wed, 11 Feb 2015 04:51:41 +0000 (04:51 +0000)]
Close terminal after LaunchInTerminalTestCase test

Summary:
The test_launch_in_terminal test leaves a running terminal.
This patch adds "exit" after debugging with eLaunchFlagLaunchInTTY flag.

Reviewers: jingham, zturner, clayborg

Reviewed By: clayborg

Subscribers: emaste, vharron, lldb-commits, clayborg, jingham, zturner

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

llvm-svn: 228801

9 years agoUse ADDITIONAL_HEADER_DIRS in all LLVM CMake projects.
Zachary Turner [Wed, 11 Feb 2015 03:28:02 +0000 (03:28 +0000)]
Use ADDITIONAL_HEADER_DIRS in all LLVM CMake projects.

This allows IDEs to recognize the entire set of header files for
each of the core LLVM projects.

Differential Revision: http://reviews.llvm.org/D7526
Reviewed By: Chris Bieneman

llvm-svn: 228798

9 years agoRevert "[UBSan] Enable -Wglobal-constructors."
Justin Bogner [Wed, 11 Feb 2015 03:05:02 +0000 (03:05 +0000)]
Revert "[UBSan] Enable -Wglobal-constructors."

We're still using global constructors when not on linux, so this was
causing warnings on Darwin. Reverting for now.

This reverts r228384.

llvm-svn: 228795

9 years agoInstrProf: Add a test for PR22531
Justin Bogner [Wed, 11 Feb 2015 02:53:03 +0000 (02:53 +0000)]
InstrProf: Add a test for PR22531

This is a test for the llvm change in r228793. We need to make sure
that names referred to by coverage end up in the right section, or the
coverage tools won't work.

llvm-svn: 228794

9 years agoInstrProf: Lower coverage mappings by setting their sections appropriately
Justin Bogner [Wed, 11 Feb 2015 02:52:44 +0000 (02:52 +0000)]
InstrProf: Lower coverage mappings by setting their sections appropriately

Add handling for __llvm_coverage_mapping to the InstrProfiling
pass. We need to make sure the constant and any profile names it
refers to are in the correct sections, which is easier and cleaner to
do here where we have to know about profiling sections anyway.

This is really tricky to test without a frontend, so I'm committing
the test for the fix in clang. If anyone knows a good way to test this
within LLVM, please let me know.

Fixes PR22531.

llvm-svn: 228793

9 years agoAdd a warning for direct-list-initialization of a variable with a deduced type
Richard Smith [Wed, 11 Feb 2015 02:41:33 +0000 (02:41 +0000)]
Add a warning for direct-list-initialization of a variable with a deduced type
(or of a lambda init-capture, which is sort-of such a variable). The semantics
of such constructs will change when we implement N3922, so we intend to warn on
this in Clang 3.6 then change the semantics in Clang 3.7.

llvm-svn: 228792

9 years agoIntroduce the notion of "runtime support values"
Enrico Granata [Wed, 11 Feb 2015 02:35:39 +0000 (02:35 +0000)]
Introduce the notion of "runtime support values"

A runtime support value is a ValueObject whose only purpose is to support some language runtime's operation, but it does not directly provide any user-visible benefit
As such, unless the user is working on the runtime support, it is mostly safe for them not to see such a value when debugging

It is a language runtime's job to check whether a ValueObject is a support value, and that - in conjunction with a target setting - is used by frame variable and target variable
SBFrame::GetVariables gets a new overload with yet another flag to dictate whether to return those support values to the caller - that which defaults to the setting's value

rdar://problem/15539930

llvm-svn: 228791

9 years agoTemporary workaround to fix MSVC 2012 build problems
Andrew Kaylor [Wed, 11 Feb 2015 02:16:34 +0000 (02:16 +0000)]
Temporary workaround to fix MSVC 2012 build problems

llvm-svn: 228788

9 years agoFix invalid LLVM IR in PruneEH tests
Reid Kleckner [Wed, 11 Feb 2015 02:06:47 +0000 (02:06 +0000)]
Fix invalid LLVM IR in PruneEH tests

llvm-svn: 228786

9 years agoPR21857: weaken an incorrect assertion.
Richard Smith [Wed, 11 Feb 2015 01:48:47 +0000 (01:48 +0000)]
PR21857: weaken an incorrect assertion.

llvm-svn: 228785

9 years agoUpdate double_include.sh.cpp for new headers.
Eric Fiselier [Wed, 11 Feb 2015 01:31:02 +0000 (01:31 +0000)]
Update double_include.sh.cpp for new headers.

llvm-svn: 228784

9 years agolibc++ tests: wait_until.pass test sporadically fails (bug 21998)
Eric Fiselier [Wed, 11 Feb 2015 01:25:57 +0000 (01:25 +0000)]
libc++ tests: wait_until.pass test sporadically fails (bug 21998)

Summary:
Hello Howard,

While running the libc++ tests on our ARM boards, we encounter sporadic failures of the two tests:
test/std/thread/futures/futures.shared_future/wait_until.pass.cpp
test/std/thread/futures/futures.unique_future/wait_until.pass.cpp

The worker thread might not finish yet when the main thread checks its result.
I filed the bug 21998 for this case: http://llvm.org/bugs/show_bug.cgi?id=21998

Would you be able to review this please?
Thank you.
Oleg

Reviewers: howard.hinnant, mclow.lists, danalbert, jroelofs, EricWF

Reviewed By: jroelofs, EricWF

Subscribers: EricWF, mclow.lists, aemerson, llvm-commits

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

llvm-svn: 228783

9 years agoDon't promote asynch EH invokes of nounwind functions to calls
Reid Kleckner [Wed, 11 Feb 2015 01:23:16 +0000 (01:23 +0000)]
Don't promote asynch EH invokes of nounwind functions to calls

If the landingpad of the invoke is using a personality function that
catches asynch exceptions, then it can catch a trap.

Also add some landingpads to invalid LLVM IR test cases that lack them.

Over-the-shoulder reviewed by David Majnemer.

llvm-svn: 228782

9 years agoMake convert_to_integral.pass.cpp more platform generic.
Eric Fiselier [Wed, 11 Feb 2015 01:18:05 +0000 (01:18 +0000)]
Make convert_to_integral.pass.cpp more platform generic.

Don't depend on the underlying types of enums and wchar_t.

llvm-svn: 228781

9 years agoFix libcxxabi's library and object root for tests.
Eric Fiselier [Wed, 11 Feb 2015 01:07:48 +0000 (01:07 +0000)]
Fix libcxxabi's library and object root for tests.

llvm-svn: 228779

9 years agoRemove default definition for libcxx_obj_dir because it doesn't make sense
Eric Fiselier [Wed, 11 Feb 2015 01:03:44 +0000 (01:03 +0000)]
Remove default definition for libcxx_obj_dir because it doesn't make sense

llvm-svn: 228778

9 years agoAs part of the cleanup when a process dies, tell watchpoints to forget their previous...
Enrico Granata [Wed, 11 Feb 2015 00:37:54 +0000 (00:37 +0000)]
As part of the cleanup when a process dies, tell watchpoints to forget their previously recorded values

Because types are not reliably protected against the death of their owners, having ValueObjects lurking around like that past the useful lifetime of their owner processes is a potential source of crashes
That is - in itself - worth fixing at some point, but for this case, watchpoints holding on to old values don't offer enough value to make the larger fix worth

Fixes rdar://19788756

llvm-svn: 228777

9 years agoR600/SI: Store immediate offsets > 12-bits in soffset
Tom Stellard [Wed, 11 Feb 2015 00:34:35 +0000 (00:34 +0000)]
R600/SI: Store immediate offsets > 12-bits in soffset

This will save us from having to extend these offsets to 64-bits
and storing them in a pair of vgprs.

llvm-svn: 228776

9 years agoR600/SI: Add soffset operand to mubuf addr64 instruction
Tom Stellard [Wed, 11 Feb 2015 00:34:32 +0000 (00:34 +0000)]
R600/SI: Add soffset operand to mubuf addr64 instruction

We were previously hard-coding soffset to 0.

llvm-svn: 228775

9 years agoFix warning due to unused private member variable.
Zachary Turner [Wed, 11 Feb 2015 00:33:00 +0000 (00:33 +0000)]
Fix warning due to unused private member variable.

llvm-svn: 228774

9 years agoFix some warnings due to -Wcovered-switch-default.
Zachary Turner [Wed, 11 Feb 2015 00:13:39 +0000 (00:13 +0000)]
Fix some warnings due to -Wcovered-switch-default.

llvm-svn: 228773

9 years ago[UBSan] Add report deduplication for -fsanitize=function.
Alexey Samsonov [Wed, 11 Feb 2015 00:05:31 +0000 (00:05 +0000)]
[UBSan] Add report deduplication for -fsanitize=function.

Summary:
Make sure we don't print the error report from -fsanitize=function
twice for the same source location, as we do in another UBSan handlers.

Test Plan: check-ubsan test suite

Reviewers: rsmith, pcc

Reviewed By: pcc

Subscribers: llvm-commits

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

llvm-svn: 228772

9 years agoFixed a crasher that could happen if:
Greg Clayton [Wed, 11 Feb 2015 00:04:33 +0000 (00:04 +0000)]
Fixed a crasher that could happen if:
- you have a type that contains a typedef to a VectorType or an ExtVectorType
- that type is returned from an ARM function that LLDB steps over so we try to figure out the return type
- we try to determine if the type is a homogeneous aggregate type and we crash

We get not using getAs() when we should have been and using llvm::cast caused an assertion crash when the typedef type didn't return a valid VectorType or ExtVectorType.

<rdar://problem/19646550>

llvm-svn: 228771

9 years agoAdded CoreMedia.cpp to CMakeLists.txt for egranata.
Chaoren Lin [Wed, 11 Feb 2015 00:00:39 +0000 (00:00 +0000)]
Added CoreMedia.cpp to CMakeLists.txt for egranata.

llvm-svn: 228770

9 years agoEmit landing pads for SEH even if nounwind is present
Reid Kleckner [Wed, 11 Feb 2015 00:00:21 +0000 (00:00 +0000)]
Emit landing pads for SEH even if nounwind is present

Disabling exceptions applies nounwind to lots of functions. SEH catches
asynch exceptions, so emit the landing pad anyway.

llvm-svn: 228769

9 years agoConvert std::make_unique<> to llvm::make_unique<>.
Zachary Turner [Tue, 10 Feb 2015 23:46:48 +0000 (23:46 +0000)]
Convert std::make_unique<> to llvm::make_unique<>.

llvm-svn: 228768

9 years ago[mips] Add __clear_cache() definition for non-Android systems
Petar Jovanovic [Tue, 10 Feb 2015 23:36:19 +0000 (23:36 +0000)]
[mips] Add __clear_cache() definition for non-Android systems

Make sure clear_cache() builtin has an appropriate definition for Linux.
Call syscall(NR_cacheflush, ...).

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

llvm-svn: 228767

9 years agoAdd the missing testcase for r228764.
Adrian Prantl [Tue, 10 Feb 2015 23:32:56 +0000 (23:32 +0000)]
Add the missing testcase for r228764.

llvm-svn: 228766

9 years agoFix makeLibCall argument (signed) in SoftenFloatRes_XINT_TO_FP function
Petar Jovanovic [Tue, 10 Feb 2015 23:30:14 +0000 (23:30 +0000)]
Fix makeLibCall argument (signed) in SoftenFloatRes_XINT_TO_FP function

The isSigned argument of makeLibCall function was hard-coded to false
(unsigned). This caused zero extension on MIPS64 soft float.
As the result SingleSource/Benchmarks/Stanford/FloatMM test and
SingleSource/UnitTests/2005-07-17-INT-To-FP test failed.
The solution was to use the proper argument.

Patch by Strahinja Petrovic.

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

llvm-svn: 228765

9 years agoDebug Info: Support variables that are described by more than one MMI
Adrian Prantl [Tue, 10 Feb 2015 23:18:28 +0000 (23:18 +0000)]
Debug Info: Support variables that are described by more than one MMI
table entry. This happens when SROA splits up an alloca and the resulting
allocas cannot be lowered to SSA values because their address is passed
to a function.

Fixes PR22502.

llvm-svn: 228764

9 years agoFix indentation.
Adrian Prantl [Tue, 10 Feb 2015 23:18:15 +0000 (23:18 +0000)]
Fix indentation.

llvm-svn: 228763

9 years agoFix a couple typos in the previous commit
Enrico Granata [Tue, 10 Feb 2015 23:17:07 +0000 (23:17 +0000)]
Fix a couple typos in the previous commit

llvm-svn: 228762

9 years agoEarlyCSE: Add check lines for test added in r228760
David Majnemer [Tue, 10 Feb 2015 23:11:02 +0000 (23:11 +0000)]
EarlyCSE: Add check lines for test added in r228760

llvm-svn: 228761

9 years agoEarlyCSE: It isn't safe to CSE across synchronization boundaries
David Majnemer [Tue, 10 Feb 2015 23:09:43 +0000 (23:09 +0000)]
EarlyCSE: It isn't safe to CSE across synchronization boundaries

This fixes PR22514.

llvm-svn: 228760

9 years agoAdd an LLDB summary for CMTime. Fixes rdar://15370376
Enrico Granata [Tue, 10 Feb 2015 23:02:25 +0000 (23:02 +0000)]
Add an LLDB summary for CMTime. Fixes rdar://15370376

llvm-svn: 228759

9 years agoAdd missing function and header include.
Zachary Turner [Tue, 10 Feb 2015 22:56:21 +0000 (22:56 +0000)]
Add missing function and header include.

llvm-svn: 228758

9 years agoExtract attach core logic from SBTarget::Attach* methods into unified SBTarget::Attac...
Oleksiy Vyalov [Tue, 10 Feb 2015 22:49:57 +0000 (22:49 +0000)]
Extract attach core logic from SBTarget::Attach* methods into unified SBTarget::AttachToProcess and make it work with platform for remote attach purposes.

http://reviews.llvm.org/D7471

llvm-svn: 228757

9 years agoOops. Don't call Windows functions on non-windows.
Zachary Turner [Tue, 10 Feb 2015 22:47:14 +0000 (22:47 +0000)]
Oops.  Don't call Windows functions on non-windows.

llvm-svn: 228756

9 years agoRewrite llvm-pdbdump in terms of LLVMDebugInfoPDB.
Zachary Turner [Tue, 10 Feb 2015 22:43:25 +0000 (22:43 +0000)]
Rewrite llvm-pdbdump in terms of LLVMDebugInfoPDB.

This makes llvm-pdbdump available on all platforms, although it
will currently fail to create a dumper if there is no PDB reader
implementation for the current platform.

It implements dumping of compilands and children, which is less
information than was previously available, but it has to be
rewritten from scratch using the new set of interfaces, so the
rest of the functionality will be added back in subsequent commits.

llvm-svn: 228755

9 years agoX86: @llvm.frameaddress should defer to SelectionDAG for Win CFI
David Majnemer [Tue, 10 Feb 2015 22:00:34 +0000 (22:00 +0000)]
X86: @llvm.frameaddress should defer to SelectionDAG for Win CFI

llvm-svn: 228754

9 years agoGNU: Rename parseZOption because it actually parses only -z max-page-size.
Rui Ueyama [Tue, 10 Feb 2015 21:40:51 +0000 (21:40 +0000)]
GNU: Rename parseZOption because it actually parses only -z max-page-size.

llvm-svn: 228753

9 years agoFix build due to mismatched function signatures.
Zachary Turner [Tue, 10 Feb 2015 21:40:29 +0000 (21:40 +0000)]
Fix build due to mismatched function signatures.

llvm-svn: 228752

9 years ago[Object] Reformat the code with clang-format
Simon Atanasyan [Tue, 10 Feb 2015 21:38:25 +0000 (21:38 +0000)]
[Object] Reformat the code with clang-format

No functional changes.

llvm-svn: 228751

9 years agoUnittest: Do s/_context/_ctx/g.
Rui Ueyama [Tue, 10 Feb 2015 21:28:52 +0000 (21:28 +0000)]
Unittest: Do s/_context/_ctx/g.

llvm-svn: 228750

9 years agoGNU: Add --no-export-dynamic command line option.
Rui Ueyama [Tue, 10 Feb 2015 21:27:31 +0000 (21:27 +0000)]
GNU: Add --no-export-dynamic command line option.

llvm-svn: 228749

9 years agoX86: Make @llvm.frameaddress work correctly with Windows unwind codes
David Majnemer [Tue, 10 Feb 2015 21:22:05 +0000 (21:22 +0000)]
X86: Make @llvm.frameaddress work correctly with Windows unwind codes

Simply loading or storing the frame pointer is not sufficient for
Windows targets.  Instead, create a synthetic frame object that we will
lower later.  References to this synthetic object will be replaced with
the correct reference to the frame address.

llvm-svn: 228748

9 years agoProvide DIA implementation of DebugInfoPDB.
Zachary Turner [Tue, 10 Feb 2015 21:17:52 +0000 (21:17 +0000)]
Provide DIA implementation of DebugInfoPDB.

This implements DebugInfoPDB when the DIA SDK is present on the system.
Specifically, this means that the following conditions are met:
  1) You are building on Windows.
  2) You are building with MSVC.
  3) Visual Studio did not corrupt the installation of DIA due to a
     known issue with side-by-side installations of VS2012 and VS2013.
If all of these conditions are true, you will be able to pass a value
of PDB_Reader::DIA to PDB::createPdbReader().

There are no tests for this yet, as any test will be in the form of a
lit test which tests the llvm-pdbdump.exe, which still needs to be
rewritten in terms of this library.

llvm-svn: 228747

9 years agoReformat (and remove some tabs) to make debugging this code a
Eric Christopher [Tue, 10 Feb 2015 21:15:06 +0000 (21:15 +0000)]
Reformat (and remove some tabs) to make debugging this code a
little easier to step through.

llvm-svn: 228746

9 years agoNow use the __debugbreak intrinsic instead of calling RaiseException; it requires...
Aaron Ballman [Tue, 10 Feb 2015 21:13:04 +0000 (21:13 +0000)]
Now use the __debugbreak intrinsic instead of calling RaiseException; it requires no forward declares and still calls VEH.

llvm-svn: 228745

9 years agoFix 'process launch -i' for remote processes
Vince Harron [Tue, 10 Feb 2015 21:09:04 +0000 (21:09 +0000)]
Fix 'process launch -i' for remote processes

We want to forward stdin when stdio is not disabled and when we're not
redirecting stdin from a file.

renamed m_stdio_disable to m_stdin_forward and inverted value because
that's what we want to remember.

There was previously a bug that if you redirected stdin from a file,
stdout and stderr would also be redirected to /dev/null

Adds support for remote target to TestProcessIO.py

Fixes ProcessIOTestCase.test_stdin_redirection_with_dwarf for remote
Linux targets

llvm-svn: 228744

9 years agoDriver: move non-positional parameters out of switch. NFC.
Rui Ueyama [Tue, 10 Feb 2015 20:57:43 +0000 (20:57 +0000)]
Driver: move non-positional parameters out of switch. NFC.

llvm-svn: 228743

9 years agoFix overly prescriptive test that broken on Mac after r228725.
Daniel Jasper [Tue, 10 Feb 2015 20:49:05 +0000 (20:49 +0000)]
Fix overly prescriptive test that broken on Mac after r228725.

llvm-svn: 228742

9 years agofix docs typo
Nico Weber [Tue, 10 Feb 2015 20:43:54 +0000 (20:43 +0000)]
fix docs typo

llvm-svn: 228741

9 years agoFix ASan's Noinst unit tests
Kuba Brecka [Tue, 10 Feb 2015 20:37:57 +0000 (20:37 +0000)]
Fix ASan's Noinst unit tests

We currently skip all "Noinst" unit tests on OS X, which was probably caused when we removed the "allow_reexec" flag. The MaybeReexec function fails to re-execute when the runtime is linked statically, because there is no dylib to use. This patch adds an explicit DisableReexec function that is used from asan_noinst_test.cc and the runtime then doesn't try to re-execute.

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

llvm-svn: 228740

9 years ago[PowerPC] Remove the --no-tls-optimize workaround from the clang driver
Bill Schmidt [Tue, 10 Feb 2015 20:36:08 +0000 (20:36 +0000)]
[PowerPC] Remove the --no-tls-optimize workaround from the clang driver

llvm-svn: 228739

9 years agoChanging the status code generated by LLVM_BUILTIN_TRAP on Windows to be something...
Aaron Ballman [Tue, 10 Feb 2015 20:13:52 +0000 (20:13 +0000)]
Changing the status code generated by LLVM_BUILTIN_TRAP on Windows to be something categorized as a valid error code. Fixes crashing uses (such as not --crash) with existing sys::Wait behavior.

llvm-svn: 228738

9 years ago[analyzer] Pass actual state to alloc/dealloc handling functions.
Anton Yartsev [Tue, 10 Feb 2015 20:13:08 +0000 (20:13 +0000)]
[analyzer] Pass actual state to alloc/dealloc handling functions.

The state obtained from CheckerContext::getState() may be outdated by the time the alloc/dealloc handling function is called (e.g. the state was modified but the transition was not performed). State argument was added to all alloc/dealloc handling functions in order to get the latest state and to allow sequential calls to those functions.

llvm-svn: 228737

9 years agoFixed memory corruption problem.
Andrey Churbanov [Tue, 10 Feb 2015 20:10:21 +0000 (20:10 +0000)]
Fixed memory corruption problem.

llvm-svn: 228736

9 years agoCheck for backtraces in tests which are verifying pretty stack traces from a crashing...
Pete Cooper [Tue, 10 Feb 2015 19:53:38 +0000 (19:53 +0000)]
Check for backtraces in tests which are verifying pretty stack traces from a crashing clang.

PrettyStackTrace now requires the ENABLE_BACKTRACES option.  We need to check for that here or these tests fail llvm-lit.

Reviewed by chandlerc

llvm-svn: 228735

9 years agoUpdated the kmp_omp_struct_info_t structure used by debuggers.
Andrey Churbanov [Tue, 10 Feb 2015 19:53:13 +0000 (19:53 +0000)]
Updated the kmp_omp_struct_info_t structure used by debuggers.

llvm-svn: 228734

9 years agoAdding support for llvm.eh.begincatch and llvm.eh.endcatch intrinsics and beginning...
Andrew Kaylor [Tue, 10 Feb 2015 19:52:43 +0000 (19:52 +0000)]
Adding support for llvm.eh.begincatch and llvm.eh.endcatch intrinsics and beginning the documentation of native Windows exception handling.

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

llvm-svn: 228733

9 years ago[UBSan] Reduce the number of getCallerLocation() calls.
Alexey Samsonov [Tue, 10 Feb 2015 19:50:20 +0000 (19:50 +0000)]
[UBSan] Reduce the number of getCallerLocation() calls.

getCallerLocation() is expensive as it issues a call to symbolizer.
(In fact, this function has a memory leak at the moment, but this
will be fixed in the nearest future). We should only call it if
we're actually going to print an error report, in particular,
once for every reported source location.

__ubsan_handle_type_mismatch: call getCallerLocation() only if
provided source location is invalid, and only if the report is not
deduplicated.

__ubsan_handle_float_cast_overflow: call getSourceLocation with
correct CallerPC (the one in user code, not in UBSan handler). Source
location for this check is not currently emitted by frontend.

llvm-svn: 228732

9 years agoDeadArgElim: arguments affect all returned sub-values by default.
Tim Northover [Tue, 10 Feb 2015 19:49:18 +0000 (19:49 +0000)]
DeadArgElim: arguments affect all returned sub-values by default.

Unless we meet an insertvalue on a path from some value to a return, that value
will be live if *any* of the return's components are live, so all of those
components must be added to the MaybeLiveUses.

Previously we were deleting arguments if sub-value 0 turned out to be dead.

llvm-svn: 228731

9 years agoOpenMP 4.0 standard function omp_is_initial_device() implemented.
Andrey Churbanov [Tue, 10 Feb 2015 19:47:09 +0000 (19:47 +0000)]
OpenMP 4.0 standard function omp_is_initial_device() implemented.

llvm-svn: 228730

9 years agoDon't crash when evaluating a DWARF expression has a DW_OP_bra with nothing on the...
Greg Clayton [Tue, 10 Feb 2015 19:43:15 +0000 (19:43 +0000)]
Don't crash when evaluating a DWARF expression has a DW_OP_bra with nothing on the value stack.

<rdar://problem/18919125>

llvm-svn: 228729

9 years agoFix up r228725, missed change in PPCSubtarget definition
Bill Schmidt [Tue, 10 Feb 2015 19:31:55 +0000 (19:31 +0000)]
Fix up r228725, missed change in PPCSubtarget definition

llvm-svn: 228728

9 years agoAdded comment on format of local labels in asm code
Andrey Churbanov [Tue, 10 Feb 2015 19:31:17 +0000 (19:31 +0000)]
Added comment on format of local labels in asm code

llvm-svn: 228727

9 years agoIR: Add MDNode::replaceWithPermanent()
Duncan P. N. Exon Smith [Tue, 10 Feb 2015 19:13:46 +0000 (19:13 +0000)]
IR: Add MDNode::replaceWithPermanent()

Add new API for converting temporaries that may self-reference.
Self-referencing nodes are not allowed to be uniqued, so sending them
into `replaceWithUniqued()` is dangerous (and this commit adds
assertions that prevent it).

`replaceWithPermanent()` has similar semantics to `get()` followed by
calls to `replaceOperandWith()`.  In particular, if there's a
self-reference, it returns a distinct node; otherwise, it returns a
uniqued one.  Like `replaceWithUniqued()` and `replaceWithDistinct()`
(well, it calls out to them) it mutates the temporary node in place if
possible, only calling `replaceAllUsesWith()` on a uniquing collision.

llvm-svn: 228726

9 years ago[PowerPC] Fix reverted patch r227976 to avoid register assignment issues
Bill Schmidt [Tue, 10 Feb 2015 19:09:05 +0000 (19:09 +0000)]
[PowerPC] Fix reverted patch r227976 to avoid register assignment issues

See full discussion in http://reviews.llvm.org/D7491.

We now hide the add-immediate and call instructions together in a
separate pseudo-op, which is tagged to define GPR3 and clobber the
call-killed registers.  The PPCTLSDynamicCall pass prior to RA now
expands this op into the two separate addi and call ops, with explicit
definitions of GPR3 on both instructions, and explicit clobbers on the
call instruction.  The pass is now marked as requiring and preserving
the LiveIntervals and SlotIndexes analyses, and fixes these up after
the replacement sequences are introduced.

Self-hosting has been verified on LE P8 and BE P7 with various
optimization levels, etc.  It has also been verified with the
--no-tls-optimize flag workaround removed.

llvm-svn: 228725

9 years agoX86: Emit Win64 SaveXMM opcodes at the right offset in the right order
David Majnemer [Tue, 10 Feb 2015 19:01:47 +0000 (19:01 +0000)]
X86: Emit Win64 SaveXMM opcodes at the right offset in the right order

Walk the instructions marked FrameSetup and consider any stores of XMM
registers to the stack as needing a SaveXMM opcode.

This fixes PR22521.

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

llvm-svn: 228724

9 years agoUse override rather than virtual.
Rui Ueyama [Tue, 10 Feb 2015 18:59:37 +0000 (18:59 +0000)]
Use override rather than virtual.

llvm-svn: 228723

9 years agoGNU: Use StringRef::empty instead of a boolean flag.
Rui Ueyama [Tue, 10 Feb 2015 18:55:39 +0000 (18:55 +0000)]
GNU: Use StringRef::empty instead of a boolean flag.

This local variable name did not follow the style guide,
and it is not actually needed.

llvm-svn: 228722

9 years agoAdded CFI directives to asm code in order to have correct backtraces in gdb.
Andrey Churbanov [Tue, 10 Feb 2015 18:51:52 +0000 (18:51 +0000)]
Added CFI directives to asm code in order to have correct backtraces in gdb.

llvm-svn: 228721

9 years agoMake ABI header not found a warning, not an error.
Dan Albert [Tue, 10 Feb 2015 18:46:57 +0000 (18:46 +0000)]
Make ABI header not found a warning, not an error.

Since we've added a new header to libc++abi (__cxxabi_config.h), we
now have a case where we might not always find all the ABI headers:
building libc++ against the system's libc++abi on Darwin.

Since this isn't actually a fatal error, degrade it to a warning.

llvm-svn: 228720

9 years ago[PowerPC] Support the (old) cntlz instruction alias
Hal Finkel [Tue, 10 Feb 2015 18:45:02 +0000 (18:45 +0000)]
[PowerPC] Support the (old) cntlz instruction alias

Some old assembly code uses the cntlz alias for cntlzw, binutils supports this,
and we should too. Fixes PR22519.

llvm-svn: 228719

9 years agoThe usage of tt_state flag is replaced by an array of two task_team pointers.
Andrey Churbanov [Tue, 10 Feb 2015 18:37:43 +0000 (18:37 +0000)]
The usage of tt_state flag is replaced by an array of two task_team pointers.

llvm-svn: 228718

9 years agoDriver: use hasArg instead of getLastArg if return value is not used.
Rui Ueyama [Tue, 10 Feb 2015 18:34:46 +0000 (18:34 +0000)]
Driver: use hasArg instead of getLastArg if return value is not used.

llvm-svn: 228717

9 years agoFailsafe directory for shared objects and support executables.
Chaoren Lin [Tue, 10 Feb 2015 18:30:34 +0000 (18:30 +0000)]
Failsafe directory for shared objects and support executables.

llvm-svn: 228716

9 years agoAdding x86 to supported architectures on x86_64.
Chaoren Lin [Tue, 10 Feb 2015 18:30:31 +0000 (18:30 +0000)]
Adding x86 to supported architectures on x86_64.

llvm-svn: 228715

9 years agoFix build on Windows which was broken by a recent commit.
Hafiz Abid Qadeer [Tue, 10 Feb 2015 18:12:44 +0000 (18:12 +0000)]
Fix build on Windows which was broken by a recent commit.
This file MICmnStreamStdinLinux.cpp is wrongly added in the windows build.
It has no use there. CMakeList.txt for lldb-mi needs to be re-factored to
include the right file for each build. This is quick fix to un-break the build.

llvm-svn: 228714