David Blaikie [Wed, 16 Jul 2014 23:25:37 +0000 (23:25 +0000)]
Stuff
llvm-svn: 213210
Jingyue Wu [Wed, 16 Jul 2014 23:25:00 +0000 (23:25 +0000)]
Partially revert r210444 due to performance regression
Summary:
Converting outermost zext(a) to sext(a) causes worse code when the
computation of zext(a) could be reused. For example, after converting
... = array[zext(a)]
... = array[zext(a) + 1]
to
... = array[sext(a)]
... = array[zext(a) + 1],
the program computes sext(a), which is actually unnecessary. I added one
test in split-gep-and-gvn.ll to illustrate this scenario.
Also, with r211281 and r211084, we annotate more "nuw" tags to
computation involving CUDA intrinsics such as threadIdx.x. These
annotations help with splitting GEP a lot, rendering the benefit we get
from this reverted optimization only marginal.
Test Plan: make check-all
Reviewers: eliben, meheff
Reviewed By: meheff
Subscribers: jholewinski, llvm-commits
Differential Revision: http://reviews.llvm.org/D4542
llvm-svn: 213209
Hal Finkel [Wed, 16 Jul 2014 22:44:54 +0000 (22:44 +0000)]
Add basic (noop) CodeGen support for __assume
Clang supports __assume, at least at the semantic level, when MS extensions are
enabled. Unfortunately, trying to actually compile code using __assume would
result in this error:
error: cannot compile this builtin function yet
__assume is an optimizer hint, and can be ignored at the IR level. Until LLVM
supports assumptions at the IR level, a noop lowering is valid, and that is
what is done here.
llvm-svn: 213206
Sanjay Patel [Wed, 16 Jul 2014 22:40:28 +0000 (22:40 +0000)]
Fixed formatting, removed bug reference, renamed testcase
Thanks to Duncan Exon Smith for reviewing and cleanup suggestions.
llvm-svn: 213205
Juergen Ributzka [Wed, 16 Jul 2014 22:20:51 +0000 (22:20 +0000)]
[FastISel] Local values shouldn't be alive across an inline asm call with side effects.
This fixes an issue where a local value is defined before and used after an
inline asm call with side effects.
This fix simply flushes the local value map, which updates the insertion point
for the inline asm call to be above any previously defined local values.
This fixes <rdar://problem/
17694203>
llvm-svn: 213203
Lang Hames [Wed, 16 Jul 2014 22:02:20 +0000 (22:02 +0000)]
[MCJIT] Improve a RuntimeDyldChecker diagnostic.
When a RuntimeDyldChecker test requests an invalid operand for an instruction,
print the decoded instruction to aid diagnosis.
llvm-svn: 213202
Richard Smith [Wed, 16 Jul 2014 21:33:43 +0000 (21:33 +0000)]
When list-initializing an object of class type, if we pick an initializer list
constructor (and pass it an implicitly-generated std::initializer_list object),
be sure to mark the resulting construction as list-initialization. This fixes
an assert in template instantiation where we previously thought we'd got direct
non-list initialization without any parentheses.
llvm-svn: 213201
Hal Finkel [Wed, 16 Jul 2014 21:22:46 +0000 (21:22 +0000)]
Fix a typo in the inalloca description
llvm-svn: 213200
Greg Clayton [Wed, 16 Jul 2014 21:16:27 +0000 (21:16 +0000)]
Modify the EFI KDP debugging to not use any dynamic loader since it does manual dynamic loading itself via python modules.
Also track down the required binary by trying to locate the main executable module through LLDB's symbol and executable file locating code.
<rdar://problem/
16570258>
llvm-svn: 213199
Arthur Marble [Wed, 16 Jul 2014 21:16:16 +0000 (21:16 +0000)]
Typically linker options are protected with -Xlinker or -Wl,
however certain sloppy Makefiles pass -z options directly to
the compiler. This patch enables clang to recognize these
options (because -z is not used by clang itself).
llvm-svn: 213198
Sanjay Patel [Wed, 16 Jul 2014 21:08:10 +0000 (21:08 +0000)]
trivial fix for PR20314
Make sure that the AddrInst is an Instruction.
llvm-svn: 213197
Greg Clayton [Wed, 16 Jul 2014 21:05:41 +0000 (21:05 +0000)]
^C wasn't interrupting an expression during a long evaluation or deadlock.
The problem was that we have an IOHandler thread that services the IOHandler stack. The command interepter is on the top of the stack and it receives a "expression ..." command, and it calls the IOHandlerIsComplete() callback in the command interpereter delegate which runs an expression. This causes the IOHandlerProcessSTDIO to be pushed, but since we are running the code from the IOHandler thread, it won't get run. When CTRL+C is pressed, we do deliver the interrupt to the IOHandlerProcessSTDIO::Interrupt() function, but it was always writing 'i' to the interrupt pipe, even if we weren't actively reading from the debugger input and the pipes. This fix works around the issue by directly issuing the async interrupt to the process if the process is running.
A longer term more correct fix would to be run the IOHandler thread and have it just do the determination of the input and when complete input is received, run the code that handles that input on another thread and syncronize with that other thread to detect when more input is desired. That change is too big to make right now, so this fix will tide us over until we can get there.
<rdar://problem/
16556228>
llvm-svn: 213196
Nick Kledzik [Wed, 16 Jul 2014 21:01:17 +0000 (21:01 +0000)]
Update .gitignore to ignore hidden MacOSX Finder droppings
llvm-svn: 213195
Zachary Turner [Wed, 16 Jul 2014 20:28:24 +0000 (20:28 +0000)]
Fix some warnings in the Windows build.
llvm-svn: 213194
Aaron Ballman [Wed, 16 Jul 2014 20:28:10 +0000 (20:28 +0000)]
Specifying the diagnostic argument through the attribute table generator instead of having to enter it manually as part of the attribute subject list. This only affects attributes appertaining to ObjC interfaces and protocols.
No new tests required as this is covered by existing tests.
llvm-svn: 213193
Fariborz Jahanian [Wed, 16 Jul 2014 20:24:55 +0000 (20:24 +0000)]
Objective-C. Modify text of documentation for objc_runtime_name
attribute.
llvm-svn: 213192
Aaron Ballman [Wed, 16 Jul 2014 20:21:50 +0000 (20:21 +0000)]
Removing a FIXME from the attribute parsing code by now passing along the scope and syntax information for attributes with custom parsing. It turns out not to matter too much because the FIXME wasn't quite true -- none of these attributes have a C++11 spelling. However, it's still a good change (for instance, we may add an attribute with a type arg in the future for which this code now behaves properly).
llvm-svn: 213191
Sanjay Patel [Wed, 16 Jul 2014 20:18:49 +0000 (20:18 +0000)]
Remove Atom references in description.
Any CPU can run this pass.
llvm-svn: 213190
Manuel Jacob [Wed, 16 Jul 2014 20:13:45 +0000 (20:13 +0000)]
Utilize CastInst::CreatePointerBitCastOrAddrSpaceCast here.
llvm-svn: 213189
Chris Bieneman [Wed, 16 Jul 2014 20:13:31 +0000 (20:13 +0000)]
[RegisterCoalescer] Moving the RegisterCoalescer subtarget hook onto the TargetRegisterInfo instead of the TargetSubtargetInfo.
llvm-svn: 213188
Nick Kledzik [Wed, 16 Jul 2014 19:49:02 +0000 (19:49 +0000)]
[mach-o] refactor KindHandler into ArchHandler and simplify passes.
All architecture specific handling is now done in the appropriate
ArchHandler subclass.
The StubsPass and GOTPass have been simplified. All architecture specific
variations in stubs are now encoded in a table which is vended by the
current ArchHandler.
llvm-svn: 213187
Justin Holewinski [Wed, 16 Jul 2014 19:45:35 +0000 (19:45 +0000)]
[NVPTX] Honor alignment on vector loads/stores
We were not considering the stated alignment on vector loads/stores,
leading us to generate vector instructions even when we do not have
sufficient alignment.
Now, for IR like:
%1 = load <4 x float>, <4 x float>* %ptr, align 4
we will generate correct, conservative PTX like:
ld.f32 ... [%ptr]
ld.f32 ... [%ptr+4]
ld.f32 ... [%ptr+8]
ld.f32 ... [%ptr+12]
Or if we have an alignment of 8 (for example), we can
generate code like:
ld.v2.f32 ... [%ptr]
ld.v2.f32 ... [%ptr+8]
llvm-svn: 213186
Fariborz Jahanian [Wed, 16 Jul 2014 19:44:34 +0000 (19:44 +0000)]
Objective-C. Changes per A. Ballman's comment
for my last patch. // rdar://
17631257
llvm-svn: 213185
Arthur Marble [Wed, 16 Jul 2014 19:10:36 +0000 (19:10 +0000)]
Remove whitespace from test commit.
llvm-svn: 213184
Todd Fiala [Wed, 16 Jul 2014 19:03:16 +0000 (19:03 +0000)]
Add Host::MAX_THREAD_NAME_LENGTH constant.
This value gets set to a max uint32_t value when there is no known limit; otherwise,
it is set to a value appropriate for the platform. For the moment, only
Linux, FreeBSD and NetBSD set it to 16. All other platforms set it to
the max uint32_t value.
Modifies the Process private state thread names to fit within a 16-character limit
when the max thread name length is <= 16. These guarantee that the thread names
can be distinguished within the first 16 characters. Prior to this change, those
threads had names in the final dotted name segment that were not distinguishable
within the first 16 characters.
llvm-svn: 213183
Arthur Marble [Wed, 16 Jul 2014 19:02:11 +0000 (19:02 +0000)]
Test commit.
llvm-svn: 213182
Zachary Turner [Wed, 16 Jul 2014 18:53:18 +0000 (18:53 +0000)]
Fix build broken as a result of r213171.
r213171 renames the 'clangRewriteCore' library to 'clangRewrite'.
This change simply updates the makefiles to reference the correct
library name.
llvm-svn: 213181
Reid Kleckner [Wed, 16 Jul 2014 18:31:25 +0000 (18:31 +0000)]
Add the --target option to clang-cl and use it to fix a test.
llvm-svn: 213180
Hans Wennborg [Wed, 16 Jul 2014 18:20:35 +0000 (18:20 +0000)]
Don't use -msse2 in test/Driver/cl-options.c
It's already tested in cl-x86-flags.c, and can only be used
when targeting X86.
llvm-svn: 213179
Serge Pavlov [Wed, 16 Jul 2014 18:18:13 +0000 (18:18 +0000)]
Simplify memory management in NestedNameSpecifierLocBuilder.
With this change the memory of buffer in NestedNameSpecifierLocBuilder
is allocated in one place. It also prevents from allocation of tiny blocks.
llvm-svn: 213178
Alexey Samsonov [Wed, 16 Jul 2014 18:11:31 +0000 (18:11 +0000)]
CHECK-LABEL-ize one test
llvm-svn: 213177
Kevin Enderby [Wed, 16 Jul 2014 17:38:26 +0000 (17:38 +0000)]
Add the "-x" flag to llvm-nm for Mach-O files that prints the fields of a symbol in hex.
(generally use for debugging the tools). This is same functionality as darwin’s
nm(1) "-x" flag.
llvm-svn: 213176
Simon Atanasyan [Wed, 16 Jul 2014 17:34:54 +0000 (17:34 +0000)]
[Driver][Mips] If CPU name is not provided to the driver explicitly use
multilibs from the FSFS toolchain corresponding to the mips32r2/mips64r2 CPUs.
llvm-svn: 213175
David Blaikie [Wed, 16 Jul 2014 17:09:21 +0000 (17:09 +0000)]
Remove unnecessary/redundant std::move
(run returns unique_ptr by value already)
llvm-svn: 213174
Alp Toker [Wed, 16 Jul 2014 16:50:34 +0000 (16:50 +0000)]
Track clang r213171
The clang rewriter is now a core facility.
llvm-svn: 213173
Alp Toker [Wed, 16 Jul 2014 16:50:17 +0000 (16:50 +0000)]
Track clang r213171
The clang rewriter is now a core facility.
llvm-svn: 213172
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
Hans Wennborg [Wed, 16 Jul 2014 16:29:00 +0000 (16:29 +0000)]
clang-cl: expand test coverage for "core" options
llvm-svn: 213170
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
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
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
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
Hans Wennborg [Wed, 16 Jul 2014 16:14:09 +0000 (16:14 +0000)]
Expand the wildcard expansion test to also cover '?'
llvm-svn: 213165
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
Marshall Clow [Wed, 16 Jul 2014 15:51:50 +0000 (15:51 +0000)]
Correctly implement LWG 2049; std::is_destructible.
llvm-svn: 213163
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
Tim Northover [Wed, 16 Jul 2014 15:37:08 +0000 (15:37 +0000)]
Convert test to CHECK-LABEL
llvm-svn: 213161
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
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
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
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
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
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
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
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
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
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
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
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
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
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
NAKAMURA Takumi [Wed, 16 Jul 2014 13:21:58 +0000 (13:21 +0000)]
Trailing linefeed.
llvm-svn: 213145
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Greg Clayton [Tue, 15 Jul 2014 23:27:56 +0000 (23:27 +0000)]
Fix compile warning.
llvm-svn: 213106
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
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
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