Commit Graph

178546 Commits

Author SHA1 Message Date
Hans Wennborg db829de6d6 clang-cl: expand test coverage for "core" options
llvm-svn: 213170
2014-07-16 16:29:00 +00:00
Chris Bieneman 80a866a316 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
2014-07-16 16:27:31 +00:00
Justin Holewinski 3e037d98e6 [NVPTX] Rename registers %fl -> %fd and %rl -> %rd
This matches the internal behavior of NVIDIA tools like libnvvm.

llvm-svn: 213168
2014-07-16 16:26:58 +00:00
Fariborz Jahanian 451b92ab6a 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
2014-07-16 16:16:04 +00:00
Todd Fiala f9ad21d22a 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
2014-07-16 16:15:42 +00:00
Hans Wennborg a6c062b283 Expand the wildcard expansion test to also cover '?'
llvm-svn: 213165
2014-07-16 16:14:09 +00:00
Hans Wennborg 8a7c47ff97 clang-cl: make sure we still parse -fms-version= after r213119
The CoreOption flag got lost in the changes.

llvm-svn: 213164
2014-07-16 16:03:56 +00:00
Marshall Clow f52c88f015 Correctly implement LWG 2049; std::is_destructible.
llvm-svn: 213163
2014-07-16 15:51:50 +00:00
Tim Northover 7f3e11e7c0 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
2014-07-16 15:37:24 +00:00
Tim Northover db8011a494 Convert test to CHECK-LABEL
llvm-svn: 213161
2014-07-16 15:37:08 +00:00
Daniel Sanders 68dcb4ffa3 [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
2014-07-16 15:34:07 +00:00
Alp Toker a3c494f0db 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
2014-07-16 15:12:48 +00:00
Todd Fiala cfee963282 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
2014-07-16 15:03:10 +00:00
Benjamin Kramer 806bcabcda [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
2014-07-16 14:52:07 +00:00
Benjamin Kramer d6a499077a [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
2014-07-16 14:42:43 +00:00
Benjamin Kramer ebab1500e0 [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
2014-07-16 14:30:19 +00:00
Benjamin Kramer 2252cbf4e8 [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
2014-07-16 14:16:56 +00:00
Benjamin Kramer 73ef216c73 [ASTMatchers] Add a usingDirectiveDecl matcher.
This matches 'using namespace' declarations.

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

llvm-svn: 213152
2014-07-16 14:14:51 +00:00
Timur Iskhodzhanov bdf23a51b1 [ASan/Win] Handle situations when the client app has used DbgHelp before
Reviewed at http://reviews.llvm.org/D4533

llvm-svn: 213151
2014-07-16 14:11:02 +00:00
NAKAMURA Takumi 890c895fbc clang/test/Driver/crash-report.c: This requires rewriter for -frewrite-includes. [PR20321]
llvm-svn: 213150
2014-07-16 13:42:43 +00:00
Alexander Kornienko 1f317d6c05 Avoid adding redundant parens.
Reviewers: bkramer

Reviewed By: bkramer

Subscribers: cfe-commits, sbenza

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

llvm-svn: 213149
2014-07-16 13:38:48 +00:00
NAKAMURA Takumi 692d6bb544 clang/test: Introduce the feature "rewriter" for --enable-clang-rewriter.
llvm-svn: 213148
2014-07-16 13:36:39 +00:00
Alexander Kornienko c5ac729131 Added documentation on how clang diagnostics are reported by clang-tidy.
llvm-svn: 213147
2014-07-16 13:26:51 +00:00
NAKAMURA Takumi f596539288 Move clang/test/Frontend/rewrite-*.c to clang/test/Frontend/Rewriter/
llvm-svn: 213146
2014-07-16 13:23:13 +00:00
NAKAMURA Takumi 7d452f198d Trailing linefeed.
llvm-svn: 213145
2014-07-16 13:21:58 +00:00
Timur Iskhodzhanov 5d96f44da1 [ASan] Adjust 'sed' invocation to work on OS X
This is a follow-up to r213053

llvm-svn: 213144
2014-07-16 12:56:47 +00:00
Simon Atanasyan 7018e1dbb5 [Driver][Mips] Reduce code duplication - use existing function
getMipsCPUAndABI() to get MIPS ABI name during multi-library selection.

No functional changes.

llvm-svn: 213143
2014-07-16 12:29:22 +00:00
Simon Atanasyan 18d6ad2705 [Driver][Mips] Remove flags which is not used in multi-library selection.
No functional changes.

llvm-svn: 213142
2014-07-16 12:29:05 +00:00
Simon Atanasyan ab6db9ff2a [Driver][Mips] Reduce code duplication. Remove static isMipsNan2008() function.
Use the tools::mips::isNaN2008() routine instead.

llvm-svn: 213141
2014-07-16 12:24:48 +00:00
NAKAMURA Takumi 1fb02cb62e clang/test: Introduce the feature "staticanalyzer" for --enable-clang-static-analyzer.
llvm-svn: 213140
2014-07-16 12:05:45 +00:00
NAKAMURA Takumi 61ce64ab15 clang/test/Sema/warn-documentation-almost-trailing.c: Rewrite checks with @LINE.
llvm-svn: 213139
2014-07-16 12:05:24 +00:00
Daniel Sanders 379d44bfdf [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
2014-07-16 11:52:23 +00:00
Andrea Di Biagio a03624d8ab [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
2014-07-16 11:29:39 +00:00
Alexander Potapenko 9c62a6d8a2 [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
2014-07-16 11:00:16 +00:00
Viktor Kutuzov 4a9638324a 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
2014-07-16 10:14:01 +00:00
Viktor Kutuzov f7dfafe712 Add FreeBSD support to the address sanitizer's atexit_stats.cc test case
Differential Revision: http://reviews.llvm.org/D4524

llvm-svn: 213134
2014-07-16 10:05:29 +00:00
Benjamin Kramer b1039759fb [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
2014-07-16 10:00:14 +00:00
Daniel Sanders 2e9427a175 [mips] Add support for -mfpxx and -mno-fpxx.
Differential Revision: http://reviews.llvm.org/D4464

llvm-svn: 213132
2014-07-16 09:57:54 +00:00
Viktor Kutuzov 39c28e86a6 Remove explicit references to libdl from Asan test cases
Differential Revision: http://reviews.llvm.org/D4499

llvm-svn: 213131
2014-07-16 09:53:00 +00:00
Viktor Kutuzov 82041bbc08 Add FreeBSD support to the address sanitizer's null_deref.cc test case
Differential Revision: http://reviews.llvm.org/D4421

llvm-svn: 213130
2014-07-16 09:37:40 +00:00
Evgeniy Stepanov a333117852 Don't add -Bsymbolic by default on Android.
-Bsymbolic is not a platform requirement and should not
be added unconditionally.

llvm-svn: 213126
2014-07-16 08:46:35 +00:00
Justin Bogner 0c274aed23 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
2014-07-16 08:18:58 +00:00
David Majnemer bf3d430163 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
2014-07-16 07:16:58 +00:00
David Majnemer 1272764b18 AST: Convert a SmallPtrSet to a SmallPtrSetImpl in RecordLayoutBuilder
No functionality changed, it just makes the code a little less brittle.

llvm-svn: 213122
2014-07-16 06:30:31 +00:00
David Majnemer c964b4b4d0 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
2014-07-16 06:04:00 +00:00
Serge Pavlov 458ea76041 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
2014-07-16 05:16:52 +00:00
Saleem Abdulrasool c68237bc2c 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
2014-07-16 03:13:50 +00:00
Reid Kleckner 56b56ea15b 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
2014-07-16 01:34:27 +00:00
Manuel Jacob b4db99c76a 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
2014-07-16 01:34:21 +00:00
Saleem Abdulrasool f4a391c07f 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
2014-07-16 01:00:26 +00:00