platform/upstream/llvm.git
7 years agoFixes for r287241. Use placement new. Apply clang-format.
Malcolm Parsons [Thu, 17 Nov 2016 21:00:09 +0000 (21:00 +0000)]
Fixes for r287241. Use placement new. Apply clang-format.

llvm-svn: 287258

7 years agoAllow SIZEOF() command on nonexistent section.
Rui Ueyama [Thu, 17 Nov 2016 20:27:10 +0000 (20:27 +0000)]
Allow SIZEOF() command on nonexistent section.

Linker script doesn't create a section if it has no content. So the following
script doesn't create .norelocs section if it doesn't have any .rel* sections.

  .norelocs : { *(.rel*) }

Later, if you assert that the size of .norelocs is 0, LLD printed out
an error message, because it didn't allow calling SIZEOF() on nonexistent
sections.

This patch allows SIZEOF() on nonexistent sections, so that you can do
something like this.

  ASSERT(SIZEOF(.norelocs), "shouldn't contain .rel sections!")

Note that this behavior is compatible with GNU.

Differential Revision: https://reviews.llvm.org/D26810

llvm-svn: 287257

7 years ago[CMake] Error when LTO and lld are enabled on Darwin
Petr Hosek [Thu, 17 Nov 2016 20:22:49 +0000 (20:22 +0000)]
[CMake] Error when LTO and lld are enabled on Darwin

lld on Darwin does not currently support LTO.

Differential Revision: https://reviews.llvm.org/D26715

llvm-svn: 287256

7 years agoWorkaround compilers w/o C++1z inline variables
Eric Fiselier [Thu, 17 Nov 2016 20:08:43 +0000 (20:08 +0000)]
Workaround compilers w/o C++1z inline variables

llvm-svn: 287255

7 years agoAdd single quotes to error messages.
Rui Ueyama [Thu, 17 Nov 2016 19:57:47 +0000 (19:57 +0000)]
Add single quotes to error messages.

llvm-svn: 287254

7 years agoUse consistent variable name.
Rui Ueyama [Thu, 17 Nov 2016 19:57:45 +0000 (19:57 +0000)]
Use consistent variable name.

llvm-svn: 287253

7 years agoUse llvm::reverse to get a reverse range.
Rui Ueyama [Thu, 17 Nov 2016 19:57:43 +0000 (19:57 +0000)]
Use llvm::reverse to get a reverse range.

llvm-svn: 287252

7 years agoRemove files missed in r287250
Eric Fiselier [Thu, 17 Nov 2016 19:24:34 +0000 (19:24 +0000)]
Remove files missed in r287250

llvm-svn: 287251

7 years agoImplement P0504R0: Revisiting in-place tag types for any/optional/variant
Eric Fiselier [Thu, 17 Nov 2016 19:24:04 +0000 (19:24 +0000)]
Implement P0504R0: Revisiting in-place tag types for any/optional/variant

llvm-svn: 287250

7 years agoTest changes for P0504R0 "Revisiting in-place tag types for any/optional/variant...
Eric Fiselier [Thu, 17 Nov 2016 19:23:35 +0000 (19:23 +0000)]
Test changes for P0504R0 "Revisiting in-place tag types for any/optional/variant". Patch from Casey Carter

llvm-svn: 287249

7 years agoFix spelling mistakes in Hexagon target comments. NFC.
Simon Pilgrim [Thu, 17 Nov 2016 19:21:20 +0000 (19:21 +0000)]
Fix spelling mistakes in Hexagon target comments. NFC.

Identified by Pedro Giffuni in PR27636.

llvm-svn: 287248

7 years agoFix spelling mistakes in X86 target comments. NFC.
Simon Pilgrim [Thu, 17 Nov 2016 19:03:05 +0000 (19:03 +0000)]
Fix spelling mistakes in X86 target comments. NFC.

Identified by Pedro Giffuni in PR27636.

llvm-svn: 287247

7 years ago[asan] Create a .ASAN$G(A-Z) section for global registration
Reid Kleckner [Thu, 17 Nov 2016 19:02:53 +0000 (19:02 +0000)]
[asan] Create a .ASAN$G(A-Z) section for global registration

Summary:
The expectation is that new instrumented code will add global variable
metadata to the .ASAN$GL section, and we will use this new code to
iterate over it.

This technique seems to break when using incremental linking, which
seems to align every global to a 256 byte boundary. Presumably this is
so that it can incrementally cope with global changing size. Clang
already passes -incremental:no as a linker flag when you invoke it to do
the link step.

The two tests added for this feature will fail until the LLVM
instrumentation change in D26770 lands, so they are marked XFAIL for
now.

Reviewers: pcc, kcc, mehdi_amini, kubabrecka

Subscribers: llvm-commits, mgorny

Differential Revision: https://reviews.llvm.org/D26771

llvm-svn: 287246

7 years ago[tests] Use __SSE2__ (rather than __i686__...) for SSE2 ASAN test
Michal Gorny [Thu, 17 Nov 2016 18:41:54 +0000 (18:41 +0000)]
[tests] Use __SSE2__ (rather than __i686__...) for SSE2 ASAN test

Use the __SSE2__ to determine whether SSE2 is enabled in the ASAN tests
rather than relying on either of the __i686__ and __x86_64__. The former
is only set with explicit -march=i686, and therefore misses most of
the x86 CPUs that support SSE2. __SSE2__ is in turn defined if
the current settings (-march, -msse2) indicate that SSE2 is supported
which should be more reliable.

Differential Revision: https://reviews.llvm.org/D26763

llvm-svn: 287245

7 years agoObjC Module: try to make objc module deterministic.
Manman Ren [Thu, 17 Nov 2016 18:41:18 +0000 (18:41 +0000)]
ObjC Module: try to make objc module deterministic.

Make sure that comparing selectors in DeclarationName does its job.
rdar://problem/28988750

llvm-svn: 287244

7 years ago[CodeView] Fix some Clang-tidy modernize-use-default, modernize-use-override and...
Eugene Zelenko [Thu, 17 Nov 2016 18:11:21 +0000 (18:11 +0000)]
[CodeView] Fix some Clang-tidy modernize-use-default, modernize-use-override and Include What You Use warnings; other minor fixes (NFC).

Per Zachary Turner and Mehdi Amini suggestion to make only post-commit reviews.

llvm-svn: 287243

7 years agoRewrite all Property related functions in terms of StringRef.
Zachary Turner [Thu, 17 Nov 2016 18:08:12 +0000 (18:08 +0000)]
Rewrite all Property related functions in terms of StringRef.

This was a bit tricky, especially for things like
OptionValueArray and OptionValueDictionary since they do some
funky string parsing.  Rather than try to re-write line-by-line
I tried to make the StringRef usage idiomatic, even though
it meant often re-writing from scratch large blocks of code
in a different way while keeping true to the original intent.

The finished code is a big improvement though, and often much
shorter than the original code.  All tests and unit tests
pass on Windows and Linux.

llvm-svn: 287242

7 years agoUse unique_ptr for cached tokens for default arguments in C++.
Malcolm Parsons [Thu, 17 Nov 2016 17:52:58 +0000 (17:52 +0000)]
Use unique_ptr for cached tokens for default arguments in C++.

Summary:
This changes pointers to cached tokens for default arguments in C++ from raw pointers to unique_ptrs.  There was a fixme in the code where the cached tokens are created  about using a smart pointer.

The change is straightforward, though I did have to track down and fix a memory corruption caused by the change.  memcpy was being used to copy parameter information.  This duplicated the unique_ptr, which led to the cached token buffer being deleted prematurely.

Patch by David Tarditi!

Reviewers: malcolm.parsons

Subscribers: arphaman, malcolm.parsons, cfe-commits

Differential Revision: https://reviews.llvm.org/D26435

llvm-svn: 287241

7 years ago[libFuzzer] better documentation for -fsanitize-coverage=trace-cmp
Kostya Serebryany [Thu, 17 Nov 2016 17:31:54 +0000 (17:31 +0000)]
[libFuzzer] better documentation for -fsanitize-coverage=trace-cmp

llvm-svn: 287240

7 years agoSema: correct typo correction for ivars in @implementation
Saleem Abdulrasool [Thu, 17 Nov 2016 17:10:54 +0000 (17:10 +0000)]
Sema: correct typo correction for ivars in @implementation

The previous typo correction handling assumed that ivars are only declared in
the interface declaration rather than as a private ivar in the implementation.
Adjust the handling to permit both interfaces.  Assert earlier that the
interface has been acquired to ensure that we can identify when both possible
casts have failed.

Addresses PR31040!

llvm-svn: 287238

7 years agoEnable -threads by default.
Rui Ueyama [Thu, 17 Nov 2016 17:06:51 +0000 (17:06 +0000)]
Enable -threads by default.

LLD supports multi-threading, and it seems to be working well as
you can see in r287140. In short, LLD runs a few percent to 30%
faster with -threads and more than 50% faster if you are using
-build-id (your mileage may vary depending on your computer).

However, I don't think most users even don't know about that because
-threads is not a default option.

This patch enables it by default.

Discussion thread:
http://lists.llvm.org/pipermail/llvm-dev/2016-November/107160.html

llvm-svn: 287237

7 years ago[asan] Update the tests as Mach-O metadata liveness tracking is on by default
Anna Zaks [Thu, 17 Nov 2016 16:56:11 +0000 (16:56 +0000)]
[asan] Update the tests as Mach-O metadata liveness tracking is on by default

This commit reverts r274579.

llvm-svn: 287236

7 years ago[asan] Turn on Mach-O global metadata liveness tracking by default
Anna Zaks [Thu, 17 Nov 2016 16:55:40 +0000 (16:55 +0000)]
[asan] Turn on Mach-O global metadata liveness tracking by default

This patch turns on the metadata liveness tracking since all known issues
have been resolved. The future has been implemented in
https://reviews.llvm.org/D16737 and enables support of dead code stripping
option on Mach-O platforms.

As part of enabling the feature, I also plan on reverting the following
patch to compiler-rt:

http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20160704/369910.html

Differential Revision: https://reviews.llvm.org/D26772

llvm-svn: 287235

7 years agoPass StringRefs instead of StringMatcher because it's simpler.
Rui Ueyama [Thu, 17 Nov 2016 16:48:53 +0000 (16:48 +0000)]
Pass StringRefs instead of StringMatcher because it's simpler.

llvm-svn: 287234

7 years agoRevert "AMDGPU: Enable ConstrainCopy DAG mutation"
Konstantin Zhuravlyov [Thu, 17 Nov 2016 16:41:49 +0000 (16:41 +0000)]
Revert "AMDGPU: Enable ConstrainCopy DAG mutation"

This reverts commit r287146.

This breaks few conformance tests.

llvm-svn: 287233

7 years ago[SCEV] limit recursion depth of CompareSCEVComplexity
Daniil Fukalov [Thu, 17 Nov 2016 16:07:52 +0000 (16:07 +0000)]
[SCEV] limit recursion depth of CompareSCEVComplexity

Summary:
CompareSCEVComplexity goes too deep (50+ on a quite a big unrolled loop) and runs almost infinite time.

Added cache of "equal" SCEV pairs to earlier cutoff of further estimation. Recursion depth limit was also introduced as a parameter.

Reviewers: sanjoy

Subscribers: mzolotukhin, tstellarAMD, llvm-commits

Differential Revision: https://reviews.llvm.org/D26389

llvm-svn: 287232

7 years agoSimplify. NFC.
Rafael Espindola [Thu, 17 Nov 2016 15:29:11 +0000 (15:29 +0000)]
Simplify. NFC.

llvm-svn: 287231

7 years ago[include-fixer] Add a test for the full round trip through libclang and the plugin.
Benjamin Kramer [Thu, 17 Nov 2016 15:23:06 +0000 (15:23 +0000)]
[include-fixer] Add a test for the full round trip through libclang and the plugin.

llvm-svn: 287230

7 years agoLink include-fixer into libclang if clang-tools-extra is checked out.
Benjamin Kramer [Thu, 17 Nov 2016 15:22:36 +0000 (15:22 +0000)]
Link include-fixer into libclang if clang-tools-extra is checked out.

include-fixer only slightly bloats the size of libclang, but since
libclang has no explicit plugin mechanism it's the only way of getting
this to work. Clang-tidy is already there and so far there weren't many
complaints ;)

This is designed to be easy to remove again if libclang ever grows
proper plugin support.

llvm-svn: 287229

7 years ago[include-fixer] Refactor include fixer to be usable as a plugin
Benjamin Kramer [Thu, 17 Nov 2016 15:16:05 +0000 (15:16 +0000)]
[include-fixer] Refactor include fixer to be usable as a plugin

- Refactor the external sema source into a visible class
- Add support for emitting FixIts
- Wrap up include fixer as a plugin as I did with clang-tidy

Test case will follow as soon as I wire this up in libclang.

Differential Revision: https://reviews.llvm.org/D26752

llvm-svn: 287228

7 years ago[OPENMP] Fixed codegen for 'omp cancel' construct.
Alexey Bataev [Thu, 17 Nov 2016 15:12:05 +0000 (15:12 +0000)]
[OPENMP] Fixed codegen for 'omp cancel' construct.

If 'omp cancel' construct is used in a worksharing construct it may
cause hanging of the software in case if reduction clause is used. Patch fixes this problem by avoiding extra reduction processing for branches that were canceled.

llvm-svn: 287227

7 years ago[docs] Remove doubled spaces
Malcolm Parsons [Thu, 17 Nov 2016 14:26:45 +0000 (14:26 +0000)]
[docs] Remove doubled spaces

Reviewers: aaron.ballman

Subscribers: nemanjai, cfe-commits

Differential Revision: https://reviews.llvm.org/D26798

llvm-svn: 287226

7 years agoAvoid accessing an end() iterator.
Rafael Espindola [Thu, 17 Nov 2016 14:18:08 +0000 (14:18 +0000)]
Avoid accessing an end() iterator.

llvm-svn: 287225

7 years agoWdocumentation fix
Simon Pilgrim [Thu, 17 Nov 2016 12:21:45 +0000 (12:21 +0000)]
Wdocumentation fix

llvm-svn: 287224

7 years ago[X86][SSE] Improve lowering of vXi64 multiply with known zero 32-bit halves
Simon Pilgrim [Thu, 17 Nov 2016 12:14:49 +0000 (12:14 +0000)]
[X86][SSE] Improve lowering of vXi64 multiply with known zero 32-bit halves

vXi64 multiplication is lowered into 3 calls of vpmuludq with the upper/lower 32-bit halves.

If any of these halves are zero then we can remove individual calls. Although there was isBuildVectorAllZeros code to do this I don't think it ever worked (maybe just for constant folded cases that don't seem to be tested for any longer).

This requires additional X86ISD support for computeKnownBitsForTargetNode, so far I've just added support for X86ISD::VZEXT (VPMOVZX* - helping the AVX2+ cases).

Partial fix for PR30845

Differential Revision: https://reviews.llvm.org/D26590

llvm-svn: 287223

7 years agoFix spelling in comment. NFC.
Simon Pilgrim [Thu, 17 Nov 2016 12:03:05 +0000 (12:03 +0000)]
Fix spelling in comment. NFC.

llvm-svn: 287222

7 years ago[clang-tidy] Ignore template instantiations in modernize-use-equals-delete check
Malcolm Parsons [Thu, 17 Nov 2016 11:40:02 +0000 (11:40 +0000)]
[clang-tidy] Ignore template instantiations in modernize-use-equals-delete check

Summary: Template instantiations were causing misplaced fixits.

Reviewers: aaron.ballman, alexfh, hokein

Subscribers: hokein, cfe-commits

Differential Revision: https://reviews.llvm.org/D26751

llvm-svn: 287221

7 years ago[cmake] Move LLVM_BUILD_STATIC check to an earlier point
Pavel Labath [Thu, 17 Nov 2016 11:22:23 +0000 (11:22 +0000)]
[cmake] Move LLVM_BUILD_STATIC check to an earlier point

Summary:
The motivation for this is to enable correct detection of dlopen() on Android.
Android does not provide a static version of libdl, so if we add the -static flag
after performing the check, it will succeed even though subsequent link steps
will fail. With this change we correctly detect the absence of libdl in a
LLVM_BUILD_STATIC build on Android.

The link itself still does not succeed because the code does not check the result
of this check properly, but I plan to fix that in a separate change.

Reviewers: beanz

Subscribers: danalbert, mgorny, srhines, tberghammer, llvm-commits

Differential Revision: https://reviews.llvm.org/D26463

llvm-svn: 287220

7 years ago[ARM] Relax restriction on variadic functions for tailcall optimization
Pablo Barrio [Thu, 17 Nov 2016 10:56:58 +0000 (10:56 +0000)]
[ARM] Relax restriction on variadic functions for tailcall optimization

Summary:
Variadic functions can be treated in the same way as normal functions
with respect to the number and types of parameters.

Reviewers: grosbach, olista01, t.p.northover, rengolin

Subscribers: javed.absar, aemerson, llvm-commits

Differential Revision: https://reviews.llvm.org/D26748

llvm-svn: 287219

7 years ago[ELF] Remove unneeded forward declarations. NFC.
Eugene Leviant [Thu, 17 Nov 2016 10:34:05 +0000 (10:34 +0000)]
[ELF] Remove unneeded forward declarations. NFC.

llvm-svn: 287218

7 years ago[X86] RegCall - Handling v64i1 in 32/64 bit target
Oren Ben Simhon [Thu, 17 Nov 2016 09:59:40 +0000 (09:59 +0000)]
[X86] RegCall - Handling v64i1 in 32/64 bit target

Register Calling Convention defines a new behavior for v64i1 types.
This type should be saved in GPR.
However for 32 bit machine we need to split the value into 2 GPRs (because each is 32 bit).

Differential Revision: https://reviews.llvm.org/D26181

llvm-svn: 287217

7 years ago[ELF] Convert SymbolTableSection to input section
Eugene Leviant [Thu, 17 Nov 2016 09:16:34 +0000 (09:16 +0000)]
[ELF] Convert SymbolTableSection to input section

Differential revision: https://reviews.llvm.org/D26740

llvm-svn: 287216

7 years ago[clang-tidy] Changes to modernize-use-default check
Malcolm Parsons [Thu, 17 Nov 2016 09:14:04 +0000 (09:14 +0000)]
[clang-tidy] Changes to modernize-use-default check

Summary:
Warn about special member functions that only contain a comment.
Report the location of the special member function, unless it is
defined in a macro.  Reporting the location of the body in a macro is
more helpful as it causes the macro expansion location to be reported too.

Fixes PR30920.

Reviewers: alexfh, aaron.ballman

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D26741

llvm-svn: 287215

7 years agoDelete dead code and add asserts instead; NFC
Sanjoy Das [Thu, 17 Nov 2016 07:29:43 +0000 (07:29 +0000)]
Delete dead code and add asserts instead; NFC

llvm-svn: 287214

7 years ago[ImplicitNullCheck] Fix an edge case where we were hoisting incorrectly
Sanjoy Das [Thu, 17 Nov 2016 07:29:40 +0000 (07:29 +0000)]
[ImplicitNullCheck] Fix an edge case where we were hoisting incorrectly

ImplicitNullCheck keeps track of one instruction that the memory
operation depends on that it also hoists with the memory operation.
When hoisting this dependency, it would sometimes clobber a live-in
value to the basic block we were hoisting the two things out of.  Fix
this by explicitly looking for such dependencies.

I also noticed two redundant checks on `MO.isDef()` in IsMIOperandSafe.
They're redundant since register MachineOperands are either Defs or Uses
-- there is no third kind.  I'll change the checks to asserts in a later
commit.

llvm-svn: 287213

7 years agoFix one more build error with lldb-server.
Zachary Turner [Thu, 17 Nov 2016 06:13:54 +0000 (06:13 +0000)]
Fix one more build error with lldb-server.

llvm-svn: 287212

7 years ago[X86] Fix formatting. NFC
Craig Topper [Thu, 17 Nov 2016 05:59:55 +0000 (05:59 +0000)]
[X86] Fix formatting. NFC

llvm-svn: 287211

7 years ago[X86] Add a test case where, due to a bug in selectScalarSSELoad, we fold the same...
Craig Topper [Thu, 17 Nov 2016 05:37:39 +0000 (05:37 +0000)]
[X86] Add a test case where, due to a bug in selectScalarSSELoad, we fold the same load twice.

llvm-svn: 287210

7 years ago[XRay] Support AArch64 in LLVM
Dean Michael Berris [Thu, 17 Nov 2016 05:15:37 +0000 (05:15 +0000)]
[XRay] Support AArch64 in LLVM

This patch adds XRay support in LLVM for AArch64 targets.
This patch is one of a series:

Clang: https://reviews.llvm.org/D26415
compiler-rt: https://reviews.llvm.org/D26413

Author: rSerge

Reviewers: rengolin, dberris

Subscribers: amehsan, aemerson, llvm-commits, iid_iunknown

Differential Revision: https://reviews.llvm.org/D26412

llvm-svn: 287209

7 years agoFix warnings and errors introduced with UUID changes.
Zachary Turner [Thu, 17 Nov 2016 05:14:32 +0000 (05:14 +0000)]
Fix warnings and errors introduced with UUID changes.

llvm-svn: 287208

7 years ago[CMake] [Darwin] Add support for debugging tablegen dependencies
Chris Bieneman [Thu, 17 Nov 2016 04:36:59 +0000 (04:36 +0000)]
[CMake] [Darwin] Add support for debugging tablegen dependencies

This patch adds an option to the build system LLVM_DEPENDENCY_DEBUGGING. Over time I plan to extend this to do more complex verifications, but the initial patch causes compile errors wherever there is missing a dependency on intrinsics_gen.

Because intrinsics_gen is a compile-time dependency not a link-time dependency, everything that relies on the headers generated in intrinsics_gen needs an explicit dependency.

llvm-svn: 287207

7 years ago[CMake] NFC. Updating CMake dependency specifications
Chris Bieneman [Thu, 17 Nov 2016 04:36:50 +0000 (04:36 +0000)]
[CMake] NFC. Updating CMake dependency specifications

This patch updates a bunch of places where add_dependencies was being explicitly called to add dependencies on intrinsics_gen to instead use the DEPENDS named parameter. This cleanup is needed for a patch I'm working on to add a dependency debugging mode to the build system.

llvm-svn: 287206

7 years ago[CMake] NFC. Updating CMake dependency specifications
Chris Bieneman [Thu, 17 Nov 2016 04:36:35 +0000 (04:36 +0000)]
[CMake] NFC. Updating CMake dependency specifications

This patch updates a couple places where add_dependencies was being explicitly called to add dependencies on intrinsics_gen to instead use the DEPENDS named parameter. This cleanup is needed for a patch I'm working on to add a dependency debugging mode to the build system.

llvm-svn: 287205

7 years ago[AMDGPU] Add missing test for rL287203
Konstantin Zhuravlyov [Thu, 17 Nov 2016 04:33:20 +0000 (04:33 +0000)]
[AMDGPU] Add missing test for rL287203

llvm-svn: 287204

7 years ago[AMDGPU] Custom lower f16 = fp_round f64
Konstantin Zhuravlyov [Thu, 17 Nov 2016 04:28:37 +0000 (04:28 +0000)]
[AMDGPU] Custom lower f16 = fp_round f64

llvm-svn: 287203

7 years agoRename a function so that that starts with a lowercase letter.
Rui Ueyama [Thu, 17 Nov 2016 04:10:09 +0000 (04:10 +0000)]
Rename a function so that that starts with a lowercase letter.

llvm-svn: 287202

7 years ago[AMDGPU] Promote f16/i16 conversions to f32/i32
Konstantin Zhuravlyov [Thu, 17 Nov 2016 04:00:46 +0000 (04:00 +0000)]
[AMDGPU] Promote f16/i16 conversions to f32/i32

llvm-svn: 287201

7 years agoSimplify and use consistent variable name. NFC.
Rui Ueyama [Thu, 17 Nov 2016 03:52:14 +0000 (03:52 +0000)]
Simplify and use consistent variable name. NFC.

llvm-svn: 287200

7 years ago[AMDGPU] Expand `br_cc` for f16
Konstantin Zhuravlyov [Thu, 17 Nov 2016 03:49:01 +0000 (03:49 +0000)]
[AMDGPU] Expand `br_cc` for f16

Differential Revision: https://reviews.llvm.org/D26732

llvm-svn: 287199

7 years agoUse uint16_t instead of size_t for symbol version ID.
Rui Ueyama [Thu, 17 Nov 2016 03:39:21 +0000 (03:39 +0000)]
Use uint16_t instead of size_t for symbol version ID.

Because it is uint16_t in the ELF spec. Using size_t was confusing.

llvm-svn: 287198

7 years agoAdd single quotes to a warning message for consistency.
Rui Ueyama [Thu, 17 Nov 2016 03:32:41 +0000 (03:32 +0000)]
Add single quotes to a warning message for consistency.

llvm-svn: 287197

7 years agoSimplify handleAnonymousVersion even more.
Rui Ueyama [Thu, 17 Nov 2016 03:19:34 +0000 (03:19 +0000)]
Simplify handleAnonymousVersion even more.

We used to create a vector contantaining all version definitions
with wildcards because doing that was efficient. All patterns were
compiled to a regexp and matched against symbol names. Because
a regexp can be converted to a DFA, matching against union of patterns
is as cheap as matching against one patter.

We are no longer converting them to regexp. Our own glob pattern
handler doesn't do such optimization. Therefore, creating a vector
no longer makes sense.

llvm-svn: 287196

7 years ago[Orc] Clang-format the recent RPC update (r286620 and related).
Lang Hames [Thu, 17 Nov 2016 02:33:47 +0000 (02:33 +0000)]
[Orc] Clang-format the recent RPC update (r286620 and related).

llvm-svn: 287195

7 years agoRemove -Wsigned-enum-bitfield from -Wmost. On a wide set of ABIs, this warning
Richard Smith [Thu, 17 Nov 2016 02:16:09 +0000 (02:16 +0000)]
Remove -Wsigned-enum-bitfield from -Wmost. On a wide set of ABIs, this warning
is completely irrelevant, producing (effectively) false positives, and -Wmost
is used pretty widely. We should somehow turn it back on by default when
targeting the MS ABI, however, since it indicates the program will not do as
intended in those cases.

(Or perhaps we should just treat enum bitfields as having the signedness of the
enum, even when targeting the MS ABI...)

llvm-svn: 287193

7 years agoSimplify. NFC.
Rui Ueyama [Thu, 17 Nov 2016 02:16:06 +0000 (02:16 +0000)]
Simplify. NFC.

llvm-svn: 287192

7 years agoSplit scanVersionScript. NFC.
Rui Ueyama [Thu, 17 Nov 2016 02:09:42 +0000 (02:09 +0000)]
Split scanVersionScript. NFC.

llvm-svn: 287191

7 years agoConvert UriParser to use StringRef.
Zachary Turner [Thu, 17 Nov 2016 01:38:02 +0000 (01:38 +0000)]
Convert UriParser to use StringRef.

llvm-svn: 287190

7 years agoMake GetValueForVariableExpression use StringRef.
Zachary Turner [Thu, 17 Nov 2016 01:37:52 +0000 (01:37 +0000)]
Make GetValueForVariableExpression use StringRef.

Also significantly reduced the indentation level by use of
early returns, and simplified some of the logic by using
StringRef functions such as consumeInteger() and getAsInteger()
instead of strtoll, etc.

llvm-svn: 287189

7 years agoConvert AutoComplete related code to StringRef.
Zachary Turner [Thu, 17 Nov 2016 01:37:42 +0000 (01:37 +0000)]
Convert AutoComplete related code to StringRef.

Differential Revision: https://reviews.llvm.org/D26721

llvm-svn: 287188

7 years ago[Sema] Fix a bug in enable_if condition instantiation.
George Burgess IV [Thu, 17 Nov 2016 01:33:54 +0000 (01:33 +0000)]
[Sema] Fix a bug in enable_if condition instantiation.

During template instantiation, we currently fall back to just calling
Sema::SubstExpr for enable_if attributes that aren't value-dependent or
type-dependent. Since Sema::SubstExpr strips off any implicit casts
we've added to an expression, it's possible that this behavior will
leave us with an enable_if condition that's just a DeclRefExpr.
Conditions like that deeply confuse Sema::CheckEnableIf.

llvm-svn: 287187

7 years agoUse profile info to adjust loop unroll threshold.
Dehao Chen [Thu, 17 Nov 2016 01:17:02 +0000 (01:17 +0000)]
Use profile info to adjust loop unroll threshold.

Summary:
For flat loop, even if it is hot, it is not a good idea to unroll in runtime, thus we set a lower partial unroll threshold.
For hot loop, we set a higher unroll threshold and allows expensive tripcount computation to allow more aggressive unrolling.

Reviewers: davidxl, mzolotukhin

Subscribers: sanjoy, mehdi_amini, llvm-commits

Differential Revision: https://reviews.llvm.org/D26527

llvm-svn: 287186

7 years agoExplicitly specify that ubsan-vtable-checks is x86-64.
Ivan Krasin [Thu, 17 Nov 2016 01:09:04 +0000 (01:09 +0000)]
Explicitly specify that ubsan-vtable-checks is x86-64.

This should fix a failure on PowerPC introduced by r287181.

llvm-svn: 287185

7 years ago[CUDA] Update docs to indicate that clang now supports std::complex in CUDA mode.
Justin Lebar [Thu, 17 Nov 2016 01:03:42 +0000 (01:03 +0000)]
[CUDA] Update docs to indicate that clang now supports std::complex in CUDA mode.

The last remaining necessary change was D25403, landed as r287012.

llvm-svn: 287184

7 years agoRemove a stale test case.
Lang Hames [Thu, 17 Nov 2016 01:02:52 +0000 (01:02 +0000)]
Remove a stale test case.

llvm-svn: 287183

7 years agollvm-dis: Remove dead code.
Peter Collingbourne [Thu, 17 Nov 2016 00:42:08 +0000 (00:42 +0000)]
llvm-dis: Remove dead code.

llvm-svn: 287182

7 years agoInsert a type check before reading vtable.
Ivan Krasin [Thu, 17 Nov 2016 00:39:48 +0000 (00:39 +0000)]
Insert a type check before reading vtable.

Summary:
this is to prevent a situation when a pointer is invalid or null,
but we get to reading from vtable before we can check that
(possibly causing a segfault without a good diagnostics).

Reviewers: pcc

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D26559

llvm-svn: 287181

7 years ago[AVR] Remove some accidentally-commited code that broke the bots
Dylan McKay [Thu, 17 Nov 2016 00:09:38 +0000 (00:09 +0000)]
[AVR] Remove some accidentally-commited code that broke the bots

This is a remnant of an on-chip unit testing tool that has since been
moved out-of-tree.

It was accidentally committed in r287162.

llvm-svn: 287180

7 years ago[CMake] Support lld with LTO bootstrap
Petr Hosek [Wed, 16 Nov 2016 23:59:06 +0000 (23:59 +0000)]
[CMake] Support lld with LTO bootstrap

lld has LTO support, if requested we should add a dependency on lld
rather than LLVMgold when doing LTO bootstrap build.

Differential Revision: https://reviews.llvm.org/D26649

llvm-svn: 287179

7 years agoIntroduce GlobalSplit pass.
Peter Collingbourne [Wed, 16 Nov 2016 23:40:26 +0000 (23:40 +0000)]
Introduce GlobalSplit pass.

This pass splits globals into elements using inrange annotations on
getelementptr indices.

Differential Revision: https://reviews.llvm.org/D22295

llvm-svn: 287178

7 years agoAdd warning when assigning enums to bitfields without an explicit unsigned underlying...
Reid Kleckner [Wed, 16 Nov 2016 23:40:00 +0000 (23:40 +0000)]
Add warning when assigning enums to bitfields without an explicit unsigned underlying type

Summary:
Add a warning when assigning enums to bitfields without an explicit
unsigned underlying type. This is to prevent problems with MSVC
compatibility, since the Microsoft ABI defaults to storing enums with a
signed type, causing inconsistencies with saving to/reading from
bitfields.

Also disabled the warning in the dr0xx.cpp test which throws the error,
and added a test for the warning.

The warning can be disabled with -Wno-signed-enum-bitfield.

Patch by Sasha Bermeister!

Reviewers: rnk, aaron.ballman

Subscribers: mehdi_amini, aaron.ballman, cfe-commits, thakis, dcheng

Differential Revision: https://reviews.llvm.org/D24289

llvm-svn: 287177

7 years ago[AVR] Wrap all methods in the pseudo expansion pass in an anon namespace
Dylan McKay [Wed, 16 Nov 2016 23:06:14 +0000 (23:06 +0000)]
[AVR] Wrap all methods in the pseudo expansion pass in an anon namespace

The '-fpermissive' compiler flag complains if the template
specializations used in the class are used in a different namespace.

llvm-svn: 287176

7 years ago[analyzer] Remove unused check::RegionChanges::wantsRegionChangeUpdate callback
Anna Zaks [Wed, 16 Nov 2016 22:59:01 +0000 (22:59 +0000)]
[analyzer] Remove unused check::RegionChanges::wantsRegionChangeUpdate callback

Remove the check::RegionChanges::wantsRegionChangeUpdate callback as it is no
longer used (since checkPointerEscape has been added).

A patch by Krzysztof Wiśniewski!

Differential Revision: https://reviews.llvm.org/D26759

llvm-svn: 287175

7 years ago[AVR] Fix basic block naming in ctlz and cttz tests
Dylan McKay [Wed, 16 Nov 2016 22:48:38 +0000 (22:48 +0000)]
[AVR] Fix basic block naming in ctlz and cttz tests

The branch selector would change the names.

llvm-svn: 287174

7 years ago[AVR] Remove unused method from AVRTargetMachine
Dylan McKay [Wed, 16 Nov 2016 22:48:30 +0000 (22:48 +0000)]
[AVR] Remove unused method from AVRTargetMachine

llvm-svn: 287173

7 years ago[AVR] Add tests for counting leading/trailing zeros
Dylan McKay [Wed, 16 Nov 2016 22:38:43 +0000 (22:38 +0000)]
[AVR] Add tests for counting leading/trailing zeros

This adds two test files that verify the 'cttz' and 'ctlz' operations.

llvm-svn: 287172

7 years ago[x86] allow FP-logic ops when one operand is FP and result is FP
Sanjay Patel [Wed, 16 Nov 2016 22:34:05 +0000 (22:34 +0000)]
[x86] allow FP-logic ops when one operand is FP and result is FP

We save an inter-register file move this way. If there's any CPU where
the FP logic is slower, we could transform this back to int-logic in
MachineCombiner.

This helps, but doesn't solve, PR6137:
https://llvm.org/bugs/show_bug.cgi?id=6137

The 'andn' test shows that we're missing a pattern match to
recognize the xor with -1 constant as a 'not' op.

llvm-svn: 287171

7 years ago[AsmParser] Avoid recursing when lexing ';'. NFC.
Ahmed Bougacha [Wed, 16 Nov 2016 22:25:05 +0000 (22:25 +0000)]
[AsmParser] Avoid recursing when lexing ';'. NFC.

This should prevent stack overflows in non-optimized builds on
.ll files with lots of consecutive commented-out lines.

Instead of recursing into LexToken(), continue into a 'while (true)'.

llvm-svn: 287170

7 years ago[CodeGen] Pass references, not pointers, to MMI helpers. NFC.
Ahmed Bougacha [Wed, 16 Nov 2016 22:25:03 +0000 (22:25 +0000)]
[CodeGen] Pass references, not pointers, to MMI helpers. NFC.

While there, rename them to follow the coding style.

llvm-svn: 287169

7 years agoRevert "Get GlobalISel to build on Linux after r286407"
Ahmed Bougacha [Wed, 16 Nov 2016 22:24:59 +0000 (22:24 +0000)]
Revert "Get GlobalISel to build on Linux after r286407"

This reverts commit r286962.

We want to avoid depending on SelectionDAG, and AddLandingPadInfo
lives in CodeGen now.

llvm-svn: 287168

7 years ago[CodeGen] Pull MMI helpers from FunctionLoweringInfo to MMI. NFC.
Ahmed Bougacha [Wed, 16 Nov 2016 22:24:56 +0000 (22:24 +0000)]
[CodeGen] Pull MMI helpers from FunctionLoweringInfo to MMI. NFC.

They're not SelectionDAG- or FunctionLoweringInfo-specific.  They
are, however, specific to building MMI from IR.
We could make them members, but it's nice having MMI be a "simple" data
structure and this logic kept separate.

This also lets us reuse them from GlobalISel.

llvm-svn: 287167

7 years ago[CodeGen] Cleanup MachineModuleInfo doxygen comments. NFC.
Ahmed Bougacha [Wed, 16 Nov 2016 22:24:53 +0000 (22:24 +0000)]
[CodeGen] Cleanup MachineModuleInfo doxygen comments. NFC.

Remove redundant names and only keep header comments.

llvm-svn: 287166

7 years ago[CodeGen] Sort MMI forward declarations. NFC.
Ahmed Bougacha [Wed, 16 Nov 2016 22:24:46 +0000 (22:24 +0000)]
[CodeGen] Sort MMI forward declarations. NFC.

llvm-svn: 287165

7 years ago[libc++] Introduce `_LIBCPP_OVERRIDABLE_FUNC_VIS`
Shoaib Meenai [Wed, 16 Nov 2016 22:18:10 +0000 (22:18 +0000)]
[libc++] Introduce `_LIBCPP_OVERRIDABLE_FUNC_VIS`

This is a generalization of `_LIBCPP_NEW_DELETE_VIS`; the new macro name
captures the semantics better, and also allows us to get rid of the
`_WIN32` check in `include/new`. No functional change.

Differential Revision: https://reviews.llvm.org/D26702

llvm-svn: 287164

7 years agoGeneral clean up of error handling in llvm-objdump to remove its use of report_fatal_...
Kevin Enderby [Wed, 16 Nov 2016 22:17:38 +0000 (22:17 +0000)]
General clean up of error handling in llvm-objdump to remove its use of report_fatal_error().
No real functional change with this commit.

The problem with report_fatal_error() is it does not include the tool name
and the file name the for which the error message was generated.

Uses of report_fatal_error() were change to report_error() or error()
to get a better error and to make the code smaller and cleaner.

Also changed things like error(errorToErrorCode(SOrErr.takeError())) to
use report_error() with a file name and the llvm::Error (as well as the
ArchitectureName if available) so the error message is printed.

llvm-svn: 287163

7 years ago[AVR] Add the pseudo instruction expansion pass
Dylan McKay [Wed, 16 Nov 2016 21:58:04 +0000 (21:58 +0000)]
[AVR] Add the pseudo instruction expansion pass

Summary:
A lot of the pseudo instructions are required because LLVM assumes that
all integers of the same size as the pointer size are legal. This means
that it will not currently expand 16-bit instructions to their 8-bit
variants because it thinks 16-bit types are legal for the operations.

This also adds all of the CodeGen tests that required the pass to run.

Reviewers: arsenm, kparzysz

Subscribers: wdng, mgorny, modocache, llvm-commits

Differential Revision: https://reviews.llvm.org/D26577

llvm-svn: 287162

7 years agoFix "isn't a prototype" warning
Vitaly Buka [Wed, 16 Nov 2016 21:51:39 +0000 (21:51 +0000)]
Fix "isn't a prototype" warning

llvm-svn: 287161

7 years agoX86: Simplify X86ISD::Wrapper operand checks. NFCI.
Peter Collingbourne [Wed, 16 Nov 2016 21:48:59 +0000 (21:48 +0000)]
X86: Simplify X86ISD::Wrapper operand checks. NFCI.

We only ever create TargetConstantPool, TargetJumpTable, TargetExternalSymbol,
TargetGlobalAddress, TargetGlobalTLSAddress, MCSymbol and TargetBlockAddress
nodes as operands of X86ISD::Wrapper nodes, so we can remove one check and
invert the other.

Also update the documentation comment for X86ISD::Wrapper.

Differential Revision: https://reviews.llvm.org/D26731

llvm-svn: 287160

7 years ago[ImplicitNullChecks] Do not not handle call MachineInstrs
Sanjoy Das [Wed, 16 Nov 2016 21:45:22 +0000 (21:45 +0000)]
[ImplicitNullChecks] Do not not handle call MachineInstrs

We don't track callee clobbered registers correctly, so avoid hoisting
across calls.

Note: for this bug to trigger we need a `readonly` call target, since we
already have logic to not hoist across potentially storing instructions
either.

llvm-svn: 287159

7 years agoFix some unit test compilation failures.
Zachary Turner [Wed, 16 Nov 2016 21:45:11 +0000 (21:45 +0000)]
Fix some unit test compilation failures.

llvm-svn: 287158

7 years agoMake Apropos functions accept StringRefs.
Zachary Turner [Wed, 16 Nov 2016 21:45:04 +0000 (21:45 +0000)]
Make Apropos functions accept StringRefs.

llvm-svn: 287157