]> granicus.if.org Git - clang/log
clang
9 years agoclang-cl: Ignore the /o option when /P is specified.
Greg Bedwell [Tue, 9 Jun 2015 10:24:06 +0000 (10:24 +0000)]
clang-cl: Ignore the /o option when /P is specified.

This matches the cl.exe behavior (tested with 18.00.31101).  In order to
specify an output file for /P, use the /Fi option instead.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239393 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoReenable Misc/interpreter.c as r239388 correctly handles such targets
David Majnemer [Tue, 9 Jun 2015 06:33:13 +0000 (06:33 +0000)]
Reenable Misc/interpreter.c as r239388 correctly handles such targets

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239389 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Driver] Preserve the object file format in ComputeEffectiveClangTriple
David Majnemer [Tue, 9 Jun 2015 06:30:01 +0000 (06:30 +0000)]
[Driver] Preserve the object file format in ComputeEffectiveClangTriple

The object file format is sometimes overridden for MSVC targets to use
ELF instead of COFF.  Make sure we preserve this choice when setting the
msvc version number in the triple.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239388 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDisable clang/test/Misc/interpreter.c, for now, since r239273 mishandled *-msvc-elf.
NAKAMURA Takumi [Tue, 9 Jun 2015 06:27:21 +0000 (06:27 +0000)]
Disable clang/test/Misc/interpreter.c, for now, since r239273 mishandled *-msvc-elf.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239387 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[MSVC Compatibility] Don't diagnose c-style cast from void-ptr to fn-ptr
David Majnemer [Tue, 9 Jun 2015 02:41:08 +0000 (02:41 +0000)]
[MSVC Compatibility] Don't diagnose c-style cast from void-ptr to fn-ptr

The machinery added to permit a static_cast from void-ptr to fn-ptr
unintentionally gets triggered for c-style casts and function-style
casts.  The observable effect was a diagnostic issued inappropriately.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239382 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agorange-for'ify Args->filtered_begin(...) loops
Sean Silva [Tue, 9 Jun 2015 01:57:17 +0000 (01:57 +0000)]
range-for'ify Args->filtered_begin(...) loops

We already have Args->filtered(...) which is a drop-in range-for
replacement.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239381 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSimplify this code a bit.
Sean Silva [Tue, 9 Jun 2015 00:47:20 +0000 (00:47 +0000)]
Simplify this code a bit.

We weren't using the short-circuiting property anyway.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239376 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoEnable DLL attribute propagation on explicit instantiation definitions (PR23770)
Hans Wennborg [Tue, 9 Jun 2015 00:39:09 +0000 (00:39 +0000)]
Enable DLL attribute propagation on explicit instantiation definitions (PR23770)

This is a follow-up to r225570 which enabled adding DLL attributes when a
class template goes from explicit instantiation declaration to explicit
instantiation definition.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239375 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMinGW: don't allow adding DLL attribute if template already has explicit instantiatio...
Hans Wennborg [Tue, 9 Jun 2015 00:39:05 +0000 (00:39 +0000)]
MinGW: don't allow adding DLL attribute if template already has explicit instantiation declaration

This is a follow-up to r238266 which failed to take MinGW into account.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239374 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoEnable propagation of dll attributes to previously instantiated base class templates...
Hans Wennborg [Tue, 9 Jun 2015 00:39:03 +0000 (00:39 +0000)]
Enable propagation of dll attributes to previously instantiated base class templates in some cases

It is safe to add a dll attribute if the base class template previously only had
an explicit instantiation declaration, or was implicitly instantiated.

I both those cases, the members would not have been codegenned yet. In the case
of explicit instantiation declaration this is natural, and for implicit
instantiations, codegen is deferred (see r225570).

This is work towards fixing PR23770.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239373 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoNarrow the -Wunsupported-dll-base-class-template warning.
Hans Wennborg [Tue, 9 Jun 2015 00:38:56 +0000 (00:38 +0000)]
Narrow the -Wunsupported-dll-base-class-template warning.

Don't warn about not being able to propagate dll attribute to a base class template
when that base already has a different attribute.

MSVC doesn't actually try to do this; the first attribute that was propagated
takes precedence, so Clang is already doing the right thing and there's no
need to warn.

(This is a step towards fixing PR21718.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239372 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[modules] Fix some visibility issues with default template arguments.
Richard Smith [Tue, 9 Jun 2015 00:35:49 +0000 (00:35 +0000)]
[modules] Fix some visibility issues with default template arguments.

There are still problems here, but this is a better starting point.

The main part of the change is: when doing a lookup that would accept visible
or hidden declarations, prefer to produce the latest visible declaration if
there are any visible declarations, rather than always producing the latest
declaration.

Thus, when we inherit default arguments (and other properties) from a previous
declaration, we inherit them from the previous visible declaration; if the
previous declaration is hidden, we already suppress inheritance of default
arguments.

There are a couple of other changes here that fix latent bugs exposed by this
change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239371 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoEliminate unnecessary namespace to prevent conflicts.
Tyler Nowicki [Mon, 8 Jun 2015 23:27:35 +0000 (23:27 +0000)]
Eliminate unnecessary namespace to prevent conflicts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239365 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoCorrect Loop Hint Diagnostic Message
Tyler Nowicki [Mon, 8 Jun 2015 23:13:43 +0000 (23:13 +0000)]
Correct Loop Hint Diagnostic Message

When pragma clang loop unroll() is specified without an argument the diagnostic message should inform that user that 'full' and 'disable' are valid arguments (not 'enable').

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239363 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMoved CPP CodeGen tests into CodeGenCXX.
Tyler Nowicki [Mon, 8 Jun 2015 22:53:36 +0000 (22:53 +0000)]
Moved CPP CodeGen tests into CodeGenCXX.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239362 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoConsider unsigned long for non-u/U decimal literals (C90/C++03)
Hubert Tong [Mon, 8 Jun 2015 21:59:59 +0000 (21:59 +0000)]
Consider unsigned long for non-u/U decimal literals (C90/C++03)

Summary:
This modifies Clang to reflect that under pre-C99 ISO C, decimal
constants may have type `unsigned long` even if they do not contain `u`
or `U` in their suffix (C90 subclause 6.1.3.2 paragraph 5). The same is
done for C++ without C++11 which--because of undefined behaviour--allows
for behaviour compatible with ISO C90 in the case of an unsuffixed
decimal literal and is otherwise identical to C90 in its treatment of
integer literals (C++03 subclause 2.13.1 [lex.icon] paragraph 2).

Messages are added to the `c99-compat` and `c++11-compat` groups to warn
on such literals, since they behave differently under the newer
standards.

Fixes PR 16678.

Test Plan:
A new test file is added to exercise both pre-C99/C++11 and C99/C++11-up
on decimal literals with no suffix or suffixes `l`/`L` for both 32-bit
and 64-bit `long`.

In the file, 2^31 (being `INT_MAX+1`) is tested for the expected type
using `__typeof__` and multiple declarations of the same entity. 2^63
is similarly tested when it is within the range of `unsigned long`.

Preprocessor arithmetic tests are added to ensure consistency given
that Clang (like GCC) uses greater than 32 bits for preprocessor
arithmetic even when `long` and `unsigned long` is 32 bits and a
pre-C99/C++11 mode is in effect.

Tests added:
  test/Sema/PR16678.c

Reviewers: fraggamuffin, rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239356 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUpdate test with target flag and amended results
Leny Kholodov [Mon, 8 Jun 2015 11:39:16 +0000 (11:39 +0000)]
Update test with target flag and amended results

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239298 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix for temporary variable names in stack reuse tests in revision 239294
Leny Kholodov [Mon, 8 Jun 2015 11:06:59 +0000 (11:06 +0000)]
Fix for temporary variable names in stack reuse tests in revision 239294

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239296 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[CodeGen] Reuse stack space from unused function results (with more accurate unused...
Leny Kholodov [Mon, 8 Jun 2015 10:23:49 +0000 (10:23 +0000)]
[CodeGen] Reuse stack space from unused function results (with more accurate unused result detection)

This patch fixes issues with unused result detection which were found in patch http://reviews.llvm.org/D9743.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239294 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Driver] Inject the MSVC compatibility version into the triple
David Majnemer [Mon, 8 Jun 2015 00:22:46 +0000 (00:22 +0000)]
[Driver] Inject the MSVC compatibility version into the triple

Encoding the version into the triple will allow us to communicate to
LLVM what functions it can expect to depend upon in the implementation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239273 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-cl: Implement /GL in terms of -flto.
Peter Collingbourne [Sat, 6 Jun 2015 02:09:34 +0000 (02:09 +0000)]
clang-cl: Implement /GL in terms of -flto.

No documentation yet; the linker needs more work.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239213 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMove a test from static-assert.cpp to DeclPrinterTest
David Majnemer [Fri, 5 Jun 2015 22:40:53 +0000 (22:40 +0000)]
Move a test from static-assert.cpp to DeclPrinterTest

It's better not to rely on the diagnostics engine to pretty print the
argument to decltype.  Instead, exercise the functionality in
DeclPrinterTest.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239197 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix typo of function name.
Eric Christopher [Fri, 5 Jun 2015 22:03:01 +0000 (22:03 +0000)]
Fix typo of function name.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239194 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRename the single non-style conformant function in TargetCodeGenInfo
Eric Christopher [Fri, 5 Jun 2015 22:03:00 +0000 (22:03 +0000)]
Rename the single non-style conformant function in TargetCodeGenInfo
and update all callers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239193 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert accidental commit
David Majnemer [Fri, 5 Jun 2015 18:24:55 +0000 (18:24 +0000)]
Revert accidental commit

This change was unrelated to r239170.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239176 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[AST] There is no message for C++1z-style static_assert
David Majnemer [Fri, 5 Jun 2015 18:03:58 +0000 (18:03 +0000)]
[AST] There is no message for C++1z-style static_assert

We would crash in the DeclPrinter trying to pretty-print the
static_assert message.  C++1z-style assertions don't have a message so
we would crash.

This fixes PR23756.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239170 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[SPARC] Fix windows test failure after r239154.
James Y Knight [Fri, 5 Jun 2015 14:16:39 +0000 (14:16 +0000)]
[SPARC] Fix windows test failure after r239154.

(Hopefully)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239156 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[SPARC] Add multiarch include paths.
James Y Knight [Fri, 5 Jun 2015 13:44:43 +0000 (13:44 +0000)]
[SPARC] Add multiarch include paths.

Adds tests verifying the proper dirs are found in the Debian 8/GCC4.9
layout for sparc (32bit), sparc (32bit) with lib64 multilib, and
sparc64.

The test cases added here also cover r239047, which fixed the linker
paths.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239154 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix for PR14269: Clang crashes when a bit field is used as inline assembler
Alexander Musman [Fri, 5 Jun 2015 13:40:59 +0000 (13:40 +0000)]
Fix for PR14269: Clang crashes when a bit field is used as inline assembler
input / output with memory constraint.
One generally can't get address of a bit field, so the general solution is to
error on such cases. GCC does the same.

Patch by Andrey Bokhanko

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239153 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[ARM] Use TargetParser to determine FPU subtarget features
John Brawn [Fri, 5 Jun 2015 13:34:11 +0000 (13:34 +0000)]
[ARM] Use TargetParser to determine FPU subtarget features

The main effect of this is to fix anomalies where certain -mfpu options didn't
disable everything that they should causing strange behaviour when combined
with -mcpu or -march values that themselves enabled fpu subtarget features,
e.g. -mfpu=fpv5-dp-d16 with -march=armv7em previously behaved the same as
-mfpu=fpv5-sp-d16 due to fp-only-sp not being disabled.

Invalid -mfpu options now also give an error, which is consistent with the
handling of the .fpu directive.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239152 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: More eagerly wrap trailing return types.
Daniel Jasper [Fri, 5 Jun 2015 13:18:09 +0000 (13:18 +0000)]
clang-format: More eagerly wrap trailing return types.

Before:
  template <typename T>
  auto aaaaaaaaaaaaaaaaaaaaaa(T t) -> decltype(eaaaaaaaaaaaaaaa<T>(t.a)
                                                   .aaaaaaaa());

After:
  template <typename T>
  auto aaaaaaaaaaaaaaaaaaaaaa(T t)
      -> decltype(eaaaaaaaaaaaaaaa<T>(t.a).aaaaaaaa());

Also add a test case for a difficult template parsing case I stumbled accross.
Needs fixing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239149 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoC++ 11 rangify for loop.
Yaron Keren [Fri, 5 Jun 2015 09:40:53 +0000 (09:40 +0000)]
C++ 11 rangify for loop.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239140 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: [JS] Let fat arrows have 'Assignment' precedence.
Daniel Jasper [Fri, 5 Jun 2015 08:25:37 +0000 (08:25 +0000)]
clang-format: [JS] Let fat arrows have 'Assignment' precedence.

This is a more correct representation than using "Equality" introduced
in r238942 which was a quick fix to solve an actual regression.

According to the typescript spec, arrows behave like "low-precedence"
assignments.

Before:
  var a = a.aaaaaaa((a: a) => aaaaaaaaaaaaaaaaaaaaa(bbbbbbbbb) &&
                    aaaaaaaaaaaaaaaaaaaaa(bbbbbbb));
After:
  var a = a.aaaaaaa((a: a) => aaaaaaaaaaaaaaaaaaaaa(bbbbbbbbb) &&
                              aaaaaaaaaaaaaaaaaaaaa(bbbbbbb));

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239137 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Concepts] lex keywords: concept and requires
Hubert Tong [Fri, 5 Jun 2015 01:10:24 +0000 (01:10 +0000)]
[Concepts] lex keywords: concept and requires

Summary:
This patch enables lexing of `concept` and `requires` as keywords.
Further changes which add messages for future keyword compat are to
follow.

Test Plan:
Testing of C++14 + Concepts TS mode is added to
`test/Lexer/keywords_test.cpp`, which expects that the new keywords are
enabled under said mode.

Reviewers: faisalv, fraggamuffin, rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239128 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove unused defaulted argument `IncludeTextualHeaders`.
Sean Silva [Thu, 4 Jun 2015 23:38:11 +0000 (23:38 +0000)]
Remove unused defaulted argument `IncludeTextualHeaders`.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239123 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoTest commit access.
Hubert Tong [Thu, 4 Jun 2015 22:53:21 +0000 (22:53 +0000)]
Test commit access.

Fixes trailing whitespace in lib/Sema/JumpDiagnostics.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239112 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSimplify ARMTargetParser::parseArch(ARMTargetParser::getCanonical()), following r239099
Artyom Skrobov [Thu, 4 Jun 2015 21:31:41 +0000 (21:31 +0000)]
Simplify ARMTargetParser::parseArch(ARMTargetParser::getCanonical()), following r239099

Reviewers: rengolin

Reviewed By: rengolin

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239101 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix terrible python goof in clang-format.py which broke my vim
Chandler Carruth [Thu, 4 Jun 2015 21:23:07 +0000 (21:23 +0000)]
Fix terrible python goof in clang-format.py which broke my vim
integration.

Nothing is more important in life than clang-format integration with
vim. ;]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239098 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[CodeGen] Add testcase for r239002.
Ahmed Bougacha [Thu, 4 Jun 2015 20:58:49 +0000 (20:58 +0000)]
[CodeGen] Add testcase for r239002.

Just realized I forgot to add it when committing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239093 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PowerPC] This revision adds 68 of the missing "Predefined Functions for Vector Progr...
Bill Seurer [Thu, 4 Jun 2015 18:45:44 +0000 (18:45 +0000)]
[PowerPC] This revision adds 68 of the missing "Predefined Functions for Vector Programming" from appendix A of the OpenPOWER ABI for Linux Supplement document.

I also added tests for the new functions and updated another test that was looking for specific line numbers in error messages from altivec.h.

https://llvm.org/bugs/show_bug.cgi?id=23679

http://reviews.llvm.org/D10131

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239066 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoC++11 rangify for loop.
Yaron Keren [Thu, 4 Jun 2015 18:33:04 +0000 (18:33 +0000)]
C++11 rangify for loop.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239064 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAllow case-insensitive values for -mcpu for ARM
Gabor Ballabas [Thu, 4 Jun 2015 17:56:32 +0000 (17:56 +0000)]
Allow case-insensitive values for -mcpu for ARM

GCC allows case-insensitive values for -mcpu, -march and -mtune options.
This patch implements the same behaviour for the -mcpu option.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239059 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[SPARC] Fix multiarch path detection for sparc and sparcv9.
James Y Knight [Thu, 4 Jun 2015 15:36:30 +0000 (15:36 +0000)]
[SPARC] Fix multiarch path detection for sparc and sparcv9.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239047 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[SPARC] Fix types of size_t, intptr_t, and ptrdiff_t on Linux.
James Y Knight [Thu, 4 Jun 2015 15:36:29 +0000 (15:36 +0000)]
[SPARC] Fix types of size_t, intptr_t, and ptrdiff_t on Linux.

They should be 'int' instead of 'long int' everywhere else except
NetBSD too, from what I gather in GCC's spec files. So, optimistically
changing it for everyone else, too.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239046 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove extraneous qualifiers due to "using namespace". NFC
Douglas Katzman [Thu, 4 Jun 2015 14:40:44 +0000 (14:40 +0000)]
Remove extraneous qualifiers due to "using namespace". NFC

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239038 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUse the appropriate PIE level for OpenBSD/sparc.
Brad Smith [Thu, 4 Jun 2015 08:45:23 +0000 (08:45 +0000)]
Use the appropriate PIE level for OpenBSD/sparc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239028 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix fragile source-col-map.c test-case.
James Y Knight [Thu, 4 Jun 2015 04:15:33 +0000 (04:15 +0000)]
Fix fragile source-col-map.c test-case.

The test passing was dependent upon your source tree being checked out
in a directory with a long enough path, to cause the diagnostics to
wrap at the expected locations.

Use stdin instead, so that the error messages consistently use
<stdin> as the filename, and get wrapped consistently.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239009 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[CodeGen][NEON] Emit constants for "immediate" intrinsic arguments.
Ahmed Bougacha [Thu, 4 Jun 2015 01:43:41 +0000 (01:43 +0000)]
[CodeGen][NEON] Emit constants for "immediate" intrinsic arguments.

On ARM/AArch64, we currently always use EmitScalarExpr for the immediate
builtin arguments, instead of directly emitting the constant. When the
overflow sanitizer is enabled, this generates overflow intrinsics
instead of constants, breaking assumptions in various places.

Instead, use the knowledge of "immediates" to directly emit a constant:
- teach the tablegen backend to emit the "immediate" modifiers
- use those modifiers in the NEON CodeGen, on ARM and AArch64.

Fixes PR23517.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239002 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDriver: Don't crash when generating crash reports for *-header inputs
Justin Bogner [Thu, 4 Jun 2015 00:30:22 +0000 (00:30 +0000)]
Driver: Don't crash when generating crash reports for *-header inputs

If we crash while handling headers, the crash report mechanism
currently tries to make a string out of a null pointer when it tries
to make up a file extension.

Map *-header input types to reasonable extensions to avoid this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238994 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[analyzer]Test commit fixing 80-column violation in comment. NFC.
Devin Coughlin [Thu, 4 Jun 2015 00:18:10 +0000 (00:18 +0000)]
[analyzer]Test commit fixing 80-column violation in comment. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238993 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSave getArch() in a local var instead of calling it 20 times, etc.
Douglas Katzman [Thu, 4 Jun 2015 00:15:00 +0000 (00:15 +0000)]
Save getArch() in a local var instead of calling it 20 times, etc.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238992 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoChange big 'if' statement into a switch. NFC
Douglas Katzman [Wed, 3 Jun 2015 19:40:30 +0000 (19:40 +0000)]
Change big 'if' statement into a switch. NFC

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238955 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Hexagon] Reapply 238773 after fix to LLVM.
Colin LeMahieu [Wed, 3 Jun 2015 17:34:22 +0000 (17:34 +0000)]
[Hexagon] Reapply 238773 after fix to LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238948 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: [JS] Let fat arrows have 'Equality' precedence.
Daniel Jasper [Wed, 3 Jun 2015 17:08:40 +0000 (17:08 +0000)]
clang-format: [JS] Let fat arrows have 'Equality' precedence.

This fixes a regression in literal formatting:

Before:
  aaaaaaaaaaaaa = {
    aaaaaaaaaaaaaaaaaaaaaaaaaaaa: (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
                                   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) =>
        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
  };

After:
  var aaaaaaaaaaaaaaaaaaaa = {
    aaaaaaaaaaaaaaaaaaaaaaaaaaaa:
        (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
         aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) =>
                aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
  };

Also apply no-else-after-return policy.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238942 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix misleading comment. NFC
Douglas Katzman [Wed, 3 Jun 2015 16:56:50 +0000 (16:56 +0000)]
Fix misleading comment. NFC

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238938 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[utils] Improvements to check_cfc.py to work better with some build systems.
Russell Gallop [Wed, 3 Jun 2015 15:09:13 +0000 (15:09 +0000)]
[utils] Improvements to check_cfc.py to work better with some build systems.

Recognise options to output dependency files and don't perform checks.
Report input file name when reporting a check failure so it is more obvious in large build logs.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238928 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[utils] Add exact check to check_cfc.py dash_s_no_change.
Russell Gallop [Wed, 3 Jun 2015 14:33:57 +0000 (14:33 +0000)]
[utils] Add exact check to check_cfc.py dash_s_no_change.

Files compiled with -via-file-asm should be byte for byte identical. This
change improves the checking on dash_s_no_change to detect non-code
differences. If there is a difference, the check goes on to compare code and
debug to try and be more informative.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238926 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agominor test fix
Asaf Badouh [Wed, 3 Jun 2015 13:42:46 +0000 (13:42 +0000)]
minor test fix

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238924 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAllow replacements created from token ranges to specify language options.
Manuel Klimek [Wed, 3 Jun 2015 13:10:41 +0000 (13:10 +0000)]
Allow replacements created from token ranges to specify language options.

The default language options will lead to incorrect replacements in C++
code, for example when trying to replace nested name specifiers ending
in "::".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238922 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAppend CXXDefaultInitExpr's wrapped expression to the CFG when visiting a constructor...
Enrico Pertoso [Wed, 3 Jun 2015 10:12:40 +0000 (10:12 +0000)]
Append CXXDefaultInitExpr's wrapped expression to the CFG when visiting a constructor initializer

Summary:
This patch is part of http://llvm-reviews.chandlerc.com/D2181.

In-class initializers are appended to the CFG when CFGBuilder::addInitializer is called.

Reviewers: jordan_rose, rsmith

Reviewed By: jordan_rose

Subscribers: cfe-commits, klimek

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238913 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix typo in cross-compilation docs: "-fpu" -> "-mfpu"
Vladimir Sukharev [Wed, 3 Jun 2015 10:11:42 +0000 (10:11 +0000)]
Fix typo in cross-compilation docs: "-fpu" -> "-mfpu"

Reviewers: rengolin

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238912 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: Properly reset BreakBeforeParameter when wrapping
Daniel Jasper [Wed, 3 Jun 2015 09:26:03 +0000 (09:26 +0000)]
clang-format: Properly reset BreakBeforeParameter when wrapping
operators to the new line.

Before:
  LOG_IF(aaa == //
         bbb)
      << a
      << b;

After:
  LOG_IF(aaa == //
         bbb)
      << a << b;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238911 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFixes a typo in a comment.
Enrico Pertoso [Wed, 3 Jun 2015 09:10:58 +0000 (09:10 +0000)]
Fixes a typo in a comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238910 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: [JS] More aggressively keep array literals on one line.
Daniel Jasper [Wed, 3 Jun 2015 08:57:36 +0000 (08:57 +0000)]
clang-format: [JS] More aggressively keep array literals on one line.

Before:
  var aaaaa: List<SomeThing> = [
    new SomeThingAAAAAAAAAAAA(),
    new SomeThingBBBBBBBBB()
  ];

After:
  var aaaaa: List<SomeThing> =
      [new SomeThingAAAAAAAAAAAA(), new SomeThingBBBBBBBBB()];

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238909 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: [JS] Fix bug in type colon detection.
Daniel Jasper [Wed, 3 Jun 2015 08:43:18 +0000 (08:43 +0000)]
clang-format: [JS] Fix bug in type colon detection.

Before, this couldn't be formatted at all:
  class X {
    subs = {
      'b': {
        'c': 1,
      },
    };
  }

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238907 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert "add the -mrecip driver flag and process its options (2nd try)"
Rafael Espindola [Wed, 3 Jun 2015 05:44:28 +0000 (05:44 +0000)]
Revert "add the -mrecip driver flag and process its options (2nd try)"

This reverts commit r238851.

It depends on a llvm commit that was reverted.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238904 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Sema] Make the atomic builtins more efficient by reducing volatility
David Majnemer [Wed, 3 Jun 2015 00:26:35 +0000 (00:26 +0000)]
[Sema] Make the atomic builtins more efficient by reducing volatility

The parameter types and return type do not need to be volatile just
because the pointer type's pointee type is volatile qualified.  This is
an unnecessary pessimization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238892 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix typo in tutorial.
Douglas Katzman [Tue, 2 Jun 2015 22:40:27 +0000 (22:40 +0000)]
Fix typo in tutorial.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238885 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[MSVC Compatibility] Permit static_cast from void-ptr to function-ptr
David Majnemer [Tue, 2 Jun 2015 22:15:12 +0000 (22:15 +0000)]
[MSVC Compatibility] Permit static_cast from void-ptr to function-ptr

The MSVC 2013 and 2015 implementation of std::atomic is specialized for
pointer types.  The member functions are implemented using a static_cast
from void-ptr to function-ptr which is not allowed in the standard.
Permit this conversion if -fms-compatibility is present.

This fixes PR23733.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238877 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoCorrect DriverInternals.rst: ccc-print-options is gone.
Douglas Katzman [Tue, 2 Jun 2015 22:06:32 +0000 (22:06 +0000)]
Correct DriverInternals.rst: ccc-print-options is gone.

Was removed in svn r189802.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238876 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: [JS] Always add space after fat arrow.
Daniel Jasper [Tue, 2 Jun 2015 22:06:07 +0000 (22:06 +0000)]
clang-format: [JS] Always add space after fat arrow.

Before:
  return () =>[];

After:
  return () => [];

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238875 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: [JS] Array literal detection fix #4.
Daniel Jasper [Tue, 2 Jun 2015 21:57:51 +0000 (21:57 +0000)]
clang-format: [JS] Array literal detection fix #4.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238873 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[x86-64 ABI] Fix for PR23082: an assertion failure when passing/returning a wrapper...
Andrea Di Biagio [Tue, 2 Jun 2015 19:34:40 +0000 (19:34 +0000)]
[x86-64 ABI] Fix for PR23082: an assertion failure when passing/returning a wrapper union in a full YMM register.

This patch fixes an assertion failure in method
'X86_64ABIInfo::GetByteVectorType'.

Method 'GetByteVectorType' (in TargetInfo.cpp) is responsible
for mapping a QualType 'Ty' (for an argument or return value) to an LLVM IR
type that, according to the ABI, must be passed in a XMM/YMM vector register.

When selecting the IR vector type, method 'GetByteVectorType' always tries to
choose the "best" IR vector type for the 'Ty' in input. In particular, if Ty
is a wrapper structure, it keeps unwrapping it until it finds a vector type VTy.
That VTy is the "preferred IR type".

However, function 'isSingleElementStructure' (used to unwrap structures) does
not know how to look through union types. So, before this patch, if Ty was in
a nest of wrapper structures with at least two union types, we would have
triggered an assertion failure (added at revision 230971).

With this patch, if method 'GetByteVectorType' fails to find the preferred
vector type, we just return a valid (although potentially 'less friendly')
vector type based on the type size. So, rather than asserting on an 'unexpected'
'Ty' in input, we conservatively return vector type <2 x double> if Ty is 16
bytes, or <4 x double> if Ty is 32 bytes.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238861 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoadd missing dependency for CodeGen lib
Sanjay Patel [Tue, 2 Jun 2015 18:02:13 +0000 (18:02 +0000)]
add missing dependency for CodeGen lib

This looks to be exposed on some bots by r238851.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238855 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoadd the -mrecip driver flag and process its options (2nd try)
Sanjay Patel [Tue, 2 Jun 2015 16:55:12 +0000 (16:55 +0000)]
add the -mrecip driver flag and process its options (2nd try)

The first try to land this (r238055) was reverted due to bot failures
caused by the LLVM part of the patch. That was hopefully fixed by r238788,
and the LLVM patch was resubmitted at r238842.

This is the front-end counterpart to D8982.

The -mrecip option interface is based on maintaining compatibility with gcc:
https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/i386-and-x86-64-Options.html#index-mrecip_003dopt-1627
https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/RS_002f6000-and-PowerPC-Options.html#index-mrecip-2289

...while adding more functionality (allowing users to specify the number of refinement steps for each
estimate type).

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238851 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: Don't try to detect C++ lambdas in other languages.
Daniel Jasper [Tue, 2 Jun 2015 15:31:37 +0000 (15:31 +0000)]
clang-format: Don't try to detect C++ lambdas in other languages.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238845 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: [JS] Fix incorrect line length calculation.
Daniel Jasper [Tue, 2 Jun 2015 15:14:21 +0000 (15:14 +0000)]
clang-format: [JS] Fix incorrect line length calculation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238841 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: [JS] Array literal detection fix #3.
Daniel Jasper [Tue, 2 Jun 2015 15:04:29 +0000 (15:04 +0000)]
clang-format: [JS] Array literal detection fix #3.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238839 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: [JS] Fix another regression when detecting array literals.
Daniel Jasper [Tue, 2 Jun 2015 14:20:08 +0000 (14:20 +0000)]
clang-format: [JS] Fix another regression when detecting array literals.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238835 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: [JS] Fix regression of detecting array literals.
Daniel Jasper [Tue, 2 Jun 2015 13:56:43 +0000 (13:56 +0000)]
clang-format: [JS] Fix regression of detecting array literals.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238832 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMake vim also output a helpful message in some error cases.
Manuel Klimek [Tue, 2 Jun 2015 12:01:50 +0000 (12:01 +0000)]
Make vim also output a helpful message in some error cases.

When clang-format encounters a syntax error, it will not format that
line; we're now using the same mechanism we're already using in emacs to
show a helpful error message to the user.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238823 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove error message when using the fallback style.
Manuel Klimek [Tue, 2 Jun 2015 11:52:15 +0000 (11:52 +0000)]
Remove error message when using the fallback style.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238822 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Basic] Transition getEnvironmentVersion from getOSVersion for android
David Majnemer [Mon, 1 Jun 2015 23:38:25 +0000 (23:38 +0000)]
[Basic] Transition getEnvironmentVersion from getOSVersion for android

'android' occupies the environment component of the triple.  Let's use
getEnvironmentVersion to extract it instead of getOSVersion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238797 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoReplace a few std::string& with StringRef. NFC.
Rafael Espindola [Mon, 1 Jun 2015 20:00:16 +0000 (20:00 +0000)]
Replace a few std::string& with StringRef. NFC.

Patch by Косов Евгений!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238774 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert "[Hexagon] Test passes for hexagon target now that the backend correctly gener...
Rafael Espindola [Mon, 1 Jun 2015 19:46:36 +0000 (19:46 +0000)]
Revert "[Hexagon] Test passes for hexagon target now that the backend correctly generates relocations."

This reverts commit r238754.

It depends on r238748, which was reverted.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238773 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix PR21945: Crash in constant evaluator.
Jonathan Roelofs [Mon, 1 Jun 2015 16:23:08 +0000 (16:23 +0000)]
Fix PR21945: Crash in constant evaluator.

Patch by Косов Евгений!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238758 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Hexagon] Test passes for hexagon target now that the backend correctly generates...
Colin LeMahieu [Mon, 1 Jun 2015 15:47:46 +0000 (15:47 +0000)]
[Hexagon] Test passes for hexagon target now that the backend correctly generates relocations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238754 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: [JS] Making arrow function wrapping more consistent.
Daniel Jasper [Mon, 1 Jun 2015 09:56:32 +0000 (09:56 +0000)]
clang-format: [JS] Making arrow function wrapping more consistent.

Before:
  someFunction(() =>
               {
                 doSomething();  // break
               })
      .doSomethingElse(  // break
          );

After:
  someFunction(() => {
    doSomething();  // break
  })
      .doSomethingElse(  // break
          );

This is still bad, but at least it is consistent with what we do for other
function literals. Added corresponding tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238736 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[MS ABI] Be a little more defensive wrt vector types
David Majnemer [Mon, 1 Jun 2015 07:41:37 +0000 (07:41 +0000)]
[MS ABI] Be a little more defensive wrt vector types

We probably shouldn't say that all appropriately sized vector types are
intel vector types (i.e. __m128, etc.) as they don't exist for all
architectures.  While this is largely academic, it'd save some debugging
if we supported such a platform.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238731 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Format] Move UnwrappedLines instead of copying.
Benjamin Kramer [Sun, 31 May 2015 11:18:05 +0000 (11:18 +0000)]
[Format] Move UnwrappedLines instead of copying.

No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238673 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: NFC. Cleanup after r237895.
Daniel Jasper [Sun, 31 May 2015 08:51:54 +0000 (08:51 +0000)]
clang-format: NFC. Cleanup after r237895.

Specifically adhere to LLVM Coding Standards (no 'else' after
return/break/continue) and remove yet another implementation of
paren counting. We already have enough of those in the
UnwrappedLineParser.

No functional changes intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238672 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: [JS] Fix line breaks in computed property names.
Daniel Jasper [Sun, 31 May 2015 08:40:37 +0000 (08:40 +0000)]
clang-format: [JS] Fix line breaks in computed property names.

Before:
  let foo = {
    [someLongKeyHere]: 1,
    someOtherLongKeyHere: 2, [keyLongEnoughToWrap]: 3,
    lastLongKey: 4
  };

After:
  let foo = {
    [someLongKeyHere]: 1,
    someOtherLongKeyHere: 2,
    [keyLongEnoughToWrap]: 3,
    lastLongKey: 4
  };

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238671 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoubsan: Check for null pointers given to certain builtins, such
Nuno Lopes [Sat, 30 May 2015 16:11:40 +0000 (16:11 +0000)]
ubsan: Check for null pointers given to certain builtins, such
as memcpy, memset, memmove, and bzero.

Reviewed by: Richard Smith

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238657 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[CodeGen] Indirect fields can initialize a union
David Majnemer [Sat, 30 May 2015 09:12:07 +0000 (09:12 +0000)]
[CodeGen] Indirect fields can initialize a union

The first named data member is the field used to default initialize the
union.  An IndirectFieldDecl can introduce the first named data member
of a union.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238649 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix 80-column violations.
Eric Christopher [Fri, 29 May 2015 23:09:49 +0000 (23:09 +0000)]
Fix 80-column violations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238630 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang/CMakeLists.txt: s/LLVM_INSTALL_PACKAGE_DIR/CLANG_INSTALL_PACKAGE_DIR/ for the...
NAKAMURA Takumi [Fri, 29 May 2015 22:58:05 +0000 (22:58 +0000)]
clang/CMakeLists.txt: s/LLVM_INSTALL_PACKAGE_DIR/CLANG_INSTALL_PACKAGE_DIR/ for the standalone configuration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238628 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Sema] Promote compound assignment exprs. with fp16 LHS and int. RHS.
Ahmed Bougacha [Fri, 29 May 2015 22:54:57 +0000 (22:54 +0000)]
[Sema] Promote compound assignment exprs. with fp16 LHS and int. RHS.

We catch most of the various other __fp16 implicit conversions to
float, but not this one:

  __fp16 a;
  int i;
  ...
  a += i;

For which we used to generate something 'fun' like:

  %conv = sitofp i32 %i to float
  %1 = tail call i16 @llvm.convert.to.fp16.f32(float %conv)
  %add = add i16 %0, %1

Instead, when we have an __fp16 LHS and an integer RHS, we should
use float as the result type.

While there, add a bunch of missing tests for mixed
__fp16/integer expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238625 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoARM: fix ACLE predefine for iOS's "-arch armv7s".
Tim Northover [Fri, 29 May 2015 21:28:25 +0000 (21:28 +0000)]
ARM: fix ACLE predefine for iOS's "-arch armv7s".

We were getting "#define __ARM_ARCH_7 -S__ 1" which is really not a good idea.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238614 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoReplace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types
Benjamin Kramer [Fri, 29 May 2015 19:42:19 +0000 (19:42 +0000)]
Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types

If the type isn't trivially moveable emplace can skip a potentially
expensive move. It also saves a couple of characters.

Call sites were found with the ASTMatcher + some semi-automated cleanup.

memberCallExpr(
    argumentCountIs(1), callee(methodDecl(hasName("push_back"))),
    on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))),
    hasArgument(0, bindTemporaryExpr(
                       hasType(recordDecl(hasNonTrivialDestructor())),
                       has(constructExpr()))),
    unless(isInTemplateInstantiation()))

No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238601 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[CMake] Bug 19462 - Use the INSTALL(EXPORT ...) to export CMake definitions
Chris Bieneman [Fri, 29 May 2015 18:36:20 +0000 (18:36 +0000)]
[CMake] Bug 19462 - Use the INSTALL(EXPORT ...) to export CMake definitions

Summary: This patch moves all the clang library targets into a ClangTargets export list, and installs it using the CMake install(EXPORT...) command.

Reviewers: rnk

Reviewed By: rnk

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238593 91177308-0d34-0410-b5e6-96231b3b80d8