platform/upstream/llvm.git
10 years agoRename a couple of variables to be more accurate.
David Blaikie [Fri, 23 May 2014 05:03:23 +0000 (05:03 +0000)]
Rename a couple of variables to be more accurate.

It's not really a "ScopeDIE", as such - it's the abstract function
definition's DIE. And we usually use "SP" for subprograms, rather than
"Sub".

llvm-svn: 209499

10 years agoDebugInfo: Fix cross-CU references for scopes (and variables within those scopes...
David Blaikie [Fri, 23 May 2014 04:23:06 +0000 (04:23 +0000)]
DebugInfo: Fix cross-CU references for scopes (and variables within those scopes) in abstract definitions of cross-CU inlined functions

Found by Adrian Prantl during post-commit review of r209335.

llvm-svn: 209498

10 years agoUse short identifier.
Rui Ueyama [Fri, 23 May 2014 03:08:05 +0000 (03:08 +0000)]
Use short identifier.

llvm-svn: 209497

10 years agoMC: remove unnecessary restriction on tests
Saleem Abdulrasool [Fri, 23 May 2014 02:56:51 +0000 (02:56 +0000)]
MC: remove unnecessary restriction on tests

Rafael correctly pointed out that the restriction is unnecessary.  Although the
tests are intended to ensure that we dont abort due to an assertion, running the
tests in all modes is better since it also ensures that we dont crash without
assertions.  Always run these tests to ensure that we can handle invalid input
correctly.

llvm-svn: 209496

10 years ago[ARM64] Fix a bug in shuffle vector lowering to generate corect vext ISD with swapped...
Jiangning Liu [Fri, 23 May 2014 02:54:50 +0000 (02:54 +0000)]
[ARM64] Fix a bug in shuffle vector lowering to generate corect vext ISD with swapped input vectors.

llvm-svn: 209495

10 years agoFixed the Symbol code to resolve the callable address
Sean Callanan [Fri, 23 May 2014 02:30:48 +0000 (02:30 +0000)]
Fixed the Symbol code to resolve the callable address
of the symbol itself rather than forcing clients to do
it.  This simplifies the logic for the expression
parser a great deal.

<rdar://problem/16935324>

llvm-svn: 209494

10 years agoInstead of having an UnwindTable own a single assembly profiler,
Jason Molenda [Fri, 23 May 2014 01:48:10 +0000 (01:48 +0000)]
Instead of having an UnwindTable own a single assembly profiler,
and sharing it with all of its FuncUnwinders, have each FuncUnwinder
create an AssemblyProfiler on demand as needed.  I was worried that
the cost of creating the llvm disassemblers would be high for this
approach but it's not supposed to be an expensive operation, and it
means we don't need to add locks around this section of code.
<rdar://problem/16992332>

llvm-svn: 209493

10 years agoRevert r209488; Greg suggests a different approach.
Jason Molenda [Fri, 23 May 2014 01:42:56 +0000 (01:42 +0000)]
Revert r209488; Greg suggests a different approach.

llvm-svn: 209492

10 years agoClean DiagRanges. Fix a possible problem introduced in r209468.
Alexander Kornienko [Fri, 23 May 2014 01:37:30 +0000 (01:37 +0000)]
Clean DiagRanges. Fix a possible problem introduced in r209468.

llvm-svn: 209491

10 years agoAttempt to placate compilers that warn on casts between pointer-to-object and
Richard Smith [Fri, 23 May 2014 01:22:46 +0000 (01:22 +0000)]
Attempt to placate compilers that warn on casts between pointer-to-object and
pointer-to-function types.

llvm-svn: 209490

10 years agoFix a bug in xmmintrin.h.
Akira Hatanaka [Fri, 23 May 2014 00:38:07 +0000 (00:38 +0000)]
Fix a bug in xmmintrin.h.

The last step of _mm_cvtps_pi16 should use _mm_packs_pi32, which is a function
that reads two __m64 values and packs four 32-bit values into four 16-bit
values.

<rdar://problem/16873717>

llvm-svn: 209489

10 years agoThe UnwindTable (one per module) used to hand out shared pointers
Jason Molenda [Fri, 23 May 2014 00:08:09 +0000 (00:08 +0000)]
The UnwindTable (one per module) used to hand out shared pointers
to its unwind assembly profiler to all of the FuncUnwinders (one
per symbol) under it.  If lldb is running multiple targets, you
could get two different FuncUnwinders in the same Module trying
to use the same llvm disassembler simultaneously and that may be
a re-entrancy problem.

Instead, the UnwindTable has the unwind assembly profiler and when
the FuncUnwinders want to use it, they get exclusive access to
the assembly profiler until they're done using it.
<rdar://problem/16992332>

llvm-svn: 209488

10 years agoScalarEvolution: Fix handling of AddRecs in isKnownPredicate
Justin Bogner [Fri, 23 May 2014 00:06:56 +0000 (00:06 +0000)]
ScalarEvolution: Fix handling of AddRecs in isKnownPredicate

ScalarEvolution::isKnownPredicate() can wrongly reduce a comparison
when both the LHS and RHS are SCEVAddRecExprs. This checks that both
LHS and RHS are guarded in the case when both are SCEVAddRecExprs.

The test case is against indvars because I could not find a way to
directly test SCEV.

Patch by Sanjay Patel!

llvm-svn: 209487

10 years ago[PECOFF] Make a separate pass for /alternatename symbols.
Rui Ueyama [Fri, 23 May 2014 00:02:42 +0000 (00:02 +0000)]
[PECOFF] Make a separate pass for /alternatename symbols.

/alternatename is a command line option to define a weak alias. You
can use it as /alternatename:foo=bar to define "foo" as a weak alias
for "bar".

Because it's a command line option, the weak alias mapping is in the
LinkingContext object, and not in a object file being read.

Previously, we looked up the mapping each time we read a new symbol
from a file, to check if there is a weak alias defined for the symbol.
That's not wrong, but had made function signature's a bit complicated --
we had to pass the mapping object to many functions. Now their
parameter lists are much cleaner.

This also has another (unrealized) benefit. parseFile() now read a
file and then add alias symbols to the file. In the first pass a
LinkingContext object is not used at all. That should make it easy
to read files from archive files speculatively, as the first pass
is free from side effect.

llvm-svn: 209486

10 years agoMake sure SectionLoadHistory::GetCurrentSectionLoadList () is thread safe.
Greg Clayton [Thu, 22 May 2014 23:54:17 +0000 (23:54 +0000)]
Make sure SectionLoadHistory::GetCurrentSectionLoadList () is thread safe.

<rdar://problem/15818525>

llvm-svn: 209485

10 years agoDon't set unnamed_addr in CreateRuntimeVariable.
Rafael Espindola [Thu, 22 May 2014 23:33:27 +0000 (23:33 +0000)]
Don't set unnamed_addr in CreateRuntimeVariable.

This was fairly broken. For example,

@__dso_handle would or would not get an unnamed_addr depending on how many
global destructors were used in a translation unit.

The consensus was that not every runtime variable is unnamed_addr and that
__dso_handle handle should not be, so just don't add unnamed_addr in
CreateRuntimeVariable.

llvm-svn: 209484

10 years ago[Graph Writer] Limit the length of the graph name because Windows can't handle it.
Michael J. Spencer [Thu, 22 May 2014 23:32:18 +0000 (23:32 +0000)]
[Graph Writer] Limit the length of the graph name because Windows can't handle it.

Windows can't handle paths longer than 260 code points without \\?\. Even
with \\?\ it can't handle path components longer than 255 code points. So
limit graph names to the arbitrary length of 140. Random characters are still
added to the end, so it's ok if graph names collide.

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

llvm-svn: 209483

10 years agoAvoid allocating extra memory to handle the lazy definition data pointer for
Richard Smith [Thu, 22 May 2014 23:19:02 +0000 (23:19 +0000)]
Avoid allocating extra memory to handle the lazy definition data pointer for
CXXRecordDecls when modules is enabled.

llvm-svn: 209482

10 years agoMake these bool bitfields.
Eric Christopher [Thu, 22 May 2014 23:09:57 +0000 (23:09 +0000)]
Make these bool bitfields.

llvm-svn: 209481

10 years agoDon't reduce the stack protector level given -fstack-protector.
Rafael Espindola [Thu, 22 May 2014 22:57:39 +0000 (22:57 +0000)]
Don't reduce the stack protector level given -fstack-protector.

Before -fstack-protector would always force a level of 1, even if the default
was 2.

Patch by Brad Smith.

llvm-svn: 209479

10 years ago[RuntimeDyld] Teach RuntimeDyldMachO how to handle scattered VANILLA relocs on
Lang Hames [Thu, 22 May 2014 22:30:13 +0000 (22:30 +0000)]
[RuntimeDyld] Teach RuntimeDyldMachO how to handle scattered VANILLA relocs on
i386.

This fixes two more MCJIT regression tests on i386:

  ExecutionEngine/MCJIT/2003-05-06-LivenessClobber.ll
  ExecutionEngine/MCJIT/2013-04-04-RelocAddend.ll

The implementation of processScatteredVANILLA is tasteless (*ba-dum-ching*),
but I'm working on a substantial tidy-up of RuntimeDyldMachO that should
improve things.

This patch also fixes a type-o in RuntimeDyldMachO::processSECTDIFFRelocation,
and teaches that method to skip over the PAIR reloc following the SECTDIFF.

<rdar://problem/16961886>

llvm-svn: 209478

10 years agoUse error_code::success() instead of make_error_code(llvm::errc::success).
Alexander Kornienko [Thu, 22 May 2014 22:06:08 +0000 (22:06 +0000)]
Use error_code::success() instead of make_error_code(llvm::errc::success).

llvm-svn: 209477

10 years ago[TSan] ifdef out certain functions if 128-bit ints are not supported.
Alexey Samsonov [Thu, 22 May 2014 22:02:38 +0000 (22:02 +0000)]
[TSan] ifdef out certain functions if 128-bit ints are not supported.

llvm-svn: 209476

10 years agoMove alias symbols from ELFLinkingContext to LinkingContext.
Rui Ueyama [Thu, 22 May 2014 21:37:56 +0000 (21:37 +0000)]
Move alias symbols from ELFLinkingContext to LinkingContext.

Alias symbols are SimpleDefinedAtoms and are platform neutral. They
don't have to belong ELF. This patch is to make it available to all
platforms. No functionality change intended.

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

llvm-svn: 209475

10 years agoUnify the name of compiler-rt builtins library on Linux.
Alexey Samsonov [Thu, 22 May 2014 21:13:30 +0000 (21:13 +0000)]
Unify the name of compiler-rt builtins library on Linux.

Call it "libclang_rt.builtins-<arch>.a" to be consistent
with sanitizers/profile libraries naming. Modify Makefile
and CMake build systems and Clang driver accordingly.

Fixes PR19822.

llvm-svn: 209474

10 years agoUnify the name of compiler-rt builtins library on Linux.
Alexey Samsonov [Thu, 22 May 2014 21:12:43 +0000 (21:12 +0000)]
Unify the name of compiler-rt builtins library on Linux.

Call it "libclang_rt.builtins-<arch>.a" to be consistent
with sanitizers/profile libraries naming. Modify Makefile
and CMake build systems and Clang driver accordingly.

Fixes PR19822.

llvm-svn: 209473

10 years agoIf a class template specialization from one module has its definition
Richard Smith [Thu, 22 May 2014 20:59:29 +0000 (20:59 +0000)]
If a class template specialization from one module has its definition
instantiated in another module, and the instantiation uses a partial
specialization, include the partial specialization and its template arguments
in the update record. We'll need them if someone imports the second module and
tries to instantiate a member of the template.

llvm-svn: 209472

10 years agoDon't warn about undefined inline functions if they're dllexport/import
Hans Wennborg [Thu, 22 May 2014 20:45:53 +0000 (20:45 +0000)]
Don't warn about undefined inline functions if they're dllexport/import

llvm-svn: 209471

10 years agoUpdate the code according to the changes in r209468.
Alexander Kornienko [Thu, 22 May 2014 20:19:46 +0000 (20:19 +0000)]
Update the code according to the changes in r209468.

llvm-svn: 209470

10 years ago[mach-o] Fix so that mach-o semantic errors return an error rather than assert
Nick Kledzik [Thu, 22 May 2014 20:05:43 +0000 (20:05 +0000)]
[mach-o] Fix so that mach-o semantic errors return an error rather than assert

llvm-svn: 209469

10 years agoRemove limits on the number of fix-it hints and ranges in the DiagnosticsEngine.
Alexander Kornienko [Thu, 22 May 2014 19:56:11 +0000 (19:56 +0000)]
Remove limits on the number of fix-it hints and ranges in the DiagnosticsEngine.

Summary:
The limits on the number of fix-it hints and ranges attached to a
diagnostic are arbitrary and don't apply universally to all users of the
DiagnosticsEngine. The way the limits are enforced may lead to diagnostics
generating invalid sets of fixes. I suggest removing the limits, which will also
simplify the implementation.

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: klimek, cfe-commits

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

llvm-svn: 209468

10 years agoUpdate some AliasAnalysis pass docs for getAdjustedAnalysisPointer.
Eric Christopher [Thu, 22 May 2014 19:38:25 +0000 (19:38 +0000)]
Update some AliasAnalysis pass docs for getAdjustedAnalysisPointer.

Patch by George Burgess.

llvm-svn: 209467

10 years agoImproved location for non-constant initializers diagnostics.
Abramo Bagnara [Thu, 22 May 2014 19:20:46 +0000 (19:20 +0000)]
Improved location for non-constant initializers diagnostics.

llvm-svn: 209466

10 years agoForgot to add updated datalayout test
Matt Arsenault [Thu, 22 May 2014 18:57:49 +0000 (18:57 +0000)]
Forgot to add updated datalayout test

llvm-svn: 209465

10 years agoUpdate R600 datalayout
Matt Arsenault [Thu, 22 May 2014 18:33:55 +0000 (18:33 +0000)]
Update R600 datalayout

llvm-svn: 209464

10 years agoR600: Add definition for flat address space ID.
Matt Arsenault [Thu, 22 May 2014 18:27:07 +0000 (18:27 +0000)]
R600: Add definition for flat address space ID.

Use 4 since that's probably what it will be for spir.
Move ADDRESS_NONE to the end to keep the constant_buffer_* values
unchanged, since apparently a bunch of r600 tests use those directly.

llvm-svn: 209463

10 years agoR600: Try to convert BFE back to standard bit ops when possible.
Matt Arsenault [Thu, 22 May 2014 18:09:12 +0000 (18:09 +0000)]
R600: Try to convert BFE back to standard bit ops when possible.

This allows existing DAG combines to work on them, and then
we can re-match to BFE if necessary during instruction selection.

llvm-svn: 209462

10 years agoR600: Add dag combine for BFE
Matt Arsenault [Thu, 22 May 2014 18:09:07 +0000 (18:09 +0000)]
R600: Add dag combine for BFE

llvm-svn: 209461

10 years agoR600: Implement ComputeNumSignBitsForTargetNode for BFE
Matt Arsenault [Thu, 22 May 2014 18:09:03 +0000 (18:09 +0000)]
R600: Implement ComputeNumSignBitsForTargetNode for BFE

llvm-svn: 209460

10 years agoR600: Implement computeMaskedBitsForTargetNode for BFE
Matt Arsenault [Thu, 22 May 2014 18:09:00 +0000 (18:09 +0000)]
R600: Implement computeMaskedBitsForTargetNode for BFE

llvm-svn: 209459

10 years agoR600: Expand mul24 for GPUs without it
Matt Arsenault [Thu, 22 May 2014 18:00:24 +0000 (18:00 +0000)]
R600: Expand mul24 for GPUs without it

llvm-svn: 209458

10 years agoR600: Expand mad24 for GPUs without it
Matt Arsenault [Thu, 22 May 2014 18:00:20 +0000 (18:00 +0000)]
R600: Expand mad24 for GPUs without it

llvm-svn: 209457

10 years agoR600: Add intrinsics for mad24
Matt Arsenault [Thu, 22 May 2014 18:00:15 +0000 (18:00 +0000)]
R600: Add intrinsics for mad24

llvm-svn: 209456

10 years agoReturn false if we're not going to do anything.
Eric Christopher [Thu, 22 May 2014 17:49:33 +0000 (17:49 +0000)]
Return false if we're not going to do anything.

llvm-svn: 209455

10 years agoR600/SI: Move instruction pattern to instruction definition
Matt Arsenault [Thu, 22 May 2014 17:45:20 +0000 (17:45 +0000)]
R600/SI: Move instruction pattern to instruction definition

llvm-svn: 209454

10 years agoRemove LLVMContextImpl::optimizationRemarkEnabledFor.
Diego Novillo [Thu, 22 May 2014 17:19:01 +0000 (17:19 +0000)]
Remove LLVMContextImpl::optimizationRemarkEnabledFor.

Summary:
This patch moves the handling of -pass-remarks* over to
lib/DiagnosticInfo.cpp. This allows the removal of the
optimizationRemarkEnabledFor functions from LLVMContextImpl, as they're
not needed anymore.

Reviewers: qcolombet

Subscribers: llvm-commits

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

llvm-svn: 209453

10 years agoAdded gdbremote protocol test for $p and returned data size.
Todd Fiala [Thu, 22 May 2014 17:18:18 +0000 (17:18 +0000)]
Added gdbremote protocol test for $p and returned data size.

Each register returned by $qRegisterInfo is tested that it's
$p register read returns a representation that is the correct byte size
as indicated by $qRegisterInfo.

Currently enabled for debugserver, disabled for llgs.

The llgs branch will use this to verify $p implementation.

llvm-svn: 209452

10 years ago[X86] Improve the lowering of BITCAST from MVT::f64 to MVT::v4i16/MVT::v8i8.
Andrea Di Biagio [Thu, 22 May 2014 16:21:39 +0000 (16:21 +0000)]
[X86] Improve the lowering of BITCAST from MVT::f64 to MVT::v4i16/MVT::v8i8.

This patch teaches the x86 backend how to efficiently lower ISD::BITCAST dag
nodes from MVT::f64 to MVT::v4i16 (and vice versa), and from MVT::f64 to
MVT::v8i8 (and vice versa).

This patch extends the logic from revision 208107 to also handle MVT::v4i16
and MVT::v8i8. Also, this patch correctly propagates Undef values when
performing the widening of a vector (example: when widening from v2i32 to
v4i32, the upper 64bits of the resulting vector are 'undef').

llvm-svn: 209451

10 years agoAdd clang-tidy -line-filter option to filter findings by line ranges.
Alexander Kornienko [Thu, 22 May 2014 16:07:11 +0000 (16:07 +0000)]
Add clang-tidy -line-filter option to filter findings by line ranges.

Summary:
This is going to be used for a clang-tidy-diff script to display
warnings in changed lines only. The option uses JSON, as its value is not
intended to be entered manually.

Reviewers: klimek

Reviewed By: klimek

Subscribers: cfe-commits

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

llvm-svn: 209450

10 years agoAn inline function redeclaration does not drop the dllimport attribute
Hans Wennborg [Thu, 22 May 2014 15:46:15 +0000 (15:46 +0000)]
An inline function redeclaration does not drop the dllimport attribute

llvm-svn: 209449

10 years agoQuick-fix a copy-and-paste mistake in one of the ASan test
Timur Iskhodzhanov [Thu, 22 May 2014 15:14:05 +0000 (15:14 +0000)]
Quick-fix a copy-and-paste mistake in one of the ASan test

llvm-svn: 209448

10 years agoclang-format: Add basic test for -style=none.
Daniel Jasper [Thu, 22 May 2014 15:13:48 +0000 (15:13 +0000)]
clang-format: Add basic test for -style=none.

llvm-svn: 209447

10 years agoclang-format: Introduce DisableFormat that prevents formatting.
Daniel Jasper [Thu, 22 May 2014 15:12:22 +0000 (15:12 +0000)]
clang-format: Introduce DisableFormat that prevents formatting.

And "none" pseudo-style indicating that formatting should be not
applied.

(1) Using .clang-format with "DisableFormat: true" effectively prevents
formatting for all files within the folder containing such .clang-format
file.

(2) Using -fallback-style=none together with -style=file prevents
formatting when .clang-format is not found, which can be used in on-save
callback.

Patch by Adam Strzelecki. Thank you!

llvm-svn: 209446

10 years ago[asan] relax the test for long double
Kostya Serebryany [Thu, 22 May 2014 14:50:14 +0000 (14:50 +0000)]
[asan] relax the test for long double

llvm-svn: 209445

10 years ago[ASan/Win] Make sure the list of wrappers exported by the main module and imported...
Timur Iskhodzhanov [Thu, 22 May 2014 14:49:56 +0000 (14:49 +0000)]
[ASan/Win] Make sure the list of wrappers exported by the main module and imported by the DLL thunk always matches

llvm-svn: 209444

10 years agoARM64: remove '#' from annotation of add/sub immediate
Tim Northover [Thu, 22 May 2014 14:20:05 +0000 (14:20 +0000)]
ARM64: remove '#' from annotation of add/sub immediate

The full string used to be "// =#12" for example, which looks too
busy.

llvm-svn: 209443

10 years agoAdd support for missed and analysis optimization remarks.
Diego Novillo [Thu, 22 May 2014 14:19:46 +0000 (14:19 +0000)]
Add support for missed and analysis optimization remarks.

Summary:
This adds two new diagnostics: -pass-remarks-missed and
-pass-remarks-analysis. They take the same values as -pass-remarks but
are intended to be triggered in different contexts.

-pass-remarks-missed is used by LLVMContext::emitOptimizationRemarkMissed,
which passes call when they tried to apply a transformation but
couldn't.

-pass-remarks-analysis is used by LLVMContext::emitOptimizationRemarkAnalysis,
which passes call when they want to inform the user about analysis
results.

The patch also:

1- Adds support in the inliner for the two new remarks and a
   test case.

2- Moves emitOptimizationRemark* functions to the llvm namespace.

3- Adds an LLVMContext argument instead of making them member functions
   of LLVMContext.

Reviewers: qcolombet

Subscribers: llvm-commits

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

llvm-svn: 209442

10 years ago[ASan/Win] Thread more library functions from the DLL thunk to the main module
Timur Iskhodzhanov [Thu, 22 May 2014 13:57:22 +0000 (13:57 +0000)]
[ASan/Win] Thread more library functions from the DLL thunk to the main module

llvm-svn: 209441

10 years agoclang-format: Don't use Allman brace breaking for ObjC blocks.
Daniel Jasper [Thu, 22 May 2014 13:53:55 +0000 (13:53 +0000)]
clang-format: Don't use Allman brace breaking for ObjC blocks.

It just seems wrong. This fixes llvm.org/PR19736.

llvm-svn: 209440

10 years ago[ASan/Win] Add more tests for operator new[]
Timur Iskhodzhanov [Thu, 22 May 2014 13:28:27 +0000 (13:28 +0000)]
[ASan/Win] Add more tests for operator new[]

llvm-svn: 209439

10 years agoclang-format: Fix corner case in AllowShortBlocksOnASingleLine.
Daniel Jasper [Thu, 22 May 2014 13:25:26 +0000 (13:25 +0000)]
clang-format: Fix corner case in AllowShortBlocksOnASingleLine.

Before:
  template <int> struct A4 { A4() { }
  };

After:
  template <int i> struct A4 {
    A4() {}
  };

This fixes llvm.org/PR19813 (at least the part that isn't working as
intended).

llvm-svn: 209438

10 years agoMachO: look for nearby tools on all MachO platforms.
Tim Northover [Thu, 22 May 2014 13:12:14 +0000 (13:12 +0000)]
MachO: look for nearby tools on all MachO platforms.

This brings "-arch armv7m" (etc) behaviour more in line with what's expected
for developers on OS X, and allows Clang to find an "ld" (for example) in the
same directory instead of using the default /usr/bin/ld.

Unfortunately no test because it relies on the specific place Clang is running
from.

rdar://problem/16427320

llvm-svn: 209437

10 years agoSegmented stacks: omit __morestack call when there's no frame.
Tim Northover [Thu, 22 May 2014 13:03:43 +0000 (13:03 +0000)]
Segmented stacks: omit __morestack call when there's no frame.

Patch by Florian Zeitz

llvm-svn: 209436

10 years agoRevert "TMP"
Tim Northover [Thu, 22 May 2014 12:55:29 +0000 (12:55 +0000)]
Revert "TMP"

This reverts r209433. Sorry about that, it needs a test & better message.

llvm-svn: 209435

10 years agoMachO: perform ARM ABI detection even for non-Darwin triples.
Tim Northover [Thu, 22 May 2014 12:54:30 +0000 (12:54 +0000)]
MachO: perform ARM ABI detection even for non-Darwin triples.

When "-arch armv7m" is specified, we want "aapcs", for example.

rdar://problem/16581138

llvm-svn: 209434

10 years agoTMP
Tim Northover [Thu, 22 May 2014 12:54:24 +0000 (12:54 +0000)]
TMP

llvm-svn: 209433

10 years agoUse stack protector strong by default on OpenBSD.
Rafael Espindola [Thu, 22 May 2014 12:52:35 +0000 (12:52 +0000)]
Use stack protector strong by default on OpenBSD.

Use stack protector strong by default to match the base OS and ports/packages
compiler policy.

Patch by Brad Smith.

llvm-svn: 209432

10 years agoclang-format: Fix braced list detection.
Daniel Jasper [Thu, 22 May 2014 12:46:38 +0000 (12:46 +0000)]
clang-format: Fix braced list detection.

Before:
  static_assert(std::is_integral<int> {} + 0, "");
  int a = std::is_integral<int> {}
  + 0;

After:
  static_assert(std::is_integral<int>{} + 0, "");
  int a = std::is_integral<int>{} + 0;

llvm-svn: 209431

10 years agoARM64: these work too
Tim Northover [Thu, 22 May 2014 12:14:49 +0000 (12:14 +0000)]
ARM64: these work too

llvm-svn: 209430

10 years agoYes they do
Tim Northover [Thu, 22 May 2014 12:14:02 +0000 (12:14 +0000)]
Yes they do

llvm-svn: 209429

10 years agoclang-format: Fix incorrect braced init identification.
Daniel Jasper [Thu, 22 May 2014 12:11:13 +0000 (12:11 +0000)]
clang-format: Fix incorrect braced init identification.

Before:
  int foo(int i) {
    return fo1 {}
    (i);
  }
  int foo(int i) {
    return fo1 {}
    (i);
  }

After:
  int foo(int i) { return fo1{}(i); }
  int foo(int i) { return fo1{}(i); }

This fixes llvm.org/PR19812.

llvm-svn: 209428

10 years ago[ASan/Win] Use the new function interception approach to handle function wrappers...
Timur Iskhodzhanov [Thu, 22 May 2014 12:03:40 +0000 (12:03 +0000)]
[ASan/Win] Use the new function interception approach to handle function wrappers too; wrap strlen() in DLLs

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

llvm-svn: 209427

10 years agoARM64: model pre/post-indexed operations properly.
Tim Northover [Thu, 22 May 2014 11:56:20 +0000 (11:56 +0000)]
ARM64: model pre/post-indexed operations properly.

We should be keeping track of the writeback on these instructions,
otherwise we're relying on LLVM's stupidity for correct code.

Fortunately, the MC layer can now handle all required constraints,
which means we can get rid of the CodeGen only PseudoInsts too.

llvm-svn: 209426

10 years agoARM64: separate load/store operands to simplify assembler
Tim Northover [Thu, 22 May 2014 11:56:09 +0000 (11:56 +0000)]
ARM64: separate load/store operands to simplify assembler

This changes ARM64 to use separate operands for each component of an
address, and look for separate '[', '$Rn, ..., ']' tokens when
parsing.

This allows us to do away with quite a bit of special C++ code to
handle monolithic "addressing modes" in the MC components. The more
incremental matching of the assembler operands also allows for better
diagnostics when LLVM is presented with invalid input.

Most of the complexity here is with the register-offset instructions,
which were extremely dodgy beforehand: even when the instruction used
wM, LLVM's model had xM as an operand. We papered over this
discrepancy before, but that approach doesn't work now so I split them
into separate X and W variants.

llvm-svn: 209425

10 years ago[mips] Make unalignedload.ll test stricter and easier to modify for MIPS32r6/MIPS64r6
Daniel Sanders [Thu, 22 May 2014 11:55:04 +0000 (11:55 +0000)]
[mips] Make unalignedload.ll test stricter and easier to modify for MIPS32r6/MIPS64r6

Summary:
* Split into two functions, one to test each struct.
* R0 and R2 must be defined by an lw with a %got reference to the correct
  symbol.
* Test for $4 (first argument) where appropriate instead of accepting any
  register.
* Test that the two lbu's are correctly combined into $4

Depends on D3844

Reviewers: jkolek, zoran.jovanovic, vmedic

Reviewed By: vmedic

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

llvm-svn: 209424

10 years ago[mips] Change lwl and lwr in inlineasm_constraint.ll to lw
Daniel Sanders [Thu, 22 May 2014 11:51:06 +0000 (11:51 +0000)]
[mips] Change lwl and lwr in inlineasm_constraint.ll to lw

Summary:
lwl and lwr are not available in MIPS32r6/MIPS64r6. The purpose of the test
is to check that the '$1' expands to '0($x)' rather than to test something related
to the lwl or lwr instructions so we can simply switch to lw.

Depends on D3842

Reviewers: jkolek, zoran.jovanovic, vmedic

Reviewed By: vmedic

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

llvm-svn: 209423

10 years agoclang-format: Store pointers to seen formatting states.
Daniel Jasper [Thu, 22 May 2014 11:47:01 +0000 (11:47 +0000)]
clang-format: Store pointers to seen formatting states.

As the memory ownership is handled by the SpecificBumpPtrAllocator
anyway, there is no need to duplicate states when inserting them into
the Seen-set. This leads to an improvement of ~10% on the benchmark
formatting file.

No functional changes intended.

llvm-svn: 209422

10 years ago[mips] Use addiu in inline assembly tests since addi is not available in all ISA's
Daniel Sanders [Thu, 22 May 2014 11:46:58 +0000 (11:46 +0000)]
[mips] Use addiu in inline assembly tests since addi is not available in all ISA's

Summary:
This patch is necessary so that they do not fail on MIPS32r6/MIPS64r6 when
-integrated-as is enabled by default and we correctly detect the host CPU.

No functional change since these tests are testing the behaviour of the
constraint used for the third operand rather than the mnemonic.

Depends on D3842

Reviewers: zoran.jovanovic, jkolek, vmedic

Reviewed By: vmedic

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

llvm-svn: 209421

10 years agoExtend sys::getHostCPUFeatures to work on AArch64 platforms
Bradley Smith [Thu, 22 May 2014 11:44:34 +0000 (11:44 +0000)]
Extend sys::getHostCPUFeatures to work on AArch64 platforms

llvm-svn: 209420

10 years ago[mips][mips64r6] addi is not available on MIPS32r6/MIPS64r6
Daniel Sanders [Thu, 22 May 2014 11:42:31 +0000 (11:42 +0000)]
[mips][mips64r6] addi is not available on MIPS32r6/MIPS64r6

Summary: Depends on D3787. Tablegen will raise an assertion without it.

Reviewers: zoran.jovanovic, jkolek, vmedic

Reviewed By: vmedic

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

llvm-svn: 209419

10 years ago[mips][mips64r6] Test that paired single instructions are invalid
Daniel Sanders [Thu, 22 May 2014 11:37:38 +0000 (11:37 +0000)]
[mips][mips64r6] Test that paired single instructions are invalid

Summary:
These emit the 'unknown instruction' instead of the correct error
because they have not been implemented in LLVM for any MIPS ISA.

Reviewers: jkolek, zoran.jovanovic, vmedic

Reviewed By: vmedic

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

llvm-svn: 209418

10 years agoclang-format: Fix vim-integration for empty files.
Daniel Jasper [Thu, 22 May 2014 11:37:05 +0000 (11:37 +0000)]
clang-format: Fix vim-integration for empty files.

Discovered by Ahmed Charles in http://reviews.llvm.org/D3018.

llvm-svn: 209417

10 years ago[ASan/Win] Don't use INTERCEPTOR_ATTRIBUTE for operator new/delete on Windows
Timur Iskhodzhanov [Thu, 22 May 2014 11:31:21 +0000 (11:31 +0000)]
[ASan/Win] Don't use INTERCEPTOR_ATTRIBUTE for operator new/delete on Windows

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

llvm-svn: 209416

10 years ago[mips][mips64r6] Add b[on]vc
Daniel Sanders [Thu, 22 May 2014 11:23:21 +0000 (11:23 +0000)]
[mips][mips64r6] Add b[on]vc

Summary:
This required me to implement the disassembler for MIPS64r6 since the encodings
are ambiguous with other instructions. This in turn revealed a few
assembly/disassembly bugs which I have fixed.

* da[ht]i only take two operands according to the spec, not three.
* DecodeBranchTarget2[16] correctly handles wider immediates than simm16
  * Also made non-functional change to DecodeBranchTarget and
    DecodeBranchTargetMM to keep implementation style consistent between
    them.
* Difficult encodings are handled by a custom decode method on the most
  general encoding in the group. This method will convert the MCInst to a
  different opcode if necessary.

DecodeBranchTarget is not currently the inverse of getBranchTargetOpValue
so disassembling some branch instructions emit incorrect output. This seems
to affect branches with delay slots on all MIPS ISA's. I've left this bug
for now and temporarily removed the check for the immediate on
bc[12]eqz/bc[12]nez in the MIPS32r6/MIPS64r6 tests.

jialc and jic crash the disassembler for some reason. I've left these
instructions commented out for the moment.

Depends on D3760

Reviewers: jkolek, zoran.jovanovic, vmedic

Reviewed By: vmedic

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

llvm-svn: 209415

10 years ago[ASan/Win] Add a comment about DCL-using-static vs threads
Timur Iskhodzhanov [Thu, 22 May 2014 10:24:48 +0000 (10:24 +0000)]
[ASan/Win] Add a comment about DCL-using-static vs threads

llvm-svn: 209414

10 years agoclang-format: [JS] Understand line breaks in concatenated strings.
Daniel Jasper [Thu, 22 May 2014 09:10:04 +0000 (09:10 +0000)]
clang-format: [JS] Understand line breaks in concatenated strings.

Before:
  var literal = 'hello ' + 'world';

After:
  var literal = 'hello ' +
                'world';

There is no reason to concatenated two string literals with a '+' unless
the line break is intended.

llvm-svn: 209413

10 years agoclang-format: Correctly identify multiplications in braces init lists.
Daniel Jasper [Thu, 22 May 2014 09:00:33 +0000 (09:00 +0000)]
clang-format: Correctly identify multiplications in braces init lists.

Before:
  int i{a *b};

After:
  int i{a * b};

Also fix unrelated issue where braced init lists were counted as blocks
and prevented single-line functions.

llvm-svn: 209412

10 years agoThis patch adds a helper class (CGLoopInfo) for marking memory instructions with...
Alexander Musman [Thu, 22 May 2014 08:54:05 +0000 (08:54 +0000)]
This patch adds a helper class (CGLoopInfo) for marking memory instructions with llvm.mem.parallel_loop_access metadata.
It also adds a simple initial version of codegen for pragma omp simd (it will change in the future to support all the clauses).

Differential revision: http://reviews.llvm.org/D3644

llvm-svn: 209411

10 years agoclang-format: Correctly calculate line lenghts for nest blocks.
Daniel Jasper [Thu, 22 May 2014 08:36:53 +0000 (08:36 +0000)]
clang-format: Correctly calculate line lenghts for nest blocks.

If simple (one-statement) blocks can be inlined, the length needs to be
calculated correctly.

Before (in JavaScript but this also affects lambdas, etc.):
  var x = {
    valueOf: function() { return 1; }
  };

After:
  var x = {valueOf: function() { return 1; }};

llvm-svn: 209410

10 years agoARM64: assert if we see i64 -> i64 extend in the DAG.
Tim Northover [Thu, 22 May 2014 07:41:37 +0000 (07:41 +0000)]
ARM64: assert if we see i64 -> i64 extend in the DAG.

Should be no change in behaviour, but it makes the intended
functionality a bit clearer and means we only have to reason about
real extend operations.

llvm-svn: 209409

10 years agoAArch64/ARM64: enable more AArch64 tests.
Tim Northover [Thu, 22 May 2014 07:40:55 +0000 (07:40 +0000)]
AArch64/ARM64: enable more AArch64 tests.

llvm-svn: 209408

10 years agoFrontend: Propagate ASTReaderListener API in ChainedASTReaderListener
Justin Bogner [Thu, 22 May 2014 06:04:59 +0000 (06:04 +0000)]
Frontend: Propagate ASTReaderListener API in ChainedASTReaderListener

ASTReaderListener's documentation states that visitInputFile will be
called based on the return values of needsInputFileVisitation and
needsSystemInputFileVisitation, but ChainedASTReaderListener may call
these methods on a child listener based on the values returned by the
other child.

Even worse, the calls to visitInputFile may be short-circuited due to
the use of the boolean or, so the calls to visit may not occur at all
for the second listener.

This updates ChainedASTReaderListener::visitInputFile to propagate the
ASTReaderListener behaviour to both children.

llvm-svn: 209394

10 years agoMC: initialise MCAsmParser variable
Saleem Abdulrasool [Thu, 22 May 2014 06:02:59 +0000 (06:02 +0000)]
MC: initialise MCAsmParser variable

Properly initialise HadError to false during construction.  Detected as
use-of-uninitialised variable by MSan!

llvm-svn: 209393

10 years ago[C++11] Use 'nullptr'. Serialization edition.
Craig Topper [Thu, 22 May 2014 05:54:18 +0000 (05:54 +0000)]
[C++11] Use 'nullptr'. Serialization edition.

llvm-svn: 209392

10 years agoRemove unused variable.
Eric Christopher [Thu, 22 May 2014 05:33:03 +0000 (05:33 +0000)]
Remove unused variable.

llvm-svn: 209391

10 years agoARM: introduce llvm.arm.undefined intrinsic
Saleem Abdulrasool [Thu, 22 May 2014 04:46:46 +0000 (04:46 +0000)]
ARM: introduce llvm.arm.undefined intrinsic

This intrinsic permits the emission of platform specific undefined sequences.
ARM has reserved the 0xde opcode which takes a single integer parameter (ignored
by the CPU).  This permits the operating system to implement custom behaviour on
this trap.  The llvm.arm.undefined intrinsic is meant to provide a means for
generating the target specific behaviour from the frontend.  This is
particularly useful for Windows on ARM which has made use of a series of these
special opcodes.

llvm-svn: 209390

10 years ago[C++11] Use 'nullptr'. Frontend edition.
Craig Topper [Thu, 22 May 2014 04:46:25 +0000 (04:46 +0000)]
[C++11] Use 'nullptr'. Frontend edition.

llvm-svn: 209389

10 years agoR600/SI: Match fp_to_uint / uint_to_fp for f64
Matt Arsenault [Thu, 22 May 2014 03:20:30 +0000 (03:20 +0000)]
R600/SI: Match fp_to_uint / uint_to_fp for f64

llvm-svn: 209388

10 years agoMC: formalise some assertions into proper errors
Saleem Abdulrasool [Thu, 22 May 2014 02:18:10 +0000 (02:18 +0000)]
MC: formalise some assertions into proper errors

Now that clang can be used as an assembler via the IAS, invalid assembler inputs
would cause the assertions to trigger.  Although we cannot recover from the
errors here, nor provide caret diagnostics, attempt to handle them slightly more
gracefully by reporting a fatal error.

llvm-svn: 209387

10 years agoOverride runOnMachineFunction for ARMISelDAGToDAG so that we can
Eric Christopher [Thu, 22 May 2014 02:00:27 +0000 (02:00 +0000)]
Override runOnMachineFunction for ARMISelDAGToDAG so that we can
reset the subtarget on each function.

llvm-svn: 209386