platform/upstream/llvm.git
8 years ago[lldb-mi] Fix breakpoints on functions when C++ namespaces are used.
Dawn Perchik [Mon, 27 Jul 2015 17:03:34 +0000 (17:03 +0000)]
[lldb-mi] Fix breakpoints on functions when C++ namespaces are used.

The command "-break-insert ns::foo" for function 'foo' in namespace 'ns'
was being parsed as file:function.  This patch fixes these cases by adding
checks for '::'. (Note: '::func' is not parsed correctly by lldb due to
llvm.org/pr24271).

Reviewed by: ki.stfu
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D11396

llvm-svn: 243281

8 years ago[OpenMP] Add TLS requirement for the copyin clause codegen test. This is an
Samuel Antao [Mon, 27 Jul 2015 16:59:45 +0000 (16:59 +0000)]
[OpenMP] Add TLS requirement for the copyin clause codegen test. This is an
attempt to fix regressions triggered by r243277.

llvm-svn: 243280

8 years agoRename {Hexagon,NaCl}_TC to {Hexagon,NaCl}ToolChain respectively. NFC
Douglas Katzman [Mon, 27 Jul 2015 16:53:08 +0000 (16:53 +0000)]
Rename {Hexagon,NaCl}_TC to {Hexagon,NaCl}ToolChain respectively. NFC

Also rename XCore (the toolchain) to XCoreToolChain since XCore is
also a namespace for its tools.

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

llvm-svn: 243279

8 years ago[OpenMP] Add capture for threadprivate variables used in copyin clause
Samuel Antao [Mon, 27 Jul 2015 16:38:06 +0000 (16:38 +0000)]
[OpenMP] Add capture for threadprivate variables used in copyin clause
if TLS is enabled in OpenMP code generation.

llvm-svn: 243277

8 years agoUpdate Build_With_CMake.txt to reflect changes in CMake refactor
Jonathan Peyton [Mon, 27 Jul 2015 16:23:42 +0000 (16:23 +0000)]
Update Build_With_CMake.txt to reflect changes in CMake refactor

This just updates the documentation regarding how to build libomp with CMake.

llvm-svn: 243276

8 years agoAnalysis: Fix example usage comment in CFG.cpp. NFC
Jonathan Roelofs [Mon, 27 Jul 2015 16:05:36 +0000 (16:05 +0000)]
Analysis: Fix example usage comment in CFG.cpp. NFC

Patch by Vedant Kumar!

llvm-svn: 243275

8 years agoThe tests added in r243270 require asserts to be enabled
Silviu Baranga [Mon, 27 Jul 2015 15:22:49 +0000 (15:22 +0000)]
The tests added in r243270 require asserts to be enabled

llvm-svn: 243274

8 years agoFix the tests added in r243270. Use 2>&1 instead of |&
Silviu Baranga [Mon, 27 Jul 2015 15:08:55 +0000 (15:08 +0000)]
Fix the tests added in r243270. Use 2>&1 instead of |&

llvm-svn: 243273

8 years ago[clang-tidy] Set current main file name in tests.
Alexander Kornienko [Mon, 27 Jul 2015 14:54:31 +0000 (14:54 +0000)]
[clang-tidy] Set current main file name in tests.

llvm-svn: 243272

8 years ago[PeepholeOptimizer] Look through PHIs to find additional register sources
Bruno Cardoso Lopes [Mon, 27 Jul 2015 14:39:46 +0000 (14:39 +0000)]
[PeepholeOptimizer] Look through PHIs to find additional register sources

Reapply r242295 with fixes in the implementation.

- Teaches the ValueTracker in the PeepholeOptimizer to look through PHI
instructions.
- Add findNextSourceAndRewritePHI method to lookup into multiple sources
returnted by the ValueTracker and rewrite PHIs with new sources.

With these changes we can find more register sources and rewrite more
copies to allow coaslescing of bitcast instructions. Hence, we eliminate
unnecessary VR64 <-> GR64 copies in x86, but it could be extended to
other archs by marking "isBitcast" on target specific instructions. The
x86 example follows:

A:
  psllq %mm1, %mm0
  movd  %mm0, %r9
  jmp C

B:
  por %mm1, %mm0
  movd  %mm0, %r9
  jmp C

C:
  movd  %r9, %mm0
  pshufw  $238, %mm0, %mm0

Becomes:

A:
  psllq %mm1, %mm0
  jmp C

B:
  por %mm1, %mm0
  jmp C

C:
  pshufw  $238, %mm0, %mm0

Differential Revision: http://reviews.llvm.org/D11197
rdar://problem/20404526

llvm-svn: 243271

8 years ago[ARM/AArch64] Fix cost model for interleaved accesses
Silviu Baranga [Mon, 27 Jul 2015 14:39:34 +0000 (14:39 +0000)]
[ARM/AArch64] Fix cost model for interleaved accesses

Summary:
Fix the cost of interleaved accesses for ARM/AArch64.
We were calling getTypeAllocSize and using it to check
the number of bits, when we should have called
getTypeAllocSizeInBits instead.

This would pottentially cause the vectorizer to
generate loads/stores and shuffles which cannot
be matched with an interleaved access instruction.

No performance changes are expected for now since
matching/generating interleaved accesses is still
disabled by default.

Reviewers: rengolin

Subscribers: aemerson, llvm-commits, rengolin

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

llvm-svn: 243270

8 years agoTrying again to a failing test the bots found with r243266.
Aaron Ballman [Mon, 27 Jul 2015 13:59:24 +0000 (13:59 +0000)]
Trying again to a failing test the bots found with r243266.

llvm-svn: 243269

8 years agoFixing a failing test the bots found with r243266.
Aaron Ballman [Mon, 27 Jul 2015 13:47:35 +0000 (13:47 +0000)]
Fixing a failing test the bots found with r243266.

llvm-svn: 243268

8 years agomisc-unused-parameters: Don't warn on ParmVarDecls in the return type.
Daniel Jasper [Mon, 27 Jul 2015 13:46:37 +0000 (13:46 +0000)]
misc-unused-parameters: Don't warn on ParmVarDecls in the return type.

As there don't seem to be a good way of formulating a matcher that
finds all pairs of functions and their ParmVarDecls, just match on
functionDecls and iterate over their parameters. This should also be
more efficient as some checks are only performed once per function.

llvm-svn: 243267

8 years agoUpdating the documentation for clang-tidy. Removes some non-ASCII characters from...
Aaron Ballman [Mon, 27 Jul 2015 13:41:30 +0000 (13:41 +0000)]
Updating the documentation for clang-tidy. Removes some non-ASCII characters from the documentation, and removes shell-specific single quote characters as they cause issues for some shells (such as on Windows).

llvm-svn: 243266

8 years ago[clang-tidy] Don't duplicate the leading slash.
Alexander Kornienko [Mon, 27 Jul 2015 13:07:50 +0000 (13:07 +0000)]
[clang-tidy] Don't duplicate the leading slash.

llvm-svn: 243265

8 years ago[X86] Reordered lowerVectorShuffleAsBitMask before lowerVectorShuffleAsBlend. NFCI.
Simon Pilgrim [Mon, 27 Jul 2015 12:37:19 +0000 (12:37 +0000)]
[X86] Reordered lowerVectorShuffleAsBitMask before lowerVectorShuffleAsBlend. NFCI.

Allows us to show diffs for D11518 more clearly

llvm-svn: 243264

8 years agoAMDGPU/SI: Fix the V_FRACT_F64 SI bug workaround
Marek Olsak [Mon, 27 Jul 2015 11:37:42 +0000 (11:37 +0000)]
AMDGPU/SI: Fix the V_FRACT_F64 SI bug workaround

This is a candidate for 3.7.

llvm-svn: 243263

8 years agoSetting ARM dynamic linker name from commandline
Renato Golin [Mon, 27 Jul 2015 09:56:37 +0000 (09:56 +0000)]
Setting ARM dynamic linker name from commandline

Currently trigger to select hard-float linker is only based of -gnueabihf
appearing in target triplet, but we should also select it when hardfloat
is requested via cmdline.

Patch by Khem Raj.

llvm-svn: 243262

8 years ago[clang-cl] Handle -O correctly
David Majnemer [Mon, 27 Jul 2015 07:32:11 +0000 (07:32 +0000)]
[clang-cl] Handle -O correctly

We had multiple bugs here:
- We didn't support multiple optimization options in one argument.
  e.g. -O2y-
- We didn't correctly expand -O[12dx] to their respective options.
- We treated -O1 as clang -O1 instead of clang -Os.
- We treated -Ox as clang -O3 instead of clang -O2.  In fact, cl's -Ox
  option is *less* powerful than cl's -O2 option despite -Ox described
  as "Full Optimization".

This fixes PR24003.

llvm-svn: 243261

8 years agoRename highly-confusing isWhitespace that returns false on \n to
Yaron Keren [Mon, 27 Jul 2015 06:35:22 +0000 (06:35 +0000)]
Rename highly-confusing isWhitespace that returns false on \n to
isWhitespaceExceptNL. If that's wasn't bad enough, we have an identically
named function in Basic/CharInfo.h.

While at it, remove unnecessary includes, .str() calls and #ifdef.

llvm-svn: 243260

8 years ago[modules] Add an assert for redeclarations that we never added to their redecl
Richard Smith [Mon, 27 Jul 2015 05:40:23 +0000 (05:40 +0000)]
[modules] Add an assert for redeclarations that we never added to their redecl
chain and fix the cases where it fires.

 * Handle the __va_list_tag as a predefined decl. Previously we failed to merge
   sometimes it because it's not visible to name lookup. (In passing, remove
   redundant __va_list_tag typedefs that we were creating for some ABIs. These
   didn't affect the mangling or representation of the type.)

 * For Decls derived from Redeclarable that are not in fact redeclarable
   (implicit params, function params, ObjC type parameters), remove them from
   the list of expected redeclarable decls.

llvm-svn: 243259

8 years agoLoopAccessAnalysis.cpp: Tweak r243239 to avoid side effects. It caused different...
NAKAMURA Takumi [Mon, 27 Jul 2015 01:35:30 +0000 (01:35 +0000)]
LoopAccessAnalysis.cpp: Tweak r243239 to avoid side effects. It caused different emissions between gcc and clang.

llvm-svn: 243258

8 years agoFix jSignalsInfo packet handling.
Oleksiy Vyalov [Mon, 27 Jul 2015 01:32:58 +0000 (01:32 +0000)]
Fix jSignalsInfo packet handling.

llvm-svn: 243257

8 years agoAvoid using uncommon acronym "MSROM".
Sean Silva [Mon, 27 Jul 2015 00:46:59 +0000 (00:46 +0000)]
Avoid using uncommon acronym "MSROM".

llvm-svn: 243256

8 years ago[Targets] Define _M_AMD64 and _M_X64 to a more appropriate value
David Majnemer [Sun, 26 Jul 2015 23:17:29 +0000 (23:17 +0000)]
[Targets] Define _M_AMD64 and _M_X64 to a more appropriate value

We used to define them to 1, we should have defined them to 100.

llvm-svn: 243255

8 years agoSimplify some isl expression we use
Tobias Grosser [Sun, 26 Jul 2015 19:22:35 +0000 (19:22 +0000)]
Simplify some isl expression we use

Suggested-by: Sven Verdoolaege <skimo-polly@kotnet.org>
llvm-svn: 243254

8 years agoRoll forward r243250
Jingyue Wu [Sun, 26 Jul 2015 19:10:03 +0000 (19:10 +0000)]
Roll forward r243250

r243250 appeared to break clang/test/Analysis/dead-store.c on one of the build
slaves, but I couldn't reproduce this failure locally. Probably a false
positive as I saw this test was broken by r243246 or r243247 too but passed
later without people fixing anything.

llvm-svn: 243253

8 years ago[AST] It should be impossible to get Int128 or UInt128 into VisitIntegerLiteral
David Majnemer [Sun, 26 Jul 2015 18:33:32 +0000 (18:33 +0000)]
[AST] It should be impossible to get Int128 or UInt128 into VisitIntegerLiteral

These cases should now be impossible as of r243243.

llvm-svn: 243252

8 years agoRevert r243250
Jingyue Wu [Sun, 26 Jul 2015 18:30:13 +0000 (18:30 +0000)]
Revert r243250

breaks tests

llvm-svn: 243251

8 years ago[TTI/CostModel] improve TTI::getGEPCost and use it in CostModel::getInstructionCost
Jingyue Wu [Sun, 26 Jul 2015 17:28:13 +0000 (17:28 +0000)]
[TTI/CostModel] improve TTI::getGEPCost and use it in CostModel::getInstructionCost

Summary:
This patch updates TargetTransformInfoImplCRTPBase::getGEPCost to consider
addressing modes. It now returns TCC_Free when the GEP can be completely folded
to an addresing mode.

I started this patch as I refactored SLSR. Function isGEPFoldable looks common
and is indeed used by some WIP of mine. So I extracted that logic to getGEPCost.

Furthermore, I noticed getGEPCost wasn't directly tested anywhere. The best
testing bed seems CostModel, but its getInstructionCost method invokes
getAddressComputationCost for GEPs which provides very coarse estimation. So
this patch also makes getInstructionCost call the updated getGEPCost for GEPs.
This change inevitably breaks some tests because the cost model changes, but
nothing looks seriously wrong -- if we believe the new cost model is the right
way to go, these tests should be updated.

This patch is not perfect yet -- the comments in some tests need to be updated.
I want to know whether this is a right approach before fixing those details.

Reviewers: chandlerc, hfinkel

Subscribers: aschwaighofer, llvm-commits, aemerson

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

llvm-svn: 243250

8 years ago[X86][SSE] Refreshed vector bit count tests.
Simon Pilgrim [Sun, 26 Jul 2015 17:02:25 +0000 (17:02 +0000)]
[X86][SSE] Refreshed vector bit count tests.

llvm-svn: 243249

8 years ago[X86][AVX2] Refreshed avx2 conversion tests
Simon Pilgrim [Sun, 26 Jul 2015 17:01:16 +0000 (17:01 +0000)]
[X86][AVX2] Refreshed avx2 conversion tests

llvm-svn: 243248

8 years agobugpoint: make the number of trim iterations a compile-time constant
Tobias Grosser [Sun, 26 Jul 2015 15:18:45 +0000 (15:18 +0000)]
bugpoint: make the number of trim iterations a compile-time constant

Around 10 year ago Chris limited this code to a single iteration by just
dropping a break into the loop body. We now make the number of trim iterations
a compile time constant to be able to play with it and see if this can
improve the bugpoint results. We currently use with '3' still a small and
conservative value, but this can be adjusted in the future, if needed.

I tried to look for a trivial test case, but did not succeed yet.

llvm-svn: 243247

8 years agoImplemented encoding and intrinsics of the following instructions
Igor Breger [Sun, 26 Jul 2015 14:41:44 +0000 (14:41 +0000)]
Implemented encoding and intrinsics of the following instructions
  vunpckhps/pd, vunpcklps/pd,
  vpunpcklbw, vpunpckhbw, vpunpcklwd, vpunpckhwd, vpunpckldq, vpunpckhdq, vpunpcklqdq, vpunpckhqdq
Added tests for intrinsics and encoding.

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

llvm-svn: 243246

8 years agoRemove explicit heap allocation to fix and prevent memory leaks
Johannes Doerfert [Sun, 26 Jul 2015 13:14:38 +0000 (13:14 +0000)]
Remove explicit heap allocation to fix and prevent memory leaks

llvm-svn: 243245

8 years agoFix typo in comment
Tobias Grosser [Sun, 26 Jul 2015 11:37:05 +0000 (11:37 +0000)]
Fix typo in comment

llvm-svn: 243244

8 years ago[MS Extensions] Remove support for the i128 integer literal suffix
David Majnemer [Sun, 26 Jul 2015 09:02:26 +0000 (09:02 +0000)]
[MS Extensions] Remove support for the i128 integer literal suffix

There is currently no support in MSVC for using i128 as an integer
literal suffix.  In fact, there appears to be no evidence that they have
ever supported this feature in any of their compilers.  This was an over
generalization of their actual feature and is a nasty source of bugs.
Why is it a source of bugs?  Because most code in clang expects that
evaluation of an integer constant expression won't give them something
that 'long long' can't represent.  Instead of providing a meaningful
feature, i128 gives us cute ways of exploding the compiler.

llvm-svn: 243243

8 years ago[Sema] Refactor AddAlignedAttr to reduce indentation
David Majnemer [Sun, 26 Jul 2015 09:02:21 +0000 (09:02 +0000)]
[Sema] Refactor AddAlignedAttr to reduce indentation

No functionality change intended, just a tidy-up.

llvm-svn: 243242

8 years agotsan: fix shift overflow
Dmitry Vyukov [Sun, 26 Jul 2015 07:45:26 +0000 (07:45 +0000)]
tsan: fix shift overflow

3<<30 fits into 32-bit unsigned, but does not fit into int.
Found by ubsan.

llvm-svn: 243241

8 years ago[llvm-dwarfump] Don't rely on global state, part 3.
Davide Italiano [Sun, 26 Jul 2015 05:35:59 +0000 (05:35 +0000)]
[llvm-dwarfump] Don't rely on global state, part 3.

Some tools used to rely on a global static variable to keep track of the
return value for main(). I changed llvm-cxxdump to use exit(1)
and Rafael shortly after did the same with llvm-readobj. This is
(yet) another step towards the goal.

llvm-svn: 243240

8 years ago[LAA] Begin moving the logic of generating checks out of addRuntimeCheck
Adam Nemet [Sun, 26 Jul 2015 05:32:14 +0000 (05:32 +0000)]
[LAA] Begin moving the logic of generating checks out of addRuntimeCheck

Summary:
The goal is to start moving us closer to the model where
RuntimePointerChecking will compute and store the checks.  Then a client
can filter the check according to its requirements and then use the
filtered list of checks with addRuntimeCheck.

Before the patch, this is all done in addRuntimeCheck.  So the patch
starts to split up addRuntimeCheck while providing the old API under
what's more or less a wrapper now.

The new underlying addRuntimeCheck takes a collection of checks now,
expands the code for the bounds then generates the code for the checks.

I am not completely happy with making expandBounds static because now it
needs so many explicit arguments but I don't want to make the type
PointerBounds part of LAI.  This should get fixed when addRuntimeCheck
is moved to LoopVersioning where it really belongs, IMO.

Audited the assembly diff of the testsuite (including externals).  There
is a tiny bit of assembly churn that is due to the different order the
code for the bounds is expanded now
(MultiSource/Benchmarks/Prolangs-C/bison/conflicts.s and with LoopDist
on 456.hmmer/fast_algorithms.s).

Reviewers: hfinkel

Subscribers: klimek, llvm-commits

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

llvm-svn: 243239

8 years agoThis test failed on ninja-x64-msvc-RA-centos6.
Yaron Keren [Sun, 26 Jul 2015 05:15:24 +0000 (05:15 +0000)]
This test failed on ninja-x64-msvc-RA-centos6.
We could probably get this and the previous three disabled in r243237
working on these builders if MSYS was updated to current MSYS2.

llvm-svn: 243238

8 years agoRevert three tests enabled on r243236, they fail on clang-x86-win2008-selfhost.
Yaron Keren [Sun, 26 Jul 2015 04:59:52 +0000 (04:59 +0000)]
Revert three tests enabled on r243236, they fail on clang-x86-win2008-selfhost.

llvm-svn: 243237

8 years agoEnable passing clang tests on Windows/MSYS.
Yaron Keren [Sun, 26 Jul 2015 04:36:39 +0000 (04:36 +0000)]
Enable passing clang tests on Windows/MSYS.

llvm-svn: 243236

9 years agoFix test running under mingw.
Yaron Keren [Sun, 26 Jul 2015 04:09:41 +0000 (04:09 +0000)]
Fix test running under mingw.

llvm-svn: 243235

9 years agoTry to make the buildbots happy
David Majnemer [Sun, 26 Jul 2015 02:16:35 +0000 (02:16 +0000)]
Try to make the buildbots happy

This test was missing a triple causing it to error out on windows
targets.  They accept a much smaller alignment value.

llvm-svn: 243234

9 years ago[Sema] The alignment of an object has an upper bound from the object file format
David Majnemer [Sun, 26 Jul 2015 01:48:59 +0000 (01:48 +0000)]
[Sema] The alignment of an object has an upper bound from the object file format

Don't use the spelling of the alignment attribute to determine whether
or not an alignment amount makes sense.

llvm-svn: 243233

9 years agoELF2: Avoid calling std::sort to make output deterministic.
Rui Ueyama [Sun, 26 Jul 2015 00:50:15 +0000 (00:50 +0000)]
ELF2: Avoid calling std::sort to make output deterministic.

llvm-svn: 243232

9 years agoELF2: Remove dead code.
Rui Ueyama [Sun, 26 Jul 2015 00:50:13 +0000 (00:50 +0000)]
ELF2: Remove dead code.

llvm-svn: 243231

9 years agoXFAIL TestExprOptions on Linux.
Chaoren Lin [Sat, 25 Jul 2015 22:06:48 +0000 (22:06 +0000)]
XFAIL TestExprOptions on Linux.

llvm-svn: 243230

9 years agoCOFF: Use short identifiers. NFC.
Rui Ueyama [Sat, 25 Jul 2015 21:54:50 +0000 (21:54 +0000)]
COFF: Use short identifiers. NFC.

llvm-svn: 243229

9 years agoCOFF: Fix image base address for 32-bit.
Rui Ueyama [Sat, 25 Jul 2015 21:42:33 +0000 (21:42 +0000)]
COFF: Fix image base address for 32-bit.

0x140000000 or 0x180000000 are not correct image base addresses
for 32-bit. They are actually much smaller.

llvm-svn: 243228

9 years ago[libclang] Use lambdas instead of explicit structs when storing arguments.
Benjamin Kramer [Sat, 25 Jul 2015 20:55:44 +0000 (20:55 +0000)]
[libclang] Use lambdas instead of explicit structs when storing arguments.

This boilerplate code was necessary to move arguments between threads in
C++98, lambdas make this much easier. No functionality change intended.

llvm-svn: 243227

9 years ago[InstCombine][SSE4A] Standardized references to Length/Width and Index/Start to match...
Simon Pilgrim [Sat, 25 Jul 2015 20:41:00 +0000 (20:41 +0000)]
[InstCombine][SSE4A] Standardized references to Length/Width and Index/Start to match AMD docs. NFCI.

llvm-svn: 243226

9 years ago[AST] Rename RecordLayoutBuilder to ItaniumRecordLayoutBuilder
David Majnemer [Sat, 25 Jul 2015 20:18:14 +0000 (20:18 +0000)]
[AST] Rename RecordLayoutBuilder to ItaniumRecordLayoutBuilder

RecordLayoutBuilder is an inaccruate name because it does not build all
records.  It only builds layouts for targets using the Itanium C++ ABI.

llvm-svn: 243225

9 years agoEnable clang tests requiring "clang-driver" on mingw.
Yaron Keren [Sat, 25 Jul 2015 20:05:21 +0000 (20:05 +0000)]
Enable clang tests requiring "clang-driver" on mingw.
At least on my mingw system they do pass, let's see what the bots think.

llvm-svn: 243224

9 years ago[InstCombine] Split off SSE4a tests.
Simon Pilgrim [Sat, 25 Jul 2015 17:14:01 +0000 (17:14 +0000)]
[InstCombine] Split off SSE4a tests.

These aren't vector demanded bits tests. More tests to follow.

llvm-svn: 243223

9 years ago[VTableBuilder] Use range-based for loops. No functional change intended
Benjamin Kramer [Sat, 25 Jul 2015 17:10:49 +0000 (17:10 +0000)]
[VTableBuilder] Use range-based for loops. No functional change intended

llvm-svn: 243222

9 years ago[VTableBuilder] Turn functors into lambdas
Benjamin Kramer [Sat, 25 Jul 2015 16:31:30 +0000 (16:31 +0000)]
[VTableBuilder] Turn functors into lambdas

No functional change intended.

llvm-svn: 243221

9 years agoAdd missing namespace specifiers.
Benjamin Kramer [Sat, 25 Jul 2015 15:44:23 +0000 (15:44 +0000)]
Add missing namespace specifiers.

llvm-svn: 243220

9 years agoUpgrade for Clang API change.
Benjamin Kramer [Sat, 25 Jul 2015 15:33:17 +0000 (15:33 +0000)]
Upgrade for Clang API change.

llvm-svn: 243219

9 years agoCapture 'this' so GCC 4.7 can find a static members.
Benjamin Kramer [Sat, 25 Jul 2015 15:27:04 +0000 (15:27 +0000)]
Capture 'this' so GCC 4.7 can find a static members.

llvm-svn: 243218

9 years ago[AST] Turn the callbacks of lookupInBases and forallBases into a function_ref
Benjamin Kramer [Sat, 25 Jul 2015 15:07:25 +0000 (15:07 +0000)]
[AST] Turn the callbacks of lookupInBases and forallBases into a function_ref

This lets us pass functors (and lambdas) without void * tricks. On the
downside we can't pass CXXRecordDecl's Find* members (which are now type
safe) to lookupInBases directly, but a lambda trampoline is a small
price to pay. No functionality change intended.

llvm-svn: 243217

9 years ago[X86][SSE] Added additional vector sign/zero load extension tests.
Simon Pilgrim [Sat, 25 Jul 2015 14:07:20 +0000 (14:07 +0000)]
[X86][SSE] Added additional vector sign/zero load extension tests.

llvm-svn: 243216

9 years agoFix formatting of recent alias-analysis commit
Tobias Grosser [Sat, 25 Jul 2015 12:31:03 +0000 (12:31 +0000)]
Fix formatting of recent alias-analysis commit

llvm-svn: 243215

9 years agoPrevectorize the schedule of the band (or the point loop in case of tiling)
Tobias Grosser [Sat, 25 Jul 2015 12:28:56 +0000 (12:28 +0000)]
Prevectorize the schedule of the band (or the point loop in case of tiling)

Contributed-by: Roman Gareev <gareevroman@gmail.com>
llvm-svn: 243214

9 years ago[Modules] Wrap the main ModuleManager visitor in a function_ref.
Benjamin Kramer [Sat, 25 Jul 2015 12:14:04 +0000 (12:14 +0000)]
[Modules] Wrap the main ModuleManager visitor in a function_ref.

Avoids the awkward passing of an opaque void *UserData argument. No
functional change intended.

llvm-svn: 243213

9 years ago[X86][SSE] Added additional vector sign/zero extension tests.
Simon Pilgrim [Sat, 25 Jul 2015 11:17:35 +0000 (11:17 +0000)]
[X86][SSE] Added additional vector sign/zero extension tests.

llvm-svn: 243212

9 years ago[Mips] Define _DYNAMIC_LINKING symbol if output is a is dynamically linked executable...
Simon Atanasyan [Sat, 25 Jul 2015 10:18:52 +0000 (10:18 +0000)]
[Mips] Define _DYNAMIC_LINKING symbol if output is a is dynamically linked executable file

llvm-svn: 243211

9 years ago[Mips] Remove redundant separate functions to calculate relocations. Do
Simon Atanasyan [Sat, 25 Jul 2015 10:18:44 +0000 (10:18 +0000)]
[Mips] Remove redundant separate functions to calculate relocations. Do
that inline.

No functional changes.

llvm-svn: 243210

9 years ago[Mips] Remove duplicated code by joining the same functions
Simon Atanasyan [Sat, 25 Jul 2015 10:18:39 +0000 (10:18 +0000)]
[Mips] Remove duplicated code by joining the same functions

llvm-svn: 243209

9 years ago[Mips] Do not sign-extend addends read from RELA relocation records
Simon Atanasyan [Sat, 25 Jul 2015 10:18:33 +0000 (10:18 +0000)]
[Mips] Do not sign-extend addends read from RELA relocation records

llvm-svn: 243208

9 years ago[clang-cl] Add fallback support for /Zl
David Majnemer [Sat, 25 Jul 2015 06:07:59 +0000 (06:07 +0000)]
[clang-cl] Add fallback support for /Zl

llvm-svn: 243207

9 years ago[CodeGen] Don't UBSan-ize the argument to __builtin_frame_address
David Majnemer [Sat, 25 Jul 2015 05:57:24 +0000 (05:57 +0000)]
[CodeGen] Don't UBSan-ize the argument to __builtin_frame_address

__builtin_frame_address requires its argument to be a constant
expression which already implies that it cannot have undefined behavior.
However, we used EmitScalarExpr to emit the argument causing UBSan to
try to check for overflow.

Instead, use the constant expression emission system.

This fixes PR24256.

llvm-svn: 243206

9 years agoCOFF: ARM: Support import functions.
Rui Ueyama [Sat, 25 Jul 2015 03:39:29 +0000 (03:39 +0000)]
COFF: ARM: Support import functions.

llvm-svn: 243205

9 years agoCOFF: ARM: Implement BLX23T relocation.
Rui Ueyama [Sat, 25 Jul 2015 03:25:28 +0000 (03:25 +0000)]
COFF: ARM: Implement BLX23T relocation.

llvm-svn: 243204

9 years ago[LoopUnswitch] Improve loop unswitch pass to find trivial unswitch conditions more...
Chen Li [Sat, 25 Jul 2015 03:21:06 +0000 (03:21 +0000)]
[LoopUnswitch] Improve loop unswitch pass to find trivial unswitch conditions more effectively

Summary:
This patch improves trivial loop unswitch.

The current trivial loop unswitch only checks if loop header's terminator contains a trivial unswitch condition. But if the loop header only has one reachable successor (due to intentionally or unintentionally missed code simplification), we should consider the successor as part of the loop header. Therefore, instead of stopping at loop header's terminator, we should keep traversing its successors within loop until reach a *real* conditional branch or switch (whose condition can not be constant folded). This change will enable a single -loop-unswitch pass to unswitch multiple trivial conditions (unswitch one trivial condition could open opportunity to unswitch another one in the same loop), while the old implementation can unswitch only one per pass.

Reviewers: reames, broune

Subscribers: llvm-commits

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

llvm-svn: 243203

9 years agoCOFF: ARM: Implement BRANCH24T relocation.
Rui Ueyama [Sat, 25 Jul 2015 03:19:34 +0000 (03:19 +0000)]
COFF: ARM: Implement BRANCH24T relocation.

llvm-svn: 243202

9 years agoCOFF: ARM: Implement MOV32T relocation.
Rui Ueyama [Sat, 25 Jul 2015 03:03:46 +0000 (03:03 +0000)]
COFF: ARM: Implement MOV32T relocation.

llvm-svn: 243201

9 years agoAdd some initial logging for when lldb is searching for binaries,
Jason Molenda [Sat, 25 Jul 2015 02:39:42 +0000 (02:39 +0000)]
Add some initial logging for when lldb is searching for binaries,
dSYMs, or reading binaries out of memory to the 'Host' log channel.
There's more to be done here, both for Mac and for other platforms,
but the initial set of new loggings are useful enough to check in
at this point.

llvm-svn: 243200

9 years agoCOFF: ARM: Set correct entry point address.
Rui Ueyama [Sat, 25 Jul 2015 02:25:14 +0000 (02:25 +0000)]
COFF: ARM: Set correct entry point address.

llvm-svn: 243199

9 years ago[AArch64][FastISel] Always use an AND instruction when truncating to non-legal types.
Juergen Ributzka [Sat, 25 Jul 2015 02:16:53 +0000 (02:16 +0000)]
[AArch64][FastISel] Always use an AND instruction when truncating to non-legal types.

When truncating to non-legal types (such as i16, i8 and i1) always use an AND
instruction to mask out the upper bits. This was only done when the source type
was an i64, but not when the source type was an i32.

This commit fixes this and adds the missing i32 truncate tests.

This fixes rdar://problem/21990703.

llvm-svn: 243198

9 years agoCOFF: Handle base relocation as a tuple of relocation type and RVA. NFC.
Rui Ueyama [Sat, 25 Jul 2015 01:44:32 +0000 (01:44 +0000)]
COFF: Handle base relocation as a tuple of relocation type and RVA. NFC.

On x64 and x86, we use only one base relocation type, so we handled
base relocations just as a list of RVAs. That doesn't work well for
ARM becuase we have to handle two types of base relocations on ARM.
This patch changes the type of base relocation from uint32_t to
{reltype, uint32_t} to make it easy to port this code to ARM.

llvm-svn: 243197

9 years ago[SemaTemplate] Detect instantiation of unparsed exceptions.
Davide Italiano [Sat, 25 Jul 2015 01:19:32 +0000 (01:19 +0000)]
[SemaTemplate] Detect instantiation of unparsed exceptions.

This fixes the clang crash reported in PR24000.

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

llvm-svn: 243196

9 years agoCOFF: Split ImportThunkChunk into x86 and x64. NFC.
Rui Ueyama [Sat, 25 Jul 2015 01:16:06 +0000 (01:16 +0000)]
COFF: Split ImportThunkChunk into x86 and x64. NFC.

This change should make it easy to port this code to ARM.

llvm-svn: 243195

9 years agoCOFF: Do not align import thunks on 16-byte boundaries on x86.
Rui Ueyama [Sat, 25 Jul 2015 01:16:04 +0000 (01:16 +0000)]
COFF: Do not align import thunks on 16-byte boundaries on x86.

Looks like MSVC linker aligns them only on x64.

llvm-svn: 243194

9 years agoShorten the lldb timeout, we were seeing occasional failure because
Jim Ingham [Sat, 25 Jul 2015 00:52:38 +0000 (00:52 +0000)]
Shorten the lldb timeout, we were seeing occasional failure because
lldb didn't wake up before the target function got a chance to complete.

<rdar://problem/21990308>

llvm-svn: 243193

9 years agoFix PPCMaterializeInt to check the size of the integer based on the
Eric Christopher [Sat, 25 Jul 2015 00:48:08 +0000 (00:48 +0000)]
Fix PPCMaterializeInt to check the size of the integer based on the
extension property we're requesting - zero or sign extended.

This fixes cases where we want to return a zero extended 32-bit -1
and not be sign extended for the entire register. Also updated the
already out of date comment with the current behavior.

llvm-svn: 243192

9 years agoPPCMaterializeInt should only take a ConstantInt so represent this in the prototype
Eric Christopher [Sat, 25 Jul 2015 00:48:06 +0000 (00:48 +0000)]
PPCMaterializeInt should only take a ConstantInt so represent this in the prototype
and fix up all uses.

llvm-svn: 243191

9 years agoAdd initial CODE_OWNERS.TXT file
Nick Kledzik [Sat, 25 Jul 2015 00:44:37 +0000 (00:44 +0000)]
Add initial CODE_OWNERS.TXT file

llvm-svn: 243190

9 years agoFix test case.
Akira Hatanaka [Sat, 25 Jul 2015 00:33:57 +0000 (00:33 +0000)]
Fix test case.

This is a follow-up to r243185, which made changes to pass subtarget
feature "+reserve-x18" instead of backend option "-aarch64-reserve-x18".

llvm-svn: 243189

9 years agoCOFF: Don't assume !is64() means i386.
Rui Ueyama [Sat, 25 Jul 2015 00:20:06 +0000 (00:20 +0000)]
COFF: Don't assume !is64() means i386.

In many places we assumed that is64() means AMD64 and i386 otherwise.
This assumption is not sound because Windows also supports ARM.
The linker doesn't support ARM yet, but this is a first step.

llvm-svn: 243188

9 years agoSpecify a language to use when parsing expressions.
Dawn Perchik [Sat, 25 Jul 2015 00:19:39 +0000 (00:19 +0000)]
Specify a language to use when parsing expressions.

This patch adds the option -l/--language to the expression command, for
use when setting the language options or choosing an alternate FE. If
not specified, the target.language setting is used.

Reviewed by: clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D11447

llvm-svn: 243187

9 years ago[AArch64] Define subtarget feature "reserve-x18", which is used to decide
Akira Hatanaka [Sat, 25 Jul 2015 00:18:31 +0000 (00:18 +0000)]
[AArch64] Define subtarget feature "reserve-x18", which is used to decide
whether register x18 should be reserved.

This change is needed because we cannot use a backend option to set
cl::opt "aarch64-reserve-x18" when doing LTO.

Out-of-tree projects currently using cl::opt option "-aarch64-reserve-x18"
to reserve x18 should make changes to add subtarget feature "reserve-x18"
to the IR.

rdar://problem/21529937

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

llvm-svn: 243186

9 years ago[AArch64] Pass subtarget feature "+reserve-x18" instead of passing backend
Akira Hatanaka [Sat, 25 Jul 2015 00:18:00 +0000 (00:18 +0000)]
[AArch64] Pass subtarget feature "+reserve-x18" instead of passing backend
option "-aarch64-reserve-x18".

This change is needed since backend options do not make it to the backend
when doing LTO and are not capable of changing the behavior of code-gen
passes on a per-function basis.

rdar://problem/21529937

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

llvm-svn: 243185

9 years ago[ELF2] Remove broken test.
Michael J. Spencer [Sat, 25 Jul 2015 00:09:22 +0000 (00:09 +0000)]
[ELF2] Remove broken test.

The exact error the system returns for this case is varies between OS's and file systems.

llvm-svn: 243184

9 years agoDI/Verifier: Fix argument bitrot in DILocalVariable
Duncan P. N. Exon Smith [Fri, 24 Jul 2015 23:59:25 +0000 (23:59 +0000)]
DI/Verifier: Fix argument bitrot in DILocalVariable

Add a verifier check that `DILocalVariable`s of tag
`DW_TAG_arg_variable` always have a non-zero 'arg:' field, and those of
tag `DW_TAG_auto_variable` always have a zero 'arg:' field.  These are
the only configurations that are properly understood by the backend.

(Also, fix the bad examples in LangRef and test/Assembler, and fix the
bug in Kaleidoscope Ch8.)

A large number of testcases seem to have bitrotted their way forward
from some ancient version of the debug info hierarchy that didn't have
`arg:` parameters.  If you have out-of-tree testcases that start failing
in the verifier and you don't care enough to get the `arg:` right, you
may have some luck just calling:

    sed -e 's/, arg: 0/, arg: 1/'

or some such, but I hand-updated the ones in tree.

llvm-svn: 243183

9 years agoCOFF: Implement Safe SEH support for x86.
Rui Ueyama [Fri, 24 Jul 2015 23:51:14 +0000 (23:51 +0000)]
COFF: Implement Safe SEH support for x86.

An object file compatible with Safe SEH contains a .sxdata section.
The section contains a list of symbol table indices, each of which
is an exception handler function. A safe SEH-enabled executable
contains a list of exception handler RVAs. So, what the linker has
to do to support Safe SEH is basically to read the .sxdata section,
interpret the contents as a list of symbol indices, unique-fy and
sort their RVAs, and then emit that list to .rdata. This patch
implements that feature.

llvm-svn: 243182

9 years agoMake sure we resolve ~ in paths coming from the plist in a dSYM before adding them
Jim Ingham [Fri, 24 Jul 2015 23:40:32 +0000 (23:40 +0000)]
Make sure we resolve ~ in paths coming from the plist in a dSYM before adding them
to the path remappings.
Also don't add the paths to the path mapping when DebugSymbols tells up about files, since
we'll just do that again when we read in the dSYM.

<rdar://problem/21986208>

llvm-svn: 243181