platform/upstream/llvm.git
9 years agoSpeculative fix for the broken bots.
Chris Bieneman [Thu, 25 Jun 2015 20:50:46 +0000 (20:50 +0000)]
Speculative fix for the broken bots.

llvm-svn: 240693

9 years ago[msan] Teach sanitizers about the PPC64 ptrace syscall
Jay Foad [Thu, 25 Jun 2015 20:50:18 +0000 (20:50 +0000)]
[msan] Teach sanitizers about the PPC64 ptrace syscall

Summary:
This fixes test/msan/Linux/syscalls.cc, and should also fix the ppc64
sanitizer buildbots which are currently failing in
"make check-sanitizer".

Reviewers: samsonov, wschmidt, eugenis

Reviewed By: eugenis

Subscribers: llvm-commits

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

llvm-svn: 240692

9 years ago[modules] Fix findDirectiveAtLoc to not call a member function on a null pointer.
Richard Smith [Thu, 25 Jun 2015 20:48:44 +0000 (20:48 +0000)]
[modules] Fix findDirectiveAtLoc to not call a member function on a null pointer.

This is exercised by existing tests, and fixes a failure with -fsanitize=null.
No observable change otherwise; the code happened to do the right thing in
practice under recent versions of Clang and GCC because
MacroDirective::getDefinition happens to check whether this == null.

llvm-svn: 240691

9 years ago[msan] Fix SetShadow for mappings at the end of the application address space
Jay Foad [Thu, 25 Jun 2015 20:47:59 +0000 (20:47 +0000)]
[msan] Fix SetShadow for mappings at the end of the application address space

Summary:
On PPC64 if you disable ASLR (or run under gdb) you're likely to see
mmap returning a mapping right at the end of the application address
space region. This caused SetShadow to call MEM_TO_SHADOW() on the
last+1 address in the region, which seems wrong to me; how can
MEM_TO_SHADOW() distinguish this from the first address in the following
region?

Fixed by only calling MEM_TO_SHADOW() once, on the start address.

Reviewers: samsonov, wschmidt, eugenis

Reviewed By: eugenis

Subscribers: llvm-commits

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

llvm-svn: 240690

9 years agoEnable ISL's small integer optimization
Michael Kruse [Thu, 25 Jun 2015 20:47:35 +0000 (20:47 +0000)]
Enable ISL's small integer optimization

Summary:
With small integer optimization (short: sio) enabled, ISL uses 32 bit
integers for its arithmetic and only falls back to a big integer library
(in the case of Polly: IMath) if an operation's result is too large.
This gives a massive performance boost for most application using ISL.
For instance, experiments with ppcg (polyhedral source-to-source
compiler) show speed-ups of 5.8 (compared to plain IMath), respectively
2.7 (compared to GMP).

In Polly, a smaller fraction of the total compile time is taken by ISL,
but the speed-ups are still very significant. The buildbots measure
compilation speed-up up to 1.8 (oourafft, floyd-warshall, symm). All
Polybench benchmarks compile in at least 9% less time, and about 20%
less on average.

Detailed Polybench compile time results (median of 10):
correlation     -25.51%
covariance      -24.82%
2mm             -26.64%
3mm             -28.69%
atax            -13.70%
bicg            -10.78%
cholesky        -40.67%
doitgen         -11.60%
gemm            -11.54%
gemver          -10.63%
gesummv         -11.54%
mvt              -9.43%
symm            -41.25%
syr2k           -14.71%
syrk            -14.52%
trisolv         -17.65%
trmm             -9.78%
durbin          -19.32%
dynprog          -9.09%
gramschmidt     -15.38%
lu              -21.77%
floyd-warshall  -42.71%
reg_detect      -41.17%
adi             -36.69%
fdtd-2d         -32.61%
fdtd-apml       -21.90%
jacobi-1d-imper  -9.41%
jacobi-2d-imper -27.65%
seidel-2d       -31.00%

Reviewers: grosser

Reviewed By: grosser

Subscribers: Meinersbur, llvm-commits, pollydev

Projects: #polly

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

llvm-svn: 240689

9 years ago[Sanitizer] Set minimum supported Mac OS X version to 10.9, if it wasn't specified...
Alexey Samsonov [Thu, 25 Jun 2015 20:43:35 +0000 (20:43 +0000)]
[Sanitizer] Set minimum supported Mac OS X version to 10.9, if it wasn't specified explicitly.

-fsanitize=vptr is a UBSan feature that doesn't work on older Mac OS X
versions, and we don't want to penalize users that use modern OS with
default configuration. Those who want to target older OS versions, can
specify that versions explicitly.

llvm-svn: 240688

9 years agotsan: fix handling of dup2
Dmitry Vyukov [Thu, 25 Jun 2015 20:32:04 +0000 (20:32 +0000)]
tsan: fix handling of dup2

Previously tsan modelled dup2(oldfd, newfd) as write on newfd.
We hit several cases where the write lead to false positives:
1. Some software dups a closed pipe in place of a socket before closing
   the socket (to prevent races actually).
2. Some daemons dup /dev/null in place of stdin/stdout.
On the other hand we have not seen cases when write here catches real bugs.
So model dup2 as read on newfd instead.

llvm-svn: 240687

9 years agoAdd -miphonesimulator-version-min as alias to -ios-simulator-version-min.
Chris Bieneman [Thu, 25 Jun 2015 20:25:43 +0000 (20:25 +0000)]
Add -miphonesimulator-version-min as alias to -ios-simulator-version-min.

Summary:
For better or worse the OS X command line tools refer to the iOS simulator as iphonesimucator. We should provide an alias flag -miphonesimulator-version-min that matches a consistent pattern with the other tools.

This is in the interest of making it easier for people to write platform-agnostic darwin build scripts.

Reviewers: bob.wilson, bogner

Subscribers: cfe-commits

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

llvm-svn: 240686

9 years ago[clang-fuzzer] Update clang-fuzzer to API change in r240225.
Alexey Samsonov [Thu, 25 Jun 2015 20:21:59 +0000 (20:21 +0000)]
[clang-fuzzer] Update clang-fuzzer to API change in r240225.

llvm-svn: 240685

9 years agoWe don't need the targets to read objects.
Rafael Espindola [Thu, 25 Jun 2015 20:20:19 +0000 (20:20 +0000)]
We don't need the targets to read objects.

llvm-svn: 240684

9 years ago[InstCombine] call SimplifyICmpInst with correct context
Jingyue Wu [Thu, 25 Jun 2015 20:14:47 +0000 (20:14 +0000)]
[InstCombine] call SimplifyICmpInst with correct context

Summary:
Fixes PR23809. Without passing the context to SimplifyICmpInst, we would
use the assume to prove that the condition feeding the assume is
trivially true (see isValidAssumeForContext in ValueTracking.cpp),
causing the removal of the assume which may be useful for later
optimizations.

Test Plan: pr23800.ll

Reviewers: hfinkel, majnemer

Reviewed By: hfinkel

Subscribers: henryhu, llvm-commits, wengxt, broune, meheff, eliben

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

llvm-svn: 240683

9 years agoCOFF: Remove dead code.
Rui Ueyama [Thu, 25 Jun 2015 20:12:15 +0000 (20:12 +0000)]
COFF: Remove dead code.

llvm-svn: 240682

9 years agoDiagnose undefined temporary symbols.
Rafael Espindola [Thu, 25 Jun 2015 20:10:45 +0000 (20:10 +0000)]
Diagnose undefined temporary symbols.

We already disallowed

.global .Lfoo

so this is reasonable.

This is a small cherry pick from r240130.

llvm-svn: 240681

9 years agoRename local variable CCCPrintActions -> CCCPrintPhases.
Douglas Katzman [Thu, 25 Jun 2015 19:37:41 +0000 (19:37 +0000)]
Rename local variable CCCPrintActions -> CCCPrintPhases.

To match the '-ccc-print-phases' command-line flag.
Also make two more 'for' loops range-based. NFC

llvm-svn: 240680

9 years agoMake this test verify .debug_pubnames is actually missing.
Paul Robinson [Thu, 25 Jun 2015 19:37:13 +0000 (19:37 +0000)]
Make this test verify .debug_pubnames is actually missing.
It was matching at EOF regardless of whether the section was present.

llvm-svn: 240679

9 years agoRangify for loop in Inliner.cpp. NFC.
Yaron Keren [Thu, 25 Jun 2015 19:28:24 +0000 (19:28 +0000)]
Rangify for loop in Inliner.cpp. NFC.

llvm-svn: 240678

9 years agoFix a bug where we were trying to reconstruct ivars of ObjC types from the runtime...
Enrico Granata [Thu, 25 Jun 2015 19:17:04 +0000 (19:17 +0000)]
Fix a bug where we were trying to reconstruct ivars of ObjC types from the runtime in "expression parser mode"

The expression parser mode allows UnknownAnyTy to make it all the way through, but that is bad for ivars because it means type layout fails horribly (as in, clang crashes)

This patch fixes the issue by using the "variables view mode", which masks UnknownAnyTy as empty-type, and pointer-to UnknownAnyTy as void*

This, in turn, allows LLDB to properly reconstruct ivars of IMP type in ObjC type - as per accompanying test case

Fixes rdar://21471326

llvm-svn: 240677

9 years agoAdd const qualifier to Mangled::GuessLanguage
Dawn Perchik [Thu, 25 Jun 2015 19:14:34 +0000 (19:14 +0000)]
Add const qualifier to Mangled::GuessLanguage

llvm-svn: 240676

9 years agoCOFF: Devirtualize mark(), markLive() and isCOMDAT().
Rui Ueyama [Thu, 25 Jun 2015 19:10:58 +0000 (19:10 +0000)]
COFF: Devirtualize mark(), markLive() and isCOMDAT().

Only SectionChunk can be dead-stripped. Previously,
all types of chunks implemented these functions,
but their functions were blank.

Likewise, only DefinedRegular and DefinedCOMDAT symbols
can be dead-stripped. markLive() function was implemented
for other symbol types, but they were blank.

I started thinking that the change I made in r240319 was
a mistake. I separated DefinedCOMDAT from DefinedRegular
because I thought that would make the code cleaner, but now
we want to handle them as the same type here. Maybe we
should roll it back.

This change should improve readability a bit as this removes
some dubious uses of reinterpret_cast. Previously, we
assumed that all COMDAT chunks are actually SectionChunks,
which was not very obvious.

llvm-svn: 240675

9 years agoUse more range-based for loops
Douglas Katzman [Thu, 25 Jun 2015 18:51:37 +0000 (18:51 +0000)]
Use more range-based for loops

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

llvm-svn: 240674

9 years agoAdd Arg::getValues method with const 'this' and const result
Douglas Katzman [Thu, 25 Jun 2015 18:48:26 +0000 (18:48 +0000)]
Add Arg::getValues method with const 'this' and const result

llvm-svn: 240673

9 years agoDAGCombiner: Remove redundant check
Matt Arsenault [Thu, 25 Jun 2015 18:47:02 +0000 (18:47 +0000)]
DAGCombiner: Remove redundant check

MemIntrinsicSDNode is already a subclass of MemSDNode,
so the MemSDNode check is sufficient.

llvm-svn: 240672

9 years ago[CFI] Run tests that use cfi diagnostic mode only if cxxabi parts of UBSan are available.
Alexey Samsonov [Thu, 25 Jun 2015 18:45:30 +0000 (18:45 +0000)]
[CFI] Run tests that use cfi diagnostic mode only if cxxabi parts of UBSan are available.

llvm-svn: 240671

9 years agoGVN: If a branch has two identical successors, we cannot declare either dead.
Peter Collingbourne [Thu, 25 Jun 2015 18:32:02 +0000 (18:32 +0000)]
GVN: If a branch has two identical successors, we cannot declare either dead.

This previously caused miscompilations as a result of phi nodes receiving
undef incoming values from blocks dominated by such successors.

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

llvm-svn: 240670

9 years ago[CUDA] Implemented __nvvm_atom_*_gen_* builtins.
Artem Belevich [Thu, 25 Jun 2015 18:29:42 +0000 (18:29 +0000)]
[CUDA] Implemented __nvvm_atom_*_gen_* builtins.

Integer variants are implemented as atomicrmw or cmpxchg instructions.
Atomic add for floating point (__nvvm_atom_add_gen_f()) is implemented
as a call to an overloaded @llvm.nvvm.atomic.load.add.f32.* LVVM
intrinsic.

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

llvm-svn: 240669

9 years ago[sanitizer] Disable signal_segv_handler test.
Evgeniy Stepanov [Thu, 25 Jun 2015 18:23:58 +0000 (18:23 +0000)]
[sanitizer] Disable signal_segv_handler test.

Random failures on the bots.

llvm-svn: 240668

9 years agoCOFF: Simplify. NFC.
Rui Ueyama [Thu, 25 Jun 2015 17:56:36 +0000 (17:56 +0000)]
COFF: Simplify. NFC.

llvm-svn: 240666

9 years agoCOFF: Use std::equal to compare two lists of relocations.
Rui Ueyama [Thu, 25 Jun 2015 17:51:07 +0000 (17:51 +0000)]
COFF: Use std::equal to compare two lists of relocations.

llvm-svn: 240665

9 years agoOmit 'nodebug' methods from the class description.
Paul Robinson [Thu, 25 Jun 2015 17:50:43 +0000 (17:50 +0000)]
Omit 'nodebug' methods from the class description.

llvm-svn: 240664

9 years agoSubmitting patch from Abhishek for:
Greg Clayton [Thu, 25 Jun 2015 17:50:15 +0000 (17:50 +0000)]
Submitting patch from Abhishek for:

http://reviews.llvm.org/D10309

llvm-svn: 240663

9 years agoRename Mangled::GetLanguage to Mangled::GuessLanguage
Dawn Perchik [Thu, 25 Jun 2015 17:45:53 +0000 (17:45 +0000)]
Rename Mangled::GetLanguage to Mangled::GuessLanguage

The language can not be definitively determined from the mangling, so
this new name helps clarify that fact.  This addresses the concerns raised
in http://reviews.llvm.org/rL226962.
Reviewed by: clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D10723

llvm-svn: 240662

9 years agoCOFF: Don't use COFFHeader->NumberOfRelocations.
Rui Ueyama [Thu, 25 Jun 2015 17:43:37 +0000 (17:43 +0000)]
COFF: Don't use COFFHeader->NumberOfRelocations.

The size of the field is 16 bit, so it's inaccurate if the
number of relocations in a section is more than 65535.

llvm-svn: 240661

9 years agoAdd const versions of SBFrame::GetFunctionName and SBFrame::IsInlined.
Oleksiy Vyalov [Thu, 25 Jun 2015 17:41:41 +0000 (17:41 +0000)]
Add const versions of SBFrame::GetFunctionName and SBFrame::IsInlined.

http://reviews.llvm.org/D10711

llvm-svn: 240660

9 years ago[NVPTX] Fixed a typo in __nvvm_atom_min_gen_l() type string.
Artem Belevich [Thu, 25 Jun 2015 17:34:23 +0000 (17:34 +0000)]
[NVPTX] Fixed a typo in __nvvm_atom_min_gen_l() type string.

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

llvm-svn: 240659

9 years agoUpdate for llvm change.
Rafael Espindola [Thu, 25 Jun 2015 17:04:12 +0000 (17:04 +0000)]
Update for llvm change.

llvm-svn: 240658

9 years agoFix autotools build
Michael Kruse [Thu, 25 Jun 2015 16:50:13 +0000 (16:50 +0000)]
Fix autotools build

There were two issues:
* ISL's configure generates include/isl/stdint.h, not isl/stdint.h as
  assumed. This is also changed in the CMake build.

* Need to pass --with-int=imath to ISL's configure; the default is gmp.

Polly's configure has been regenerated due to changing configure.ac

llvm-svn: 240657

9 years agoAdd a test for a recent regression.
Rafael Espindola [Thu, 25 Jun 2015 16:16:08 +0000 (16:16 +0000)]
Add a test for a recent regression.

llvm-svn: 240656

9 years agollvm-nm: print 'n' instead of '?'
Rafael Espindola [Thu, 25 Jun 2015 16:01:53 +0000 (16:01 +0000)]
llvm-nm: print 'n' instead of '?'

This matches gnu nm and has the advantage that there is a upper case N.

llvm-svn: 240655

9 years agoFix #pragma redefine_extname when there is a local variable of the same name. The...
Aaron Ballman [Thu, 25 Jun 2015 15:37:16 +0000 (15:37 +0000)]
Fix #pragma redefine_extname when there is a local variable of the same name. The local should not be renamed, only the externally-available declaration should be.

Patch by Andrey Bokhanko!

llvm-svn: 240653

9 years agoUpdate TestPrintStackTraces XFAIL once more
Pavel Labath [Thu, 25 Jun 2015 15:25:30 +0000 (15:25 +0000)]
Update TestPrintStackTraces XFAIL once more

it seems the failure happens also with clang. The main thing which triggers the failure is
architecture.

llvm-svn: 240652

9 years agoFix TestThreadAPI on Linux
Tamas Berghammer [Thu, 25 Jun 2015 15:19:22 +0000 (15:19 +0000)]
Fix TestThreadAPI on Linux

On Linux malloc calls itself in some case. Change the test case to
handle this scenario.

llvm-svn: 240651

9 years ago[PPC] Implement vmrgew and vmrgow instructions
Kit Barton [Thu, 25 Jun 2015 15:17:40 +0000 (15:17 +0000)]
[PPC] Implement vmrgew and vmrgow instructions

This patch adds support for the vector merge even word and vector merge odd word
instructions introduced in POWER8.

Phabricator review: http://reviews.llvm.org/D10704

llvm-svn: 240650

9 years ago[AsmPrinter] Fix crash in handleIndirectSymViaGOTPCRel
Bruno Cardoso Lopes [Thu, 25 Jun 2015 15:17:23 +0000 (15:17 +0000)]
[AsmPrinter] Fix crash in handleIndirectSymViaGOTPCRel

Check for symbols in MCValue before using them. Bail out early in case
they are null. This fixes PR23779.

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

rdar://problem/21532830

llvm-svn: 240649

9 years agoFix unw_getcontext() return value on AArch64.
Logan Chien [Thu, 25 Jun 2015 15:12:46 +0000 (15:12 +0000)]
Fix unw_getcontext() return value on AArch64.

unw_getcontext() should return UNW_ESUCCESS on success.  Therefore, the
assembly for AArch64 is incorrect because "ldr x0, #0" is a PC-relative
load instead of an immediate value load.

llvm-svn: 240648

9 years agoDoxygen-ify a few comments. NFC
Jonathan Roelofs [Thu, 25 Jun 2015 15:06:47 +0000 (15:06 +0000)]
Doxygen-ify a few comments. NFC

llvm-svn: 240647

9 years agoUse computeSymbolSizes in llvm-symbolize.
Rafael Espindola [Thu, 25 Jun 2015 15:06:38 +0000 (15:06 +0000)]
Use computeSymbolSizes in llvm-symbolize.

llvm-svn: 240646

9 years agoUse range loop. NFC.
Rafael Espindola [Thu, 25 Jun 2015 15:00:38 +0000 (15:00 +0000)]
Use range loop. NFC.

llvm-svn: 240645

9 years agoModernize getELFDynamicSymbolIterators.
Rafael Espindola [Thu, 25 Jun 2015 14:39:35 +0000 (14:39 +0000)]
Modernize getELFDynamicSymbolIterators.

* Have it return a iterator_range.
* Remove the global function.
* Rename to getDynamicSymbolIterators.

llvm-svn: 240644

9 years agoFix a crash by division by zero in analyzer
Daniel Marjamaki [Thu, 25 Jun 2015 14:06:02 +0000 (14:06 +0000)]
Fix a crash by division by zero in analyzer

Patch by takeshi-yoshimura!

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

llvm-svn: 240643

9 years agoDon't use std::make_unique.
Benjamin Kramer [Thu, 25 Jun 2015 13:47:36 +0000 (13:47 +0000)]
Don't use std::make_unique.

We still have to support C++11 standard libraries, make_unique is a C++14
feature.

llvm-svn: 240642

9 years ago[PPC] Replace debug value skipping with getLastNonDebugInstr.
Benjamin Kramer [Thu, 25 Jun 2015 13:39:03 +0000 (13:39 +0000)]
[PPC] Replace debug value skipping with getLastNonDebugInstr.

No functionality change intended.

llvm-svn: 240641

9 years ago[ORC] Add ObjectTransformLayer
Joseph Tremoulet [Thu, 25 Jun 2015 13:35:22 +0000 (13:35 +0000)]
[ORC] Add ObjectTransformLayer

Summary:
This is a utility for clients that want to insert a layer that modifies
each ObjectFile and then passes it along to the next layer.

Reviewers: lhames

Reviewed By: lhames

Subscribers: llvm-commits

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

llvm-svn: 240640

9 years agoReplace copy-pasted debug value skipping with MBB::getLastNonDebugInstr
Benjamin Kramer [Thu, 25 Jun 2015 13:28:24 +0000 (13:28 +0000)]
Replace copy-pasted debug value skipping with MBB::getLastNonDebugInstr

No functional change intended.

llvm-svn: 240639

9 years agoEnable TestInferiorCrashing and TestRecursiveInferior on android
Pavel Labath [Thu, 25 Jun 2015 12:57:35 +0000 (12:57 +0000)]
Enable TestInferiorCrashing and TestRecursiveInferior on android

Summary:
the original bug was fixed (a rogue breakpoint messing up inferior data structures) and the tests
seems to pass now. Since android has a default SEGV handler, I have had to alter the test
expectation in this case.

Test Plan: Tests pass on android arm.

Reviewers: tberghammer

Subscribers: tberghammer, aemerson, lldb-commits

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

llvm-svn: 240638

9 years ago[mips] [IAS] Refactor the emitDirectiveModuleFP() functions. NFC.
Toma Tabacu [Thu, 25 Jun 2015 12:44:38 +0000 (12:44 +0000)]
[mips] [IAS] Refactor the emitDirectiveModuleFP() functions. NFC.

Summary:
Simplify emitDirectiveModuleFP() by having it just print the current information
from MipsABIFlagsSection and doing an updateABIInfo() before such calls.

This prevents us from forgetting to update the STI.FeatureBits,
because updateABIInfo() uses those to update the MipsABIFlagsSection object,
and also makes sure we use the update mechanism from MipsABIFlagsSection.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits, mpf

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

llvm-svn: 240637

9 years agoTake alignment into account in isSafeToLoadUnconditionally
Artur Pilipenko [Thu, 25 Jun 2015 12:18:43 +0000 (12:18 +0000)]
Take alignment into account in isSafeToLoadUnconditionally

Reviewed By: hfinkel

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

llvm-svn: 240636

9 years agoMake XFAIL on TestPrintStackTraces more specific
Pavel Labath [Thu, 25 Jun 2015 12:16:50 +0000 (12:16 +0000)]
Make XFAIL on TestPrintStackTraces more specific

the thread creation failure was fixed, but a backtracing problem remains in some situations.

llvm-svn: 240635

9 years ago[SystemZ] Only attempt RxSBG optimization for integer types
Ulrich Weigand [Thu, 25 Jun 2015 11:52:36 +0000 (11:52 +0000)]
[SystemZ] Only attempt RxSBG optimization for integer types

As pointed out by Justin Bogner (see r240520), SystemZDAGToDAGISel::Select
currently attempts to convert boolean operations into RxSBG even on some
non-integer types (in particular, vector types).  This would not work in
any case, and it happened to trigger undefined behaviour in allOnes.

This patch verifies that we have a (<= 64-bit) integer type before
attempting to perform this optimization.

llvm-svn: 240634

9 years agotsan: merge function definition and declaration
Dmitry Vyukov [Thu, 25 Jun 2015 11:45:45 +0000 (11:45 +0000)]
tsan: merge function definition and declaration

llvm-svn: 240633

9 years agoRemove XFAIL from TestCreateAfterAttach
Pavel Labath [Thu, 25 Jun 2015 11:29:26 +0000 (11:29 +0000)]
Remove XFAIL from TestCreateAfterAttach

The tested functionality is implemented now. The test remains XTIMEOUTed, because it times out
occasionally, probably due to test suite deficiencies.

llvm-svn: 240632

9 years agoExpand result with type char* to string in -data-evaluate-expression
Ilia K [Thu, 25 Jun 2015 11:10:12 +0000 (11:10 +0000)]
Expand result with type char* to string in -data-evaluate-expression

Summary:
Expand result with type char* to string in -data-evaluate-expression.
was:
  ```
    -data-evaluate-expression str
    ^done,value="0x00007fffffffece0"
  ```
now:
  ```
    -data-evaluate-expression str
    ^done,value="0x00007fffffffece0 \"hello\""
  ```

All tests pass on Linux.

Test Plan: ./dotest.py -v --executable $BUILDDIR/bin/lldb tools/lldb-mi

Reviewers: abidh

Reviewed By: abidh

Subscribers: lldb-commits, dawn, abidh

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

llvm-svn: 240631

9 years ago[mips] [IAS] Refactor the emitDirectiveModuleOddSPReg() functions. NFC.
Toma Tabacu [Thu, 25 Jun 2015 10:56:57 +0000 (10:56 +0000)]
[mips] [IAS] Refactor the emitDirectiveModuleOddSPReg() functions. NFC.

Summary:
We can simplify emitDirectiveModuleOddSPReg() by having it print the current OddSPReg information
from MipsABIFlagsSection and doing an updateABIInfo() before such calls.

This prevents us from forgetting to update the STI.FeatureBits, because updateABIInfo() uses those to update the MipsABIFlagsSection object,
and also makes sure we use the update mechanism from MipsABIFlagsSection.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits, mpf

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

llvm-svn: 240630

9 years agoAdd missing <array> include.
Pawel Bylica [Thu, 25 Jun 2015 10:47:08 +0000 (10:47 +0000)]
Add missing <array> include.

llvm-svn: 240629

9 years agoTeach Clang about the PPC64 memory sanitizer implementation.
Jay Foad [Thu, 25 Jun 2015 10:35:19 +0000 (10:35 +0000)]
Teach Clang about the PPC64 memory sanitizer implementation.

Summary:
This is the Clang part of the PPC64 memory sanitizer implementation in
D10648.

Reviewers: kcc, eugenis, willschm, wschmidt, samsonov

Reviewed By: samsonov

Subscribers: cfe-commits

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

llvm-svn: 240628

9 years agoTeach LLVM about the PPC64 memory sanitizer implementation.
Jay Foad [Thu, 25 Jun 2015 10:34:29 +0000 (10:34 +0000)]
Teach LLVM about the PPC64 memory sanitizer implementation.

Summary:
This is the LLVM part of the PPC memory sanitizer implementation in
D10648.

Reviewers: kcc, samsonov, willschm, wschmidt, eugenis

Reviewed By: eugenis

Subscribers: llvm-commits

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

llvm-svn: 240627

9 years agoExpress APInt::{s,u}{l,g}e(uint64_t) in terms of APInt::{s,u}{l,g}t(uint64_t). NFC.
Pawel Bylica [Thu, 25 Jun 2015 10:23:52 +0000 (10:23 +0000)]
Express APInt::{s,u}{l,g}e(uint64_t) in terms of APInt::{s,u}{l,g}t(uint64_t). NFC.

This is preparation for http://reviews.llvm.org/D10655: Change APInt comparison with uint64_t.
Some unit tests added also.

llvm-svn: 240626

9 years ago[mips] [IAS] Fix parsing of memory offset expressions with parenthesis depth >1.
Toma Tabacu [Thu, 25 Jun 2015 09:52:02 +0000 (09:52 +0000)]
[mips] [IAS] Fix parsing of memory offset expressions with parenthesis depth >1.

Summary:
In an expression such as "(((a+b)+c)+d)", parseParenExpression() would only parse the "a+b)+c", which would result in an error later on in the parser.
This means that we can only parse one level of inner parentheses.

In order to fix this, I added a new function called parseParenExprOfDepth(), which parses a specified number of trailing parenthesis expressions
(except for the outermost parenthesis), and changed MipsAsmParser to use it in parseMemOffset instead of parseParenExpression().

Reviewers: dsanders, rafael

Reviewed By: dsanders, rafael

Subscribers: llvm-commits

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

llvm-svn: 240625

9 years agoclang-format: [Proto] Don't treat "operator" as keyword.
Daniel Jasper [Thu, 25 Jun 2015 08:38:46 +0000 (08:38 +0000)]
clang-format: [Proto] Don't treat "operator" as keyword.

Before:
  optional string operator= 1;

After:
  optional string operator = 1;

llvm-svn: 240624

9 years agoEnable memory sanitizer for PPC64
Jay Foad [Thu, 25 Jun 2015 06:22:31 +0000 (06:22 +0000)]
Enable memory sanitizer for PPC64

Summary:
This patch adds basic memory sanitizer support for PPC64. PR23219.

I have further patches ready to enable it in LLVM and Clang, and to fix
most of the many failing tests in check-msan.

Reviewers: kcc, willschm, samsonov, wschmidt, eugenis

Reviewed By: eugenis

Subscribers: wschmidt, llvm-commits

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

llvm-svn: 240623

9 years agoCOFF: Fix a bug of __imp_ symbol.
Rui Ueyama [Thu, 25 Jun 2015 03:31:47 +0000 (03:31 +0000)]
COFF: Fix a bug of __imp_ symbol.

The change I made in r240620 was not correct. If a symbol foo is
defined, and if you use __imp_foo, __imp_foo symbol is automatically
defined as a pointer (not just an alias) to foo.

Now that we need to create a chunk for automatically-created symbols.
I defined LocalImportChunk class for them.

llvm-svn: 240622

9 years agoxcode project file updates for the movement of the POSIX files into the FreeBSD proce...
Jason Molenda [Thu, 25 Jun 2015 03:03:47 +0000 (03:03 +0000)]
xcode project file updates for the movement of the POSIX files into the FreeBSD process subdir.

llvm-svn: 240621

9 years agoCOFF: Handle undefined symbols starting with __imp_ in a special way.
Rui Ueyama [Thu, 25 Jun 2015 02:21:44 +0000 (02:21 +0000)]
COFF: Handle undefined symbols starting with __imp_ in a special way.

MSVC linker is able to link an object file created from the following code.
Note that __imp_hello is not defined anywhere.

  void hello() { printf("Hello\n"); }
  extern void (*__imp_hello)();
  int main() { __imp_hello(); }

Function symbols exported from DLLs are automatically mangled by appending
__imp_ prefix, so they have two names (original one and with the prefix).
This "feature" seems to simulate that behavior even for non-DLL symbols.

This is in my opnion very odd feature. Even MSVC linker warns if you use this.
I'm adding that anyway for the sake of compatibiltiy.

llvm-svn: 240620

9 years agoUpdate darwin SDK version parsing to support OSX and simulator
Steven Wu [Thu, 25 Jun 2015 01:59:35 +0000 (01:59 +0000)]
Update darwin SDK version parsing to support OSX and simulator

This re-commits r226005 with a tweak. The origin attempt failed because
Darwin bot sets up SDKROOT and clang can deduce SDK version from them
after this patch. That broke many driver tests due to the change of
deployment target version. Now the tests should not complain after
r240574.

llvm-svn: 240619

9 years ago[UBSan] Allow to use -fsanitize=vptr only on Mac OS 10.9+
Alexey Samsonov [Thu, 25 Jun 2015 00:58:02 +0000 (00:58 +0000)]
[UBSan] Allow to use -fsanitize=vptr only on Mac OS 10.9+

See https://llvm.org/bugs/show_bug.cgi?id=23539 for why this
is necessary.

llvm-svn: 240618

9 years ago[CMake] Fix PR23539: Don't reference C++ ABI symbols prior to Mac OS 10.9.
Alexey Samsonov [Thu, 25 Jun 2015 00:57:42 +0000 (00:57 +0000)]
[CMake] Fix PR23539: Don't reference C++ ABI symbols prior to Mac OS 10.9.

Summary:
This patch implements step 1 from
https://llvm.org/bugs/show_bug.cgi?id=23539#c10

I'd appreciate if you could test it on Mac OS and verify that parts of UBSan
runtime that reference C++ ABI symbols are properly excluded, and fix ASan/UBSan
builds.

Test Plan: regression test suite

Reviewers: thakis, hans

Subscribers: llvm-commits, zaks.anna, kubabrecka

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

llvm-svn: 240617

9 years ago[X86] Accept hasAVX512() as well as hasFMA() when generating FMA.
Ahmed Bougacha [Thu, 25 Jun 2015 00:44:46 +0000 (00:44 +0000)]
[X86] Accept hasAVX512() as well as hasFMA() when generating FMA.

We don't always have FMA, for example when using 'clang -mavx512f'
without an explicit CPU.

Also check for an explicit +avx512f instead of CPUs in a couple
related tests.

llvm-svn: 240616

9 years ago[X86] Cleanup fma tests a little bit. NFC.
Ahmed Bougacha [Thu, 25 Jun 2015 00:40:25 +0000 (00:40 +0000)]
[X86] Cleanup fma tests a little bit. NFC.

Reformat, isolate 213->231 xform, actually --check-prefix CHECK,
and deduplicate the FMA intrinsic tests (FMA3 in AMD-land).

llvm-svn: 240615

9 years agoCOFF: Use COFFObjectFile::getRelocations(). NFC.
Rui Ueyama [Thu, 25 Jun 2015 00:33:38 +0000 (00:33 +0000)]
COFF: Use COFFObjectFile::getRelocations(). NFC.

llvm-svn: 240614

9 years agoEnable StackMap Serialization for COFF
Swaroop Sridhar [Thu, 25 Jun 2015 00:28:42 +0000 (00:28 +0000)]
Enable StackMap Serialization for COFF

Summary

This change turns on the emission of
__LLVM_Stackmaps section when generating COFF binaries.

Test Plan

Added a scenario to the test case:
test\CodeGen\X86\statepoint-stackmap-format.ll.

Code Review:

http://reviews.llvm.org/D10680

llvm-svn: 240613

9 years agoConsolidate and unify initializer list deduction
Hubert Tong [Thu, 25 Jun 2015 00:25:49 +0000 (00:25 +0000)]
Consolidate and unify initializer list deduction

Summary:
This patch reduces duplication in the template argument deduction code
for handling deduction from initializer lists in a function call. This
extends the fix for PR12119 to also apply to the case where the
corresponding parameter is a trailing parameter pack.

Test Plan:
A test for deduction from nested initializer lists where the
corresponding parameter is a trailing parameter pack is added in
`clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp`.

Reviewers: fraggamuffin, rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

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

llvm-svn: 240612

9 years ago[Concepts] Parsing of requires-clause in template-declaration
Hubert Tong [Thu, 25 Jun 2015 00:23:39 +0000 (00:23 +0000)]
[Concepts] Parsing of requires-clause in template-declaration

Summary:
This change implements parse-only acceptance of the optional
requires-clause in a template-declaration. Diagnostic testing is added
for cases where the grammar is ambiguous with the expectation that the
longest token sequence which matches the syntax of a
constraint-expression is consumed without backtracking.

Reviewers: faisalv, fraggamuffin, rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

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

llvm-svn: 240611

9 years agolibObject/COFF: Add a function to get pointers to relocation entries.
Rui Ueyama [Thu, 25 Jun 2015 00:07:39 +0000 (00:07 +0000)]
libObject/COFF: Add a function to get pointers to relocation entries.

llvm-svn: 240610

9 years agoAvoid C99 for-declaration statement in C files. (NFC)
Logan Chien [Thu, 25 Jun 2015 00:05:24 +0000 (00:05 +0000)]
Avoid C99 for-declaration statement in C files. (NFC)

To compile libunwind with gcc/g++ 4.9, it is required to avoid the
for-declaration statement from C99.

llvm-svn: 240609

9 years ago[ARM] The bits set in the variable HW_FP could get unset
Ranjeet Singh [Wed, 24 Jun 2015 23:39:25 +0000 (23:39 +0000)]
[ARM] The bits set in the variable HW_FP could get unset
when iterating through the Features vector if we don't
keep track of what's already been set. This could lead to
the macro __ARM_FP getting the wrong value. This patch
fixes this issue by keeping track of the bits that have
already been set in the loop.

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

llvm-svn: 240607

9 years agoHandle (or at least don't crash) trying to get the encoding for a bunch of new builti...
Enrico Granata [Wed, 24 Jun 2015 23:13:23 +0000 (23:13 +0000)]
Handle (or at least don't crash) trying to get the encoding for a bunch of new builtin types in clang trunk

llvm-svn: 240606

9 years agoCOFF: Cache raw pointers to relocation tables.
Rui Ueyama [Wed, 24 Jun 2015 23:03:17 +0000 (23:03 +0000)]
COFF: Cache raw pointers to relocation tables.

Getting an iterator to the relocation table is very hot operation
in the linker. We do that not only to apply relocations but also
to mark live sections and to do ICF.

libObject's interface is slow. By caching pointers to the first
relocation table entries makes the linker 6% faster to self-link.

We probably need to fix libObject as well.

llvm-svn: 240603

9 years agoupdate comment
Derek Schuff [Wed, 24 Jun 2015 22:36:38 +0000 (22:36 +0000)]
update comment

llvm-svn: 240601

9 years agoRelax assertion in x86_64 byval argument handling for 32-bit pointers
Derek Schuff [Wed, 24 Jun 2015 22:36:36 +0000 (22:36 +0000)]
Relax assertion in x86_64 byval argument handling for 32-bit pointers

Summary:
Byval argument pair formation assumes that if a type is less than 8 bytes
it must be an integer and not a pointer, which is not true for x32 and NaCl.

Relax the assertion and add a test for a codegen case that triggered it.

Reviewers: jvoung

Subscribers: jfb, cfe-commits

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

llvm-svn: 240600

9 years agoAdd simplify_type<const WeakVH>; simplify IndVarSimplify
Duncan P. N. Exon Smith [Wed, 24 Jun 2015 22:23:21 +0000 (22:23 +0000)]
Add simplify_type<const WeakVH>; simplify IndVarSimplify

r240214 fixed some UB in IndVarSimplify, and it needed a temporary
`WeakVH` to do it.  Add `simplify_type<const WeakVH>` so that this
temporary isn't necessary.

llvm-svn: 240599

9 years ago[X86] Simplify some stuff in X86DisassemblerDecoder. NFC
Douglas Katzman [Wed, 24 Jun 2015 22:04:55 +0000 (22:04 +0000)]
[X86] Simplify some stuff in X86DisassemblerDecoder. NFC

- Deciding that insn->sibIndex is SIB_INDEX_NONE does not require another
check beyond the fully decoded bits being equal to 0x4.
The expression insn->sibIndex == SIB_INDEX_sib could not have been true unless
index were 0x4, because SIB_INDEX_sib is merely the range base (SIB_INDEX_EAX)
plus 4. Respectively SIB_INDEX_sib64.

- Don't use a switch statement to perform left-shift.

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

llvm-svn: 240598

9 years agoAdd __nonnull/__nullable/__null_unspecified predefines for Darwin.
Douglas Gregor [Wed, 24 Jun 2015 22:02:16 +0000 (22:02 +0000)]
Add __nonnull/__nullable/__null_unspecified predefines for Darwin.

Addresses the rest of rdar://problem/21530726.

llvm-svn: 240597

9 years agoReplace __double_underscored type nullability qualifiers with _Uppercase_underscored
Douglas Gregor [Wed, 24 Jun 2015 22:02:08 +0000 (22:02 +0000)]
Replace __double_underscored type nullability qualifiers with _Uppercase_underscored

Addresses a conflict with glibc's __nonnull macro by renaming the type
nullability qualifiers as follows:

  __nonnull -> _Nonnull
  __nullable -> _Nullable
  __null_unspecified -> _Null_unspecified

This is the major part of rdar://problem/21530726, but does not yet
provide the Darwin-specific behavior for the old names.

llvm-svn: 240596

9 years ago[GVN] Intersect the IR flags when CSE'ing two instructions
David Majnemer [Wed, 24 Jun 2015 21:52:25 +0000 (21:52 +0000)]
[GVN] Intersect the IR flags when CSE'ing two instructions

We performed a simple, but incomplete, intersection when it came time to
CSE instructions.  It didn't handle, for example, the 'exact' flag.

This fixes PR23922.

llvm-svn: 240595

9 years agoSpelling fixes in comments.
Douglas Katzman [Wed, 24 Jun 2015 21:46:53 +0000 (21:46 +0000)]
Spelling fixes in comments.

llvm-svn: 240594

9 years ago[Reassociate] Don't propogate flags when creating negations
David Majnemer [Wed, 24 Jun 2015 21:27:36 +0000 (21:27 +0000)]
[Reassociate] Don't propogate flags when creating negations

Reassociate mutated existing instructions in order to form negations
which would create additional reassociate opportunities.

This fixes PR23926.

llvm-svn: 240593

9 years agofix typos; NFC
Sanjay Patel [Wed, 24 Jun 2015 20:42:33 +0000 (20:42 +0000)]
fix typos; NFC

llvm-svn: 240592

9 years agodon't repeat function names in comments; NFC
Sanjay Patel [Wed, 24 Jun 2015 20:40:57 +0000 (20:40 +0000)]
don't repeat function names in comments; NFC

llvm-svn: 240591

9 years agoCOFF: Move code for ICF from Writer.cpp to ICF.cpp.
Rui Ueyama [Wed, 24 Jun 2015 20:40:03 +0000 (20:40 +0000)]
COFF: Move code for ICF from Writer.cpp to ICF.cpp.

llvm-svn: 240590

9 years ago[If Converter] Convert recursion to iteration.
Akira Hatanaka [Wed, 24 Jun 2015 20:34:35 +0000 (20:34 +0000)]
[If Converter] Convert recursion to iteration.

This commit makes changes to IfConverter::AnalyzeBlock to use iteration instead
of recursion. Previously, this function would get called recursively a large
number of times and eventually segfault when a function with the following CFG
was compiled:

BB0:
 if (condition0)
  goto BB1
 goto BB2
BB1:
 goto BB2
BB2:
 if (condition1)
  goto BB3
 goto BB4
BB3:
...
(repeat until BB7488)

rdar://problem/21386145

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

llvm-svn: 240589

9 years agoDevirtualize Instruction::clone_impl
Pete Cooper [Wed, 24 Jun 2015 20:22:23 +0000 (20:22 +0000)]
Devirtualize Instruction::clone_impl

llvm-svn: 240588