7 years ago[LLDBSwigPythonCallTypeScript] Remove redundant call to type summary func.
Siva Chandra [Thu, 25 Jun 2015 21:08:30 +0000 (21:08 +0000)]
[LLDBSwigPythonCallTypeScript] Remove redundant call to type summary func.

Reviewers: clayborg, granata.enrico

Reviewed By: clayborg, granata.enrico

Subscribers: lldb-commits

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

llvm-svn: 240698

7 years agoCOFF: Fix lexer for the module-definition file.
Rui Ueyama [Thu, 25 Jun 2015 21:06:00 +0000 (21:06 +0000)]
COFF: Fix lexer for the module-definition file.

Previously it would hang if there's a stray punctuation (e.g. ?).

llvm-svn: 240697

7 years agodocs: Fix bad link in SafeStack.rst.
Peter Collingbourne [Thu, 25 Jun 2015 21:02:17 +0000 (21:02 +0000)]
docs: Fix bad link in SafeStack.rst.

llvm-svn: 240696

7 years agollvm-nm: Don't print mapping symbols.
Rafael Espindola [Thu, 25 Jun 2015 21:00:51 +0000 (21:00 +0000)]
llvm-nm: Don't print mapping symbols.

This matches the behavior of gnu nm. Fixes pr23930.

llvm-svn: 240695

7 years agoUse foreach loop over constant operands. NFC.
Pete Cooper [Thu, 25 Jun 2015 20:51:38 +0000 (20:51 +0000)]
Use foreach loop over constant operands.  NFC.

A number of places had explicit loops over Constant::operands().
Just use foreach loops where possible.

llvm-svn: 240694

7 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

7 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

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

7 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

7 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

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

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

7 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

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

7 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

7 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

7 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.

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

7 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

7 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

7 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

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

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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

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

llvm-svn: 240669

7 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

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

llvm-svn: 240666

7 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

7 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

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


llvm-svn: 240663

7 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

7 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

7 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.


llvm-svn: 240660

7 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

7 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

7 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

7 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

7 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

7 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

7 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

llvm-svn: 240652

7 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

7 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

7 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


llvm-svn: 240649

7 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

7 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

7 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

7 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

7 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

7 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

7 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

llvm-svn: 240642

7 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

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

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

7 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

7 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

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

7 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.

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

7 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

7 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

7 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

7 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

7 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

7 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

Expand result with type char* to string in -data-evaluate-expression.
    -data-evaluate-expression str
    -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

7 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.

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

7 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

7 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.

This is the Clang part of the PPC64 memory sanitizer implementation in

Reviewers: kcc, eugenis, willschm, wschmidt, samsonov

Reviewed By: samsonov

Subscribers: cfe-commits

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

llvm-svn: 240628

7 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.

This is the LLVM part of the PPC memory sanitizer implementation in

Reviewers: kcc, samsonov, willschm, wschmidt, eugenis

Reviewed By: eugenis

Subscribers: llvm-commits

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

llvm-svn: 240627

7 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

7 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.

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

7 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.

  optional string operator= 1;

  optional string operator = 1;

llvm-svn: 240624

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

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

7 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

7 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

7 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

7 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

llvm-svn: 240619

7 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

7 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.

This patch implements step 1 from

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

Test Plan: regression test suite

Reviewers: thakis, hans

Subscribers: llvm-commits, zaks.anna, kubabrecka

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

llvm-svn: 240617

7 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

7 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

7 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

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


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

Test Plan

Added a scenario to the test case:

Code Review:


llvm-svn: 240613

7 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

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

Reviewers: fraggamuffin, rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

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

llvm-svn: 240612

7 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

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

7 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

7 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

7 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

7 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

7 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

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

llvm-svn: 240601

7 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

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

7 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

7 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

7 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

7 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

7 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

7 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

7 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