platform/upstream/llvm.git
10 years agoMake clang's rewrite engine a core feature
Alp Toker [Wed, 16 Jul 2014 16:48:33 +0000 (16:48 +0000)]
Make clang's rewrite engine a core feature

The rewrite facility's footprint is small so it's not worth going to these
lengths to support disabling at configure time, particularly since key compiler
features now depend on it.

Meanwhile the Objective-C rewriters have been moved under the
ENABLE_CLANG_ARCMT umbrella for now as they're comparatively heavy and still
potentially worth excluding from lightweight builds.

Tests are now passing with any combination of feature flags. The flags
historically haven't been tested by LLVM's build servers so caveat emptor.

llvm-svn: 213171

10 years agoclang-cl: expand test coverage for "core" options
Hans Wennborg [Wed, 16 Jul 2014 16:29:00 +0000 (16:29 +0000)]
clang-cl: expand test coverage for "core" options

llvm-svn: 213170

10 years agoAdded documentation for SizeMultiplier in the ARM subtarget hook for register coalesc...
Chris Bieneman [Wed, 16 Jul 2014 16:27:31 +0000 (16:27 +0000)]
Added documentation for SizeMultiplier in the ARM subtarget hook for register coalescing. Also fixed some 80 col violations.

No functional code changes.

llvm-svn: 213169

10 years ago[NVPTX] Rename registers %fl -> %fd and %rl -> %rd
Justin Holewinski [Wed, 16 Jul 2014 16:26:58 +0000 (16:26 +0000)]
[NVPTX] Rename registers %fl -> %fd and %rl -> %rd

This matches the internal behavior of NVIDIA tools like libnvvm.

llvm-svn: 213168

10 years agoObjective-C. Introducing __attribute__((objc_runtime_name("runtimename"))
Fariborz Jahanian [Wed, 16 Jul 2014 16:16:04 +0000 (16:16 +0000)]
Objective-C. Introducing __attribute__((objc_runtime_name("runtimename"))
to be applied to class or protocols. This will direct IRGen
for Objective-C metadata to use the new name in various places
where class and protocol names are needed.
rdar:// 17631257

llvm-svn: 213167

10 years agogdb-remote test noise suppression on MacOSX.
Todd Fiala [Wed, 16 Jul 2014 16:15:42 +0000 (16:15 +0000)]
gdb-remote test noise suppression on MacOSX.

This change adds a member to the base test case for gdb-remote that
indicates whether a stub makes two X stop notification reports on kill
commands.  This is set to true for debugserver tests.

The test for killing an attached process after it's first stop notification
has been modified to look at that flag and add an extra X packet matcher
so the "unmatched packet warning" doesn't get emitted for the second X on
MacOSX with debugserver.

I also broke those tests out of the monolithic TestLldbGdbServer mega test
case and put it in its own, new TestGdbRemoteKill.py file and test case.

Tested:
Ubuntu 14.04 x86_64, clang-3.5 built lldb, no test failures.
MacOSX 10.9.4, Xcode 6.0 Beta 3 built lldb, no test failures.

llvm-svn: 213166

10 years agoExpand the wildcard expansion test to also cover '?'
Hans Wennborg [Wed, 16 Jul 2014 16:14:09 +0000 (16:14 +0000)]
Expand the wildcard expansion test to also cover '?'

llvm-svn: 213165

10 years agoclang-cl: make sure we still parse -fms-version= after r213119
Hans Wennborg [Wed, 16 Jul 2014 16:03:56 +0000 (16:03 +0000)]
clang-cl: make sure we still parse -fms-version= after r213119

The CoreOption flag got lost in the changes.

llvm-svn: 213164

10 years agoCorrectly implement LWG 2049; std::is_destructible.
Marshall Clow [Wed, 16 Jul 2014 15:51:50 +0000 (15:51 +0000)]
Correctly implement LWG 2049; std::is_destructible.

llvm-svn: 213163

10 years agoCodeGen: don't form illegail EXTLOAD operations.
Tim Northover [Wed, 16 Jul 2014 15:37:24 +0000 (15:37 +0000)]
CodeGen: don't form illegail EXTLOAD operations.

It turns out that in most cases (the main exception being i1-related
types) once these operations are formed we cannot separate them and
the targets end up having to deal with them whether they want to or
not.

This is not a good situation, and a more reasonable default can be
formed by ackowledging this and having targets leave them as Legal.
Only x86 seems to be affected (other targets don't even try marking
the operation Expand).

Mostly there's no visible change here yet, but it will be useful to
have truly expanded EXTLOADS for MVT::f16 softening support.

llvm-svn: 213162

10 years agoConvert test to CHECK-LABEL
Tim Northover [Wed, 16 Jul 2014 15:37:08 +0000 (15:37 +0000)]
Convert test to CHECK-LABEL

llvm-svn: 213161

10 years ago[mips][fp64a] Temporarily disable odd-numbered double-precision registers when using...
Daniel Sanders [Wed, 16 Jul 2014 15:34:07 +0000 (15:34 +0000)]
[mips][fp64a] Temporarily disable odd-numbered double-precision registers when using the FP64A ABI.

Summary:
A few instructions (mostly cvt.d.w and similar) are causing problems with
-mfp64 and -mno-odd-spreg and it looks like fixing it properly may
take several weeks. In the meantime, let's disable the odd-numbered
double-precision registers so that the generated code is at least valid.

The problem is that instructions like cvt.d.w read from the 32-bit low
subregister of a double-precision FPU register. This often leads to the compiler
to inserting moves to transfer a GPR32 to a FGR32 using mtc1. Such moves
violate the rules against 32-bit writes to odd-numbered FPU registers imposed
by -mno-odd-spreg. By disabling the odd-numbered double-precision registers, it
becomes impossible for the 32-bit low subregister to be odd-numbered.

This fixes numerous test-suite failures when compiling for the FP64A ABI
('-mfp64 -mno-odd-spreg'). There is no LLVM test case because it's difficult to
test that odd-numbered FPU registers are not allocatable. Instead, we depend on
the assembler (GAS and -fintegrated-as) raising errors when the rules are
violated.

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

llvm-svn: 213160

10 years agoRevert "clang/test/Driver/crash-report.c: This requires rewriter for -frewrite-includ...
Alp Toker [Wed, 16 Jul 2014 15:12:48 +0000 (15:12 +0000)]
Revert "clang/test/Driver/crash-report.c: This requires rewriter for -frewrite-includes. [PR20321]"

We've decided to make the core rewriter class and PP rewriters mandatory.
They're only a few hundred lines of code in total and not worth supporting as a
distinct build configuration, especially since doing so disables key compiler
features.

This reverts commit r213150.

Revert "clang/test: Introduce the feature "rewriter" for --enable-clang-rewriter."

This reverts commit r213148.

Revert "Move clang/test/Frontend/rewrite-*.c to clang/test/Frontend/Rewriter/"

This reverts commit r213146.

llvm-svn: 213159

10 years agoAdd kalimba as a platform.
Todd Fiala [Wed, 16 Jul 2014 15:03:10 +0000 (15:03 +0000)]
Add kalimba as a platform.

This change comprises of additions and some minor changes in order that
"kalimba" is listed as a supported platform and that debugging any
kalimbas results in PlatformKalimba being associated with the target.

The changes are as follows:

* The PlatformKalimba implementation itself
* A tweak to ArchSpec
* .note parsing for Kalimba in ObjectFileELF.cpp
* Plugin registration
* Makefile additions

Change by Matthew Gardiner

Minor tweak for cmake and Xcode by Todd Fiala

Tested:
Ubuntu 14.04 x86_64, clang 3.5-built lldb, all tests pass.
MacOSX 10.9.4, Xcode 6.0 Beta 1-built lldb, all tests pass.

llvm-svn: 213158

10 years ago[clang-tidy] As a simple heuristic don't emit a swap fixit that would create
Benjamin Kramer [Wed, 16 Jul 2014 14:52:07 +0000 (14:52 +0000)]
[clang-tidy] As a simple heuristic don't emit a swap fixit that would create
negative-sized memsets.

memset(x, -1, 0) is still useless but swapping makes no sense here. Just emit
a warning.

llvm-svn: 213157

10 years ago[clang-tidy] Also emit a warning for memset(x, 0, 0)
Benjamin Kramer [Wed, 16 Jul 2014 14:42:43 +0000 (14:42 +0000)]
[clang-tidy] Also emit a warning for memset(x, 0, 0)

It doesn't make sense to suggest swapping the arguments here but it's
still useless code

llvm-svn: 213156

10 years ago[clang-tidy] Add a checker for zero-length memset.
Benjamin Kramer [Wed, 16 Jul 2014 14:30:19 +0000 (14:30 +0000)]
[clang-tidy] Add a checker for zero-length memset.

If there's memset(x, y, 0) in the code it's most likely a mistake. The
checker suggests a fix-it to swap 'y' and '0'.

I think this has the potential to be promoted into a general clang warning
after some testing in clang-tidy.

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

llvm-svn: 213155

10 years ago[clang-tidy] Add namespaces checkers.
Benjamin Kramer [Wed, 16 Jul 2014 14:16:56 +0000 (14:16 +0000)]
[clang-tidy] Add namespaces checkers.

This change contains of two checkers that warn about
1. anonymous namespaces in header files.
2. 'using namespace' directives everywhere.

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

llvm-svn: 213153

10 years ago[ASTMatchers] Add a usingDirectiveDecl matcher.
Benjamin Kramer [Wed, 16 Jul 2014 14:14:51 +0000 (14:14 +0000)]
[ASTMatchers] Add a usingDirectiveDecl matcher.

This matches 'using namespace' declarations.

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

llvm-svn: 213152

10 years ago[ASan/Win] Handle situations when the client app has used DbgHelp before
Timur Iskhodzhanov [Wed, 16 Jul 2014 14:11:02 +0000 (14:11 +0000)]
[ASan/Win] Handle situations when the client app has used DbgHelp before

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

llvm-svn: 213151

10 years agoclang/test/Driver/crash-report.c: This requires rewriter for -frewrite-includes....
NAKAMURA Takumi [Wed, 16 Jul 2014 13:42:43 +0000 (13:42 +0000)]
clang/test/Driver/crash-report.c: This requires rewriter for -frewrite-includes. [PR20321]

llvm-svn: 213150

10 years agoAvoid adding redundant parens.
Alexander Kornienko [Wed, 16 Jul 2014 13:38:48 +0000 (13:38 +0000)]
Avoid adding redundant parens.

Reviewers: bkramer

Reviewed By: bkramer

Subscribers: cfe-commits, sbenza

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

llvm-svn: 213149

10 years agoclang/test: Introduce the feature "rewriter" for --enable-clang-rewriter.
NAKAMURA Takumi [Wed, 16 Jul 2014 13:36:39 +0000 (13:36 +0000)]
clang/test: Introduce the feature "rewriter" for --enable-clang-rewriter.

llvm-svn: 213148

10 years agoAdded documentation on how clang diagnostics are reported by clang-tidy.
Alexander Kornienko [Wed, 16 Jul 2014 13:26:51 +0000 (13:26 +0000)]
Added documentation on how clang diagnostics are reported by clang-tidy.

llvm-svn: 213147

10 years agoMove clang/test/Frontend/rewrite-*.c to clang/test/Frontend/Rewriter/
NAKAMURA Takumi [Wed, 16 Jul 2014 13:23:13 +0000 (13:23 +0000)]
Move clang/test/Frontend/rewrite-*.c to clang/test/Frontend/Rewriter/

llvm-svn: 213146

10 years agoTrailing linefeed.
NAKAMURA Takumi [Wed, 16 Jul 2014 13:21:58 +0000 (13:21 +0000)]
Trailing linefeed.

llvm-svn: 213145

10 years ago[ASan] Adjust 'sed' invocation to work on OS X
Timur Iskhodzhanov [Wed, 16 Jul 2014 12:56:47 +0000 (12:56 +0000)]
[ASan] Adjust 'sed' invocation to work on OS X

This is a follow-up to r213053

llvm-svn: 213144

10 years ago[Driver][Mips] Reduce code duplication - use existing function
Simon Atanasyan [Wed, 16 Jul 2014 12:29:22 +0000 (12:29 +0000)]
[Driver][Mips] Reduce code duplication - use existing function
getMipsCPUAndABI() to get MIPS ABI name during multi-library selection.

No functional changes.

llvm-svn: 213143

10 years ago[Driver][Mips] Remove flags which is not used in multi-library selection.
Simon Atanasyan [Wed, 16 Jul 2014 12:29:05 +0000 (12:29 +0000)]
[Driver][Mips] Remove flags which is not used in multi-library selection.

No functional changes.

llvm-svn: 213142

10 years ago[Driver][Mips] Reduce code duplication. Remove static isMipsNan2008() function.
Simon Atanasyan [Wed, 16 Jul 2014 12:24:48 +0000 (12:24 +0000)]
[Driver][Mips] Reduce code duplication. Remove static isMipsNan2008() function.
Use the tools::mips::isNaN2008() routine instead.

llvm-svn: 213141

10 years agoclang/test: Introduce the feature "staticanalyzer" for --enable-clang-static-analyzer.
NAKAMURA Takumi [Wed, 16 Jul 2014 12:05:45 +0000 (12:05 +0000)]
clang/test: Introduce the feature "staticanalyzer" for --enable-clang-static-analyzer.

llvm-svn: 213140

10 years agoclang/test/Sema/warn-documentation-almost-trailing.c: Rewrite checks with @LINE.
NAKAMURA Takumi [Wed, 16 Jul 2014 12:05:24 +0000 (12:05 +0000)]
clang/test/Sema/warn-documentation-almost-trailing.c: Rewrite checks with @LINE.

llvm-svn: 213139

10 years ago[mips] Correct the invocation of GAS in several cases.
Daniel Sanders [Wed, 16 Jul 2014 11:52:23 +0000 (11:52 +0000)]
[mips] Correct the invocation of GAS in several cases.

Summary:
As a result of this patch, assembling an empty file with GCC and Clang (using
GAS as the assembler) now produces identical objects.

-mfp32/-mfpxx/-mfp64 now form a trinity of options. -mfpxx is the default
when the triple vendor is 'img' or 'mti', the ABI is O32, and the CPU is
between mips2 and mips32r2/mips64r2 (inclusive).

-mno-shared is always given to the assembler to match the effect of
-mabicalls (currently unimplemented but Clang acts as if it is given).
Similarly, -call_nonpic is always given to match the effect of -mplt (also
unimplemented and acts as if given) except when the ABI is 64 in which case
-mplt has no effect so -KPIC is given instead.

-mhard-float/-msoft-float are now passed on.

-modd-spreg/-mno-odd-spreg are now passed on.

-mno-mips16 is correctly passed on. The assembler option is -no-mips16 not
-mno-mips16

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

llvm-svn: 213138

10 years ago[X86] Add a check for 'isMOVHLPSMask' within method 'isShuffleMaskLegal'.
Andrea Di Biagio [Wed, 16 Jul 2014 11:29:39 +0000 (11:29 +0000)]
[X86] Add a check for 'isMOVHLPSMask' within method 'isShuffleMaskLegal'.

Before this change, method 'isShuffleMaskLegal' didn't know that shuffles
implementing a 'movhlps' operation were perfectly legal for SSE targets.

This patch adds the missing check for 'isMOVHLPSMask' inside method
'isShuffleMaskLegal' to fix the problem.

The reason why it is important to do this is because the DAGCombiner
conservatively avoids combining a pair of shuffles if the resulting shuffle
node has an illegal mask. Before this patch, shuffles with a MOVHLPS mask were
wrongly considered not to be legal. This was the root cause of some poor-code
generation bugs.

llvm-svn: 213137

10 years ago[ASan] Factor out SymbolizationLoop.process_line() function to let Python
Alexander Potapenko [Wed, 16 Jul 2014 11:00:16 +0000 (11:00 +0000)]
[ASan] Factor out SymbolizationLoop.process_line() function to let Python
scripts that import asan_symbolize to symbolize their reports line by line.

llvm-svn: 213136

10 years agoAdd FreeBSD support to the address sanitizer's assign_large_valloc_to_global.cc test...
Viktor Kutuzov [Wed, 16 Jul 2014 10:14:01 +0000 (10:14 +0000)]
Add FreeBSD support to the address sanitizer's assign_large_valloc_to_global.cc test case
Differential Revision: http://reviews.llvm.org/D4525

llvm-svn: 213135

10 years agoAdd FreeBSD support to the address sanitizer's atexit_stats.cc test case
Viktor Kutuzov [Wed, 16 Jul 2014 10:05:29 +0000 (10:05 +0000)]
Add FreeBSD support to the address sanitizer's atexit_stats.cc test case
Differential Revision: http://reviews.llvm.org/D4524

llvm-svn: 213134

10 years ago[clang-tidy] Add a checker that warns on const string & members.
Benjamin Kramer [Wed, 16 Jul 2014 10:00:14 +0000 (10:00 +0000)]
[clang-tidy] Add a checker that warns on const string & members.

Summary:
Those are considered unsafe and should be replaced with simple pointers or
full copies. It recognizes both std::string and ::string.

Reviewers: alexfh, djasper

Subscribers: cfe-commits

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

llvm-svn: 213133

10 years ago[mips] Add support for -mfpxx and -mno-fpxx.
Daniel Sanders [Wed, 16 Jul 2014 09:57:54 +0000 (09:57 +0000)]
[mips] Add support for -mfpxx and -mno-fpxx.

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

llvm-svn: 213132

10 years agoRemove explicit references to libdl from Asan test cases
Viktor Kutuzov [Wed, 16 Jul 2014 09:53:00 +0000 (09:53 +0000)]
Remove explicit references to libdl from Asan test cases
Differential Revision: http://reviews.llvm.org/D4499

llvm-svn: 213131

10 years agoAdd FreeBSD support to the address sanitizer's null_deref.cc test case
Viktor Kutuzov [Wed, 16 Jul 2014 09:37:40 +0000 (09:37 +0000)]
Add FreeBSD support to the address sanitizer's null_deref.cc test case
Differential Revision: http://reviews.llvm.org/D4421

llvm-svn: 213130

10 years agoDon't add -Bsymbolic by default on Android.
Evgeniy Stepanov [Wed, 16 Jul 2014 08:46:35 +0000 (08:46 +0000)]
Don't add -Bsymbolic by default on Android.

-Bsymbolic is not a platform requirement and should not
be added unconditionally.

llvm-svn: 213126

10 years agounittests: Actually test reverse iterators in Path tests
Justin Bogner [Wed, 16 Jul 2014 08:18:58 +0000 (08:18 +0000)]
unittests: Actually test reverse iterators in Path tests

This re-enables some #if 0'd code (since 2010) in the Path unittests
and makes at least a weak effort at testing sys::path's rbegin/rend.

This change was inspired by some test failures near uses of rbegin and
rend here:

    http://lab.llvm.org:8011/builders/clang-x86_64-linux-vg/builds/3209

The "valgrind was whining" comment looked promising in terms of a
simpler to debug case of the same errors. However, it appears that the
valgrind complaints the comment was referring to are distinct from the
ones in the frontend, since this updated test isn't complaining for me
under valgrind.

In any case, the disabled tests weren't helping anybody.

llvm-svn: 213125

10 years agoMS ABI: Up the required alignment after inserting padding between vbases
David Majnemer [Wed, 16 Jul 2014 07:16:58 +0000 (07:16 +0000)]
MS ABI: Up the required alignment after inserting padding between vbases

We would correctly insert sufficiently aligned padding between vbases
when our leading base was empty, however we would neglect to increase
the required alignment of the most derived class.

This fixes PR20315.

llvm-svn: 213123

10 years agoAST: Convert a SmallPtrSet to a SmallPtrSetImpl in RecordLayoutBuilder
David Majnemer [Wed, 16 Jul 2014 06:30:31 +0000 (06:30 +0000)]
AST: Convert a SmallPtrSet to a SmallPtrSetImpl in RecordLayoutBuilder

No functionality changed, it just makes the code a little less brittle.

llvm-svn: 213122

10 years agoAST: Cleanup RecordLayoutBuilder
David Majnemer [Wed, 16 Jul 2014 06:04:00 +0000 (06:04 +0000)]
AST: Cleanup RecordLayoutBuilder

No functionality changed, just some cleanups:
- Switch some loops to range-based for.
- Name some iterators with a more creative name than "I".
- Reduce dependence on auto. Does RD->bases() give you a list of
  CXXBaseSpecifiers or CXXRecordDecls? It's more clear to just say which
  upfront.

llvm-svn: 213121

10 years agoImprove error recovery around colon.
Serge Pavlov [Wed, 16 Jul 2014 05:16:52 +0000 (05:16 +0000)]
Improve error recovery around colon.

Recognize additional cases, when '::' is mistyped as ':'.
This is a fix to RP18587 - colons have too much protection in member-declarations
Review is tracked by http://reviews.llvm.org/D3653.

This is an attempt to recommit the fix, initially committed as r212957 but then
reverted in r212965 as it broke self-build. In the updated patch ParseDirectDeclarator
turns on colon protection in for context as well.

llvm-svn: 213120

10 years agoDriver: bifurcate extended and basic MSC versioning
Saleem Abdulrasool [Wed, 16 Jul 2014 03:13:50 +0000 (03:13 +0000)]
Driver: bifurcate extended and basic MSC versioning

This restores the original behaviour of -fmsc-version. The older option
remains as a mechanism for specifying the basic version information. A
secondary option, -fms-compatibility-version permits the user to specify an
extended version to the driver.

The new version takes the value as a dot-separated value rather than the
major * 100 + minor format that -fmsc-version format. This makes it easier to
specify the value as well as a more flexible manner for specifying the value.

Specifying both values is considered an error.

The older parameter is left solely as a driver option, which is normalised into
the newer parameter. This allows us to retain a single code path in the
compiler itself whilst preserving the semantics of the old parameter as well as
avoid having to determine which of two formats are being used by the invocation.

The test changes are due to the fact that the compiler no longer supports the
old option, and is a direct conversion to the new option.

llvm-svn: 213119

10 years agoRoundtrip the inalloca bit on allocas through bitcode
Reid Kleckner [Wed, 16 Jul 2014 01:34:27 +0000 (01:34 +0000)]
Roundtrip the inalloca bit on allocas through bitcode

This was an oversight in the original support.  As it is, I stuffed this
bit into the alignment.  The alignment is stored in log2 form, so it
doesn't need more than 5 bits, given that Value::MaximumAlignment is 1
<< 29.

Reviewers: nicholas

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

llvm-svn: 213118

10 years agoFix comment in InstCombiner::visitAddrSpaceCast.
Manuel Jacob [Wed, 16 Jul 2014 01:34:21 +0000 (01:34 +0000)]
Fix comment in InstCombiner::visitAddrSpaceCast.

In the original version of the patch the behaviour was like described in
the comment.  This behaviour was changed before committing it without
updating the comment.

llvm-svn: 213117

10 years agoChange Windows decoration on some base classes
Saleem Abdulrasool [Wed, 16 Jul 2014 01:00:26 +0000 (01:00 +0000)]
Change Windows decoration on some base classes

Mark the base classes for time_get_byname and time_get as _LIBCPP_TYPE_VIS_ONLY
rather than _LIBCPP_TYPE_VIS.  These base classes are templated types and cannot
be stored with export dll storage.

Fixes compilation with _LIBCPP_DLL for Windows when the time_get and
time_get_byname classes are used.

llvm-svn: 213116

10 years agoAdd a test for wildcard expansion on Windows
Hans Wennborg [Wed, 16 Jul 2014 00:55:31 +0000 (00:55 +0000)]
Add a test for wildcard expansion on Windows

This depends on LLVM r213114

llvm-svn: 213115

10 years agoPerform wildcard expansion in Process::GetArgumentVector on Windows (PR17098)
Hans Wennborg [Wed, 16 Jul 2014 00:52:11 +0000 (00:52 +0000)]
Perform wildcard expansion in Process::GetArgumentVector on Windows (PR17098)

On Windows, wildcard expansion isn't performed by the shell, but left to the
program itself. The common way to do this is to link with setargv.obj, which
performs the expansion on argc/argv before main is entered. However, we don't
use argv in Clang on Windows, but instead call GetCommandLineW so we can handle
unicode arguments. This means we have to do wildcard expansion ourselves.

A test case will be added on the Clang side.

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

llvm-svn: 213114

10 years agoFixed the an objective C test case so it passes correctly.
Greg Clayton [Wed, 16 Jul 2014 00:42:06 +0000 (00:42 +0000)]
Fixed the an objective C test case so it passes correctly.

Fixed the test case to use a runtime function prototype that will be correct ([NSString stringWithCString: "new"]) instead of one that won't (expression str = [NSString stringWithFormat: @"%cew", 'N']). The runtime doesn't track vararg functions correctly so we can't reconstitute the function correctly.

Also fixed some expressions that used "str_id" whose type was "id" and do the necessary casting since "id" doesn't have any methods.

llvm-svn: 213113

10 years agoHandle diagnostic warnings in Frontend diagnostic handler.
Tyler Nowicki [Wed, 16 Jul 2014 00:40:42 +0000 (00:40 +0000)]
Handle diagnostic warnings in Frontend diagnostic handler.

Clang uses a diagnostic handler to grab diagnostic messages so it can print them
with the line of source code they refer to. This patch extends this to handle
diagnostic warnings that were added to llvm to produce a warning when
loop vectorization is explicitly specified (using a pragma clang loop directive)
but fails.

Reviewed by: Aaron Ballman

llvm-svn: 213112

10 years agoTestObjCMethods.FoundationTestCase was failing due to an error, fixed now.
Greg Clayton [Wed, 16 Jul 2014 00:39:15 +0000 (00:39 +0000)]
TestObjCMethods.FoundationTestCase was failing due to an error, fixed now.

<rdar://problem/16322133>
llvm.org/pr20267

llvm-svn: 213111

10 years agoEmit warnings if vectorization is forced and fails.
Tyler Nowicki [Wed, 16 Jul 2014 00:36:00 +0000 (00:36 +0000)]
Emit warnings if vectorization is forced and fails.

This patch modifies the existing DiagnosticInfo system to create a generic base
class that is inherited to produce diagnostic-based warnings. This is used by
the loop vectorizer to trigger a warning when vectorization is forced and
fails. Several tests have been added to verify this behavior.

Reviewed by: Arnold Schwaighofer

llvm-svn: 213110

10 years agoAvoid referencing the vtable when calling the ctor without emitting it
Reid Kleckner [Wed, 16 Jul 2014 00:30:59 +0000 (00:30 +0000)]
Avoid referencing the vtable when calling the ctor without emitting it

This fixes compilation errors about incomplete types used with WebKit's
RefPtr template.  Simply calling an out of line constructor should not
instantiate all inline and defaulted virtual methods.

Tested by building and testing several big piles of code on Linux.

Reviewers: rsmith

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

llvm-svn: 213109

10 years agoRemove TLI from isInTailCallPosition's arguments. NFC.
Juergen Ributzka [Wed, 16 Jul 2014 00:01:22 +0000 (00:01 +0000)]
Remove TLI from isInTailCallPosition's arguments. NFC.

There is no need to pass on TLI separately to the function. As Eric pointed out
the Target Machine already provides everything we need.

llvm-svn: 213108

10 years agoR600/SI: Allow using f32 rcp / rsq when denormals not handled.
Matt Arsenault [Tue, 15 Jul 2014 23:50:10 +0000 (23:50 +0000)]
R600/SI: Allow using f32 rcp / rsq when denormals not handled.

These are precise enough to use for OpenCL unless denormals
are handled.

llvm-svn: 213107

10 years agoFix compile warning.
Greg Clayton [Tue, 15 Jul 2014 23:27:56 +0000 (23:27 +0000)]
Fix compile warning.

llvm-svn: 213106

10 years agoUse the integrated assembler by default on OpenBSD/sparc.
Brad Smith [Tue, 15 Jul 2014 23:07:10 +0000 (23:07 +0000)]
Use the integrated assembler by default on OpenBSD/sparc.

llvm-svn: 213105

10 years agoX86: Simplify X86WindowsTargetObjectFile::getSectionForConstant
David Majnemer [Tue, 15 Jul 2014 23:01:10 +0000 (23:01 +0000)]
X86: Simplify X86WindowsTargetObjectFile::getSectionForConstant

There exists a helper function to abstract away the various differences
between ConstantVector, ConstantDataVector, ConstantAggregateZero, etc.

Use it to simplify X86WindowsTargetObjectFile::getSectionForConstant.

llvm-svn: 213104

10 years agoMove Post RA Scheduling flag bit into SchedMachineModel
Sanjay Patel [Tue, 15 Jul 2014 22:39:58 +0000 (22:39 +0000)]
Move Post RA Scheduling flag bit into SchedMachineModel

Refactoring; no functional changes intended

    Removed PostRAScheduler bits from subtargets (X86, ARM).
    Added PostRAScheduler bit to MCSchedModel class.
    This bit is set by a CPU's scheduling model (if it exists).
    Removed enablePostRAScheduler() function from TargetSubtargetInfo and subclasses.
    Fixed the existing enablePostMachineScheduler() method to use the MCSchedModel (was just returning false!).
    Added methods to TargetSubtargetInfo to allow overrides for AntiDepBreakMode, CriticalPathRCs, and OptLevel for PostRAScheduling.
    Added enablePostRAScheduler() function to PostRAScheduler class which queries the subtarget for the above values.
    Preserved existing scheduler behavior for ARM, MIPS, PPC, and X86:
       a. ARM overrides the CPU's postRA settings by enabling postRA for any non-Thumb or Thumb2 subtarget.
       b. MIPS overrides the CPU's postRA settings by enabling postRA for everything.
       c. PPC overrides the CPU's postRA settings by enabling postRA for everything.
       d. X86 is the only target that actually has postRA specified via sched model info.

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

llvm-svn: 213101

10 years ago[dfsan] Introduce further optimization to reduce the number of union queries.
Peter Collingbourne [Tue, 15 Jul 2014 22:13:19 +0000 (22:13 +0000)]
[dfsan] Introduce further optimization to reduce the number of union queries.

Specifically, do not compute a union if it is statically known that one
shadow set subsumes the other.

llvm-svn: 213100

10 years agoCMake: avoid a reconfigure loop from r213091
Alp Toker [Tue, 15 Jul 2014 22:11:54 +0000 (22:11 +0000)]
CMake: avoid a reconfigure loop from r213091

Removing the native CMakeCache.txt causes the target to get re-run needlessly
on some systems. We'll want another solution for that part of the fix.

llvm-svn: 213099

10 years agoSwitching some iterator-based for loops to use range-based for loops. No functional...
Aaron Ballman [Tue, 15 Jul 2014 22:03:49 +0000 (22:03 +0000)]
Switching some iterator-based for loops to use range-based for loops. No functional changes intended.

llvm-svn: 213098

10 years agoAdd __INTMAX_C_SUFFIX__ and __UINTMAX_C_SUFFIX__.
Joerg Sonnenberger [Tue, 15 Jul 2014 21:58:11 +0000 (21:58 +0000)]
Add __INTMAX_C_SUFFIX__ and __UINTMAX_C_SUFFIX__.

llvm-svn: 213097

10 years agoR600/SI: Fix select on i1
Matt Arsenault [Tue, 15 Jul 2014 21:44:37 +0000 (21:44 +0000)]
R600/SI: Fix select on i1

llvm-svn: 213096

10 years agoAdded the pack_elements range accessor. Refactoring some for loops to use range-based...
Aaron Ballman [Tue, 15 Jul 2014 21:32:31 +0000 (21:32 +0000)]
Added the pack_elements range accessor. Refactoring some for loops to use range-based for loops instead. No functional changes intended.

llvm-svn: 213095

10 years agoThe following files:
Jim Ingham [Tue, 15 Jul 2014 21:24:58 +0000 (21:24 +0000)]
The following files:

LinuxThread.cpp
LinuxThread.h
NativeRegisterContext.h
ProcessLinux.cpp
ProcessLinux.h
ProcessMonitor.cpp
ProcessMonitor.h

Were inserted in the CopyFiles phase of the "desktop" aggregate target.  That caused them to get
copied to /usr/shared/man/man1 on install, which isn't right.  Not sure why they were there...
I removed them.  If this was supposed to achieve some other purpose, we should discuss how to do
that correctly on the mailing list.

<rdar://problem/17642262>

llvm-svn: 213094

10 years ago[Refactor] Use attributes to mark function as invalid for polly
Johannes Doerfert [Tue, 15 Jul 2014 21:06:48 +0000 (21:06 +0000)]
[Refactor] Use attributes to mark function as invalid for polly

  + Test case annotated with the new attribute
  + Modified test case to check if subfunctions are annotated

llvm-svn: 213093

10 years agoTry out FileCheck's new (in r212810) -implicit-check-not in a DebugInfo test.
David Blaikie [Tue, 15 Jul 2014 21:06:37 +0000 (21:06 +0000)]
Try out FileCheck's new (in r212810) -implicit-check-not in a DebugInfo test.

Just tried this on a few tests and this was the only one that was
easily ported to use the new feature, so we'll go with that for now.
Hopefully can act as inspiration/reminder for other tests.

Not all debug info tests need to check for every DW_TAG or NULL child
terminator, but perhaps they should (just to ensure they don't accidentally
end up with tags nested inside other tags without the test failing, for example)

llvm-svn: 213092

10 years agoCMake: fix cross-compilation with external source directories
Alp Toker [Tue, 15 Jul 2014 21:04:12 +0000 (21:04 +0000)]
CMake: fix cross-compilation with external source directories

This adds support for building native artifacts when cross-compiling using the
popular side-by-side source directory layout (no symlinks, no nested
repositories).

llvm-svn: 213091

10 years agoADT: Add MapVector::remove_if
Duncan P. N. Exon Smith [Tue, 15 Jul 2014 20:24:56 +0000 (20:24 +0000)]
ADT: Add MapVector::remove_if

Add a `MapVector::remove_if()` that erases items in bulk in linear time,
as opposed to quadratic time for repeated calls to `MapVector::erase()`.

llvm-svn: 213090

10 years agoR600/SI: Implement less wrong f32 fdiv
Matt Arsenault [Tue, 15 Jul 2014 20:18:31 +0000 (20:18 +0000)]
R600/SI: Implement less wrong f32 fdiv

Assuming single precision denormals and accurate sqrt/div are not
reported, this passes the OpenCL conformance test.

llvm-svn: 213089

10 years agoR600: Add predicate for UnsafeFPMath
Matt Arsenault [Tue, 15 Jul 2014 20:18:24 +0000 (20:18 +0000)]
R600: Add predicate for UnsafeFPMath

llvm-svn: 213088

10 years agoR600: Remove intrinsics that appear to be unused
Matt Arsenault [Tue, 15 Jul 2014 20:10:27 +0000 (20:10 +0000)]
R600: Remove intrinsics that appear to be unused

llvm-svn: 213087

10 years ago[RuntimeDyld] Revert r211652 - MachO object GDB registration support.
Lang Hames [Tue, 15 Jul 2014 19:35:22 +0000 (19:35 +0000)]
[RuntimeDyld] Revert r211652 - MachO object GDB registration support.

The registration scheme used in r211652 violated the read-only contract of
MemoryBuffer. This caused crashes in llvm-rtdyld where macho objects were backed
by read-only mmap'd memory.

llvm-svn: 213086

10 years agoFix the diagnostic.cpp test to explicitly disable more google checks
Reid Kleckner [Tue, 15 Jul 2014 18:52:34 +0000 (18:52 +0000)]
Fix the diagnostic.cpp test to explicitly disable more google checks

Imagine, hypothetically, that you had a build of clang-tidy that enabled
the google-* checks by default.  If you had such a binary, then this
test would fail.  Making it pass in that configuration isn't such a bad
thing.

llvm-svn: 213085

10 years agoADT: Fix MapVector::erase()
Duncan P. N. Exon Smith [Tue, 15 Jul 2014 18:32:30 +0000 (18:32 +0000)]
ADT: Fix MapVector::erase()

Actually update the changed indexes in the map portion of `MapVector`
when erasing from the middle.  Add a unit test that checks for this.

Note that `MapVector::erase()` is a linear time operation (it was and
still is).  I'll commit a new method in a moment called
`MapVector::remove_if()` that deletes multiple entries in linear time,
which should be slightly less painful.

llvm-svn: 213084

10 years agoclang-cl: Implement the -arch flag
Ehsan Akhgari [Tue, 15 Jul 2014 18:27:51 +0000 (18:27 +0000)]
clang-cl: Implement the -arch flag

Summary:
This implements the -arch flag for both x86 and x86-64 by letting
them affect the default target features we pass to cc1.  -m machine
flags will override the features set by -arch.

Reviewers: hansw

Subscribers: cfe-commits

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

llvm-svn: 213083

10 years agoADT: Add "end namespace" comment
Duncan P. N. Exon Smith [Tue, 15 Jul 2014 18:06:56 +0000 (18:06 +0000)]
ADT: Add "end namespace" comment

This keeps clang-format from deleting the preceding newline.

llvm-svn: 213082

10 years agoImprove test of my previous patch. rdar://17633301
Fariborz Jahanian [Tue, 15 Jul 2014 17:47:58 +0000 (17:47 +0000)]
Improve test of my previous patch. rdar://17633301

llvm-svn: 213081

10 years ago[ASan] Add ASan debugging API to get malloc/free stack traces and shadow memory mappi...
Kuba Brecka [Tue, 15 Jul 2014 17:33:23 +0000 (17:33 +0000)]
[ASan] Add ASan debugging API to get malloc/free stack traces and shadow memory mapping info

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

llvm-svn: 213080

10 years agoAdd codegen for more R600 builtins
Matt Arsenault [Tue, 15 Jul 2014 17:23:46 +0000 (17:23 +0000)]
Add codegen for more R600 builtins

llvm-svn: 213079

10 years ago[RegisterCoalescer] Add new subtarget hook allowing targets to opt-out of coalescing.
Chris Bieneman [Tue, 15 Jul 2014 17:18:41 +0000 (17:18 +0000)]
[RegisterCoalescer] Add new subtarget hook allowing targets to opt-out of coalescing.

The coalescer is very aggressive at propagating constraints on the register classes, and the register allocator doesn’t know how to split sub-registers later to recover. This patch provides an escape valve for targets that encounter this problem to limit coalescing.

This patch also implements such for ARM to lower register pressure when using lots of large register classes. This works around PR18825.

llvm-svn: 213078

10 years ago[ELF] Implement parsing `-l` prefixed items in the `GROUP` linker script command.
Simon Atanasyan [Tue, 15 Jul 2014 17:17:30 +0000 (17:17 +0000)]
[ELF] Implement parsing `-l` prefixed items in the `GROUP` linker script command.
There are two forms of `-l` prefixed expression:

* -l<libname>
* -l:<filename>

In the first case a linker should construct a full library name
`lib + libname + .[so|a]` and search this library as usual. In the second case
a linker should use the `<filename>` as is and search this file through library
search directories.

The patch reviewed by Shankar Easwaran.

llvm-svn: 213077

10 years agoObjective-C IRGen. Fixes an inconsistant linkage of
Fariborz Jahanian [Tue, 15 Jul 2014 17:14:34 +0000 (17:14 +0000)]
Objective-C IRGen. Fixes an inconsistant linkage of
ObC's metaclass metadata with its class metadata which
results in an assert. rdar://17633301

llvm-svn: 213076

10 years ago[clang-tidy] Add a checker that flags unnamed parameters.
Benjamin Kramer [Tue, 15 Jul 2014 16:47:09 +0000 (16:47 +0000)]
[clang-tidy] Add a checker that flags unnamed parameters.

Summary:
We still allow the escape hatch foo(int /*x*/) and also suggest this
in a fixit. This is more powerful than the corresponding cpplint.py check
it also flags functions with multiple arguments as naming all arguments is
recommended by the google style guide.

Reviewers: alexfh, djasper

Subscribers: cfe-commits

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

llvm-svn: 213075

10 years ago[AArch64] Add negative tests for the SIMD & FP LDP instructions.
Tilmann Scheller [Tue, 15 Jul 2014 16:33:24 +0000 (16:33 +0000)]
[AArch64] Add negative tests for the SIMD & FP LDP instructions.

LDP is unpredictable if the registers in the pair are identical, these tests check that we don't assemble instructions like that and error out instead.

llvm-svn: 213074

10 years agoRevert r213070. It's breaking the build in MCELFStreamer::EmitInstToData(...).
Cameron McInally [Tue, 15 Jul 2014 16:24:24 +0000 (16:24 +0000)]
Revert r213070. It's breaking the build in MCELFStreamer::EmitInstToData(...).

llvm-svn: 213073

10 years agoR600: Implement zero undef variants of ctlz/cttz
Jan Vesely [Tue, 15 Jul 2014 15:51:09 +0000 (15:51 +0000)]
R600: Implement zero undef variants of ctlz/cttz

v2: use ffbh/l if available
v3: Rebase on top of Matt's SI patches

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Tom Stellard <tom@stellard.net>
llvm-svn: 213072

10 years ago[mips] Correct .MIPS.abiflags fp_abi field for -mfpxx and without .module
Daniel Sanders [Tue, 15 Jul 2014 15:31:39 +0000 (15:31 +0000)]
[mips] Correct .MIPS.abiflags fp_abi field for -mfpxx and without .module

Summary: Previously all the test cases set it after initialization with '.module fp=xx'.

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

llvm-svn: 213071

10 years agoAdd x86 patterns to match a specific add-with-carry.
Cameron McInally [Tue, 15 Jul 2014 15:03:32 +0000 (15:03 +0000)]
Add x86 patterns to match a specific add-with-carry.

llvm-svn: 213070

10 years ago[DAGCombiner] Add more rules to fold shuffles.
Andrea Di Biagio [Tue, 15 Jul 2014 13:26:28 +0000 (13:26 +0000)]
[DAGCombiner] Add more rules to fold shuffles.

This patch adds two new rules to the DAGCombiner:
 1.  shuffle (shuffle A, Undef, M0), B, M1 -> shuffle A, B, M2
 2.  shuffle (shuffle A, Undef, M0), A, M1 -> shuffle A, Undef, M2

We only do this if the combined shuffle is legal for the target.

Example:
;;
define <4 x float> @test(<4 x float> %a, <4 x float> %b) {
  %1 = shufflevector <4 x float> %a, <4 x float> undef, <4 x i32><i32 6, i32 0, i32 1, i32 7>
  %2 = shufflevector <4 x float> %1, <4 x float> %b, <4 x i32><i32 1, i32 2, i32 4, i32 5>
  ret <4 x i32> %2
}
;;

(using llc -mcpu=corei7 -march=x86-64)
Before, the x86 backend generated:
  pshufd $120, %xmm0, %xmm0
  shufps $-108, %xmm0, %xmm1
  movaps %xmm1, %xmm0

Now the x86 backend generates:
  movsd %xmm1, %xmm0

llvm-svn: 213069

10 years ago[clang-tidy] extend make_pair test for fixits in template definitions.
Benjamin Kramer [Tue, 15 Jul 2014 13:11:49 +0000 (13:11 +0000)]
[clang-tidy] extend make_pair test for fixits in template definitions.

llvm-svn: 213068

10 years ago[clang-tidy] Add a checker that flags all instances of overloaded unary operator&
Benjamin Kramer [Tue, 15 Jul 2014 12:48:14 +0000 (12:48 +0000)]
[clang-tidy] Add a checker that flags all instances of overloaded unary operator&

This handles both methods and freestanding overloads.

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

llvm-svn: 213067

10 years agoDon't create non-temporary twines.
Joerg Sonnenberger [Tue, 15 Jul 2014 12:18:40 +0000 (12:18 +0000)]
Don't create non-temporary twines.

llvm-svn: 213066

10 years agoMake sure int64_t and uint64_t are consistent.
Joerg Sonnenberger [Tue, 15 Jul 2014 11:51:38 +0000 (11:51 +0000)]
Make sure int64_t and uint64_t are consistent.

llvm-svn: 213065