Commit Graph

58716 Commits

Author SHA1 Message Date
Adrian Prantl c6f91a2081 Debug Info: Turn on ODR type uniquing for (the C++ part of) Objective-C++.
rdar://problem/20571359

llvm-svn: 239781
2015-06-15 23:18:16 +00:00
Reid Kleckner 2c901d4859 Fix submodule test to pass on content addressable filesystems where inodes would collide
llvm-svn: 239765
2015-06-15 21:21:17 +00:00
Peter Collingbourne c4122c17b4 Protection against stack-based memory corruption errors using SafeStack: Clang command line option and function attribute
This patch adds the -fsanitize=safe-stack command line argument for clang,
which enables the Safe Stack protection (see http://reviews.llvm.org/D6094
for the detailed description of the Safe Stack).

This patch is our implementation of the safe stack on top of Clang. The
patches make the following changes:

- Add -fsanitize=safe-stack and -fno-sanitize=safe-stack options to clang
  to control safe stack usage (the safe stack is disabled by default).

- Add __attribute__((no_sanitize("safe-stack"))) attribute to clang that can be
  used to disable the safe stack for individual functions even when enabled
  globally.

Original patch by Volodymyr Kuznetsov and others at the Dependable Systems
Lab at EPFL; updates and upstreaming by myself.

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

llvm-svn: 239762
2015-06-15 21:08:13 +00:00
Saleem Abdulrasool 425efcf6ea parser: improve diagnostics for MS attributes
Switch to using BalancedDelimiterTracker to get better diagnostics for
unbalanced delimiters.  This still does not handle any of the attributes, simply
improves the parsing.

llvm-svn: 239758
2015-06-15 20:57:04 +00:00
Reid Kleckner 717820faa0 Wildcard out some SSA value names from the ACLE intrinsic test case
llvm-svn: 239757
2015-06-15 20:55:43 +00:00
James Y Knight b240652746 [Sparc] Make soft-float emit an error.
LLVM does not and has not ever supported a soft-float ABI mode on
Sparc, so don't pretend that it does.

Also switch the default from "soft-float" -- which was actually
hard-float because soft-float is unimplemented -- to hard-float.

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

llvm-svn: 239755
2015-06-15 20:51:24 +00:00
Richard Smith f2b1eb9eb2 [modules] Better support for redefinitions of an entity from the same module.
Support this across module save/reload and extend the 'missing import'
diagnostics with a list of providing modules.

llvm-svn: 239750
2015-06-15 20:15:48 +00:00
Luke Cheeseman 59b2d83909 This patch implements clang support for the ACLE special register intrinsics
in section 10.1, __arm_{w,r}sr{,p,64}.

This includes arm_acle.h definitions with builtins and codegen to support
these, the intrinsics are implemented by generating read/write_register calls
which get appropriately lowered in the backend based on the register string
provided. SemaChecking is also implemented to fault invalid parameters.

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

llvm-svn: 239737
2015-06-15 17:51:01 +00:00
Daniel Jasper d246a5ac16 clang-format: NFC. Move testing of selective formatting to a separate file.
This is a first step for splitting the huge FormatTest.cpp into separate
files to make it easier to find specific tests.

llvm-svn: 239730
2015-06-15 15:25:11 +00:00
Douglas Katzman 9544098b8b Fix spelling in comment.
llvm-svn: 239727
2015-06-15 13:46:40 +00:00
Daniel Sanders fa555dc7f8 Revert r239721 - Replace string GNU Triples with llvm::Triple in InitMCObjectFileInfo. NFC.
It appears to cause sparc-little-endian.s to assert on Windows and Darwin.

llvm-svn: 239724
2015-06-15 10:34:38 +00:00
Daniel Jasper b2ad4d4c26 clang-format: [JS] Tweak behavior for multiline array initializer parameters
Before:
  var someVariable = SomeFuntion(aaaa, [
    aaaaaaaaaaaaaaaaaaaaaaaaaaa,
    bbbbbbbbbbbbbbbbbbbbbbbbbbb,
    ccccccccccccccccccccccccccc
  ],
                                 aaaa);

After:
  var someVariable = SomeFuntion(aaaa,
                                 [
                                   aaaaaaaaaaaaaaaaaaaaaaaaaaa,
                                   bbbbbbbbbbbbbbbbbbbbbbbbbbb,
                                   ccccccccccccccccccccccccccc
                                 ],
                                 aaaa);

llvm-svn: 239722
2015-06-15 09:23:17 +00:00
Daniel Sanders d6d12a1192 Replace string GNU Triples with llvm::Triple in InitMCObjectFileInfo. NFC.
Summary:
This affects other tools so the previous C++ API has been retained as a
deprecated function for the moment. Clang has been updated with a trivial
patch (not covered by the pre-commit review) to avoid breaking -Werror builds.
Other in-tree tools will be fixed with similar trivial patches.

This continues the patch series to eliminate StringRef forms of GNU triples
from the internals of LLVM that began in r239036.

Reviewers: rengolin

Reviewed By: rengolin

Subscribers: llvm-commits, rengolin

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

llvm-svn: 239721
2015-06-15 09:19:41 +00:00
Devin Coughlin 0bee1d7ff1 [analyzer] Remove ObjCContainersChecker size information when a CFMutableArrayRef escapes
Update ObjCContainersChecker to be notified when pointers escape so it can
remove size information for escaping CFMutableArrayRefs. When such pointers
escape, un-analyzed code could mutate the array and cause the size information
to be incorrect.

rdar://problem/19406485

llvm-svn: 239709
2015-06-15 01:00:42 +00:00
Michael Kuperstein ce1ce989e2 Add test for parsing the XOR operator in Intel syntax inline assembly.
LLVM side of the patch was committed as r239695.

Differential Revision: http://reviews.llvm.org/D10384
Patch by marina.yatsina@intel.com

llvm-svn: 239696
2015-06-14 13:03:27 +00:00
Daniel Jasper 2ebb0c57fb clang-format: [JS] Fix corner case in template string parsing.
Before, these would not properly detected because of the char/string
literal found when re-lexing after the first `:

  var x = `'`;  // comment with matching quote '
  var x = `"`;  // comment with matching quote "

llvm-svn: 239693
2015-06-14 07:16:57 +00:00
Ed Schouten 7893e6874d Add some basic support for CloudABI on i686.
Some people want to experiment with building i686 CloudABI binaries. I
am not entirely sure this is a good idea, as I'd rather see Intel x32
support appear.

As it only requires a two-line change, let's at least provide compiler
to ease experimenting.

llvm-svn: 239689
2015-06-13 21:33:49 +00:00
Rafael Espindola 408b45249a Don't use std::errc.
As noted on Errc.h:

// * std::errc is just marked with is_error_condition_enum. This means that
//   common patters like AnErrorCode == errc::no_such_file_or_directory take
//   4 virtual calls instead of two comparisons.

And on some libstdc++ those virtual functions conclude that

------------------------
int main() {
  std::error_code foo = std::make_error_code(std::errc::no_such_file_or_directory);
  return foo == std::errc::no_such_file_or_directory;
}
-------------------------

should exit with 0.

llvm-svn: 239684
2015-06-13 17:23:13 +00:00
Rafael Espindola 2b098e4606 Update for llvm api change.
llvm-svn: 239670
2015-06-13 12:50:07 +00:00
Eric Fiselier 098e6de9aa Add `-verify-ignore-unexpected` option to ignore unexpected diagnostics in VerifyDiagnosticsConsumer
Summary:
The goal of this patch is to make `-verify` easier to use when testing libc++. The `notes` attached to compile error diagnostics are numerous and relatively unstable when they reference libc++ header internals. This patch allows libc++ to write stable compilation failure tests by allowing unexpected diagnostic messages to be ignored where they are not relevant.

This patch adds a new CC1 flag called `-verify-ignore-unexpected`. `-verify-ignore-unexpected` tells `VerifyDiagnosticsConsumer` to ignore *all* unexpected diagnostic messages. `-verify-ignore-unexpected=<LevelList>` can be used to only ignore certain diagnostic levels. `<LevelList>` is a comma separated list of diagnostic levels to ignore. The supported levels are `note`, `remark`, `warning` and `error`.



Reviewers: bogner, grosser, EricWF

Reviewed By: EricWF

Subscribers: cfe-commits

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

llvm-svn: 239665
2015-06-13 07:11:40 +00:00
Hans Wennborg 8fa9677d4e Revert r239213: "clang-cl: Implement /GL in terms of -flto."
Reverting until it's easier to use this in a real-world build, e.g.
when the linker can handle it.

llvm-svn: 239656
2015-06-13 02:53:50 +00:00
Saleem Abdulrasool 28ff2317e5 docs: grammar adjustments in clang manpage
Fix a few typos and run-on sentences in the clang POD documentation.

Patch by Brian R. Gaeke!

llvm-svn: 239652
2015-06-13 01:21:58 +00:00
Ahmed Bougacha f6a9f0e112 [CodeGen] Don't evaluate immediate inlineasm arguments using isICE().
Instead, just EvaluateAsInt().

Follow-up to r239549: rsmith points out that isICE() is expensive;
seems like it's not the right concept anyway, as it fails on
`static const' in C, and will actually trigger the assert below on:
    test/Sema/inline-asm-validate-x86.c

llvm-svn: 239651
2015-06-13 01:16:10 +00:00
Alexey Samsonov d918ff62e5 [CodeGen] Use IRBuilder to create llvm.lifetime intrinsics.
Summary:
In addition to easier syntax, IRBuilder makes sure to set correct
debug locations for newly added instructions (bitcast and
llvm.lifetime itself). This restores the original behavior, which
was modified by r234581 (reapplied as r235553).

Extend one of the tests to check for debug locations.

Test Plan: regression test suite

Reviewers: aadg, dblaikie

Subscribers: cfe-commits, majnemer

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

llvm-svn: 239643
2015-06-12 22:31:32 +00:00
Hans Wennborg b274738725 [ms] Don't try to delay lookup for failures in SFINAE context (PR23823)
The underlying problem in PR23823 already existed before my recent change
in r239558, but that change made it worse (failing not only for undeclared
symbols, but also failed overload resolution). This makes Clang not try to
delay the lookup in SFINAE context. I assume no current code is relying on
SFINAE working with lookups that need to be delayed, because that never
seems to have worked.

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

llvm-svn: 239639
2015-06-12 21:23:23 +00:00
Alexey Samsonov 1054420ba3 [CGCall] Fix potential invalid iterator decrement in findDominatingStoreToReturnValue.
If llvm.lifetime.end turns out to be the first instruction in the last
basic block, we can decrement the iterator twice, going past rend.
At the moment, this can never happen because llvm.lifetime.end always
goes immediately after bitcast, but relying on this is very brittle.

llvm-svn: 239638
2015-06-12 21:05:32 +00:00
Eric Christopher 0ee1c8cd0b Quote the user provided string in the warning message and update
tests accordingly.

llvm-svn: 239635
2015-06-12 20:13:50 +00:00
Tim Northover 018578c395 Driver: only set -mlinker-version based on host if it's valid
We were adding an extra "-mlinker-version" argument to the invocation
based on a value inferred from "ld -v". This is set by the build
systems to either a sane value or an empty string (e.g. for custom
built ld), which we don't want to pass on.

No test really possible because the value depends on both host system
and how CMake was invoked.

llvm-svn: 239633
2015-06-12 19:21:35 +00:00
David Majnemer fc22e4774b [MS ABI] Lock-in the derived memptr rep. for base-to-derived conversions
We would get this right in the case where an explicit cast was formed
but not when we were performing an implicit conversion.

This fixes PR23828.

llvm-svn: 239625
2015-06-12 17:55:44 +00:00
Gabor Ballabas 726ce7fc57 Allow case-insensitive values for -mcpu for AArch64 target in line with GCC.
GCC allows case-insensitive values for -mcpu, -march and -mtune options.
This patch implements the same behaviour for the -mcpu option for the AArch64 target.

llvm-svn: 239619
2015-06-12 17:33:37 +00:00
Greg Bedwell 141e8bdfc2 Use Clang version numbers for the Windows VERSIONINFO resource.
When setting the VERSIONINFO resource to embed version information into exe and
DLL files on Windows, override the default LLVM version number values with their
clang equivalents.

llvm-svn: 239617
2015-06-12 16:33:38 +00:00
Luke Cheeseman 7f5571a129 This patch makes the NEON intrinsics vget_lane_f16, vgetq_lane_f16,
vset_lane_f16 and vsetq_lane_f16 available in AArch32.

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

llvm-svn: 239610
2015-06-12 15:52:39 +00:00
Sylvestre Ledru f8a5ce35a4 scan-build: Remove useless whitespace in File path
Patch by Honggyu Kim

Summary:
This patch removes useless whitespace in File path in index.html
Previously, a File directory path is copied and pasted as below:
  arch /arm /kernel /stacktrace.c

It just removes the whitespace between directories and makes the
copied string as below:
  arch/arm/kernel/stacktrace.c

The output looks same in html format, but the copied directory path
can be pasted as it looks.

Reviewers: krememek, zaks.anna, sylvestre.ledru

Reviewed By: sylvestre.ledru

Subscribers: aemerson, cfe-commits

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

llvm-svn: 239609
2015-06-12 15:50:27 +00:00
Douglas Katzman 0024909c68 Allow ToolChain to decide if Clang is not the right C compiler.
Removed comment in Driver::ShouldUseClangCompiler implying that there
was an opt-out ability at that point - there isn't.

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

llvm-svn: 239608
2015-06-12 15:45:21 +00:00
Benjamin Kramer f367dd90cc push_back() loop -> append() for random access iterators.
append will resize the vector to the optimal size. No functional change
intended.

llvm-svn: 239607
2015-06-12 15:31:50 +00:00
Benjamin Kramer 133aa20e22 [clang-format] Use in-class initializers to simplify constructor.
Sadly C++11 doesn't let us use initializers on bitfield members (DR1341). NFC.

llvm-svn: 239606
2015-06-12 14:39:08 +00:00
Benjamin Kramer 8ad86fc644 [clang-format] Reorder and pack ParenState members to minimize padding
sizeof(ParenState) goes from 64 bytes to 52 bytes. NFC.

llvm-svn: 239605
2015-06-12 13:07:03 +00:00
Benjamin Kramer 3aa55db86d [clang-format] Hoist vector allocation out of loop. NFC.
llvm-svn: 239604
2015-06-12 13:06:57 +00:00
Daniel Jasper 60ba32d453 clang-format: Always add space before lambda-{
Before:
  int c = []() -> int *{ return 2; }();

After:
  int c = []() -> int * { return 2; }();

Based on patch by James Dennett (http://reviews.llvm.org/D10410), thank you!

llvm-svn: 239600
2015-06-12 09:59:16 +00:00
Daniel Jasper 554e49fe84 clang-format: Understand C-style case in case label.
Before:
  case (my_int) ONE:

After:
  case (my_int)ONE:

This fixed llvm.org/PR23760

llvm-svn: 239597
2015-06-12 07:15:33 +00:00
Daniel Jasper 216c9cdb1d clang-format: [JS] Support "export enum" declarations.
llvm-svn: 239595
2015-06-12 05:08:18 +00:00
Daniel Jasper 4c0bf7034c clang-format: [JS] Add tests to ensure clang-format doesn't break code
by triggering automatic semicolon insertion changes.

NFC intended. Patch by Martin Probst.

llvm-svn: 239594
2015-06-12 04:58:27 +00:00
Daniel Jasper 259188b1b5 clang-format: [JS] Fix regression caused by r239592.
Without it, it would do:

  interface I {
    x: string;
  } var y;

llvm-svn: 239593
2015-06-12 04:56:34 +00:00
Daniel Jasper 910807d4b9 clang-format: [JS] fix incorrectly collapsed lines after export
statement.

When an exported function would follow a class declaration, it would not
be recognized as a stand-alone function. That would then collapse the
following line with the current one, e.g.

  class C {}
  export function f() {} var x;

llvm-svn: 239592
2015-06-12 04:52:02 +00:00
Nico Weber 9c39f83f80 Wrap to 80 columns. No behavior change.
llvm-svn: 239591
2015-06-12 04:44:52 +00:00
Teresa Johnson edca6e507e Revert commit r239481 as it is dependent on reverted llvm commit r239480.
llvm-svn: 239588
2015-06-12 03:11:50 +00:00
Eric Christopher 789a7ad1a8 Add a warning for unsupported elements of the target attribute.
Since we're ignoring the tune= and fpmath= attributes go ahead
and add a warning alerting people to the fact that we're going
to ignore that part of it during code generation and tie it to
the attribute warning set.

llvm-svn: 239583
2015-06-12 01:36:05 +00:00
Eric Christopher 249e3762e5 Handle fpmath= in the target attribute.
Right now we're ignoring the fpmath attribute since there's no
backend support for a feature like this and to do so would require
checking the validity of the strings and doing general subtarget
feature parsing of valid and invalid features with the target
attribute feature.

llvm-svn: 239582
2015-06-12 01:36:00 +00:00
Eric Christopher 4dfe075f93 Handle -mno-<feature> in target attribute strings by replacing the
-mno- with a -<feature> to match how we handle this in the rest
of the frontend.

llvm-svn: 239581
2015-06-12 01:35:58 +00:00
Eric Christopher 64a247b68b Add support for tune= to the target attribute support by ignoring it.
We don't currently support the -mtune option in any useful way
so ignoring the annotation is fine.

llvm-svn: 239580
2015-06-12 01:35:56 +00:00
Eric Christopher 11acf739f8 Add support for the the target attribute.
Modeled after the gcc attribute of the same name, this feature
allows source level annotations to correspond to backend code
generation. In llvm particular parlance, this allows the adding
of subtarget features and changing the cpu for a particular function
based on source level hints.

This has been added into the existing support for function level
attributes without particular verification for any target outside
of whether or not the backend will support the features/cpu given
(similar to section, etc).

llvm-svn: 239579
2015-06-12 01:35:52 +00:00
Richard Smith a1431077de [modules] Apply name visibility rules to names found by ADL.
llvm-svn: 239578
2015-06-12 01:32:13 +00:00
David Majnemer 03a9056f58 [IRGen] Fix the MSVC2013 build
llvm-svn: 239576
2015-06-12 00:17:26 +00:00
Richard Smith c785276b92 [modules] Fix crash with multiple levels of default template argument merging.
llvm-svn: 239575
2015-06-11 23:46:11 +00:00
Sean Silva b5aee61c36 [cleanup] Remove some unused #ifdef's
This is all going through the VFS layer now, so there's nothing
platform-specific here.

llvm-svn: 239573
2015-06-11 23:34:13 +00:00
Tyler Nowicki 9d268e178e Add assume_safety option for pragma loop vectorize and interleave.
Specifying #pragma clang loop vectorize(assume_safety) on a loop adds the
mem.parallel_loop_access metadata to each load/store operation in the loop. This
metadata tells loop access analysis (LAA) to skip memory dependency checking.

llvm-svn: 239572
2015-06-11 23:23:17 +00:00
Richard Smith 0f192e8940 [modules] Fix assert/crash when parsing and merging a definition of a class with a base-specifier inside a namespace.
llvm-svn: 239569
2015-06-11 22:48:25 +00:00
Hans Wennborg 64937c6f97 [ms] Do lookup in dependent base classes also when overload resolution fails (PR23810)
This patch does two things in order to enable compilation of the problematic code in PR23810:

1. In Sema::buildOverloadedCallSet, it postpones lookup for MS mode when no
viable candidate is found in the overload set. Previously, lookup would only
be postponed here if the overload set was empty.

2. Make BuildRecoveryCallExpr call Sema::DiagnoseEmptyLookup under more circumstances.
There is a comment in DiagnoseTwoPhaseLookup that says "Don't diagnose names we find in
classes; we get much better diagnostics for these from DiagnoseEmptyLookup." The problem
was that DiagnoseEmptyLookup might not get called later, and we failed to recover.

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

llvm-svn: 239558
2015-06-11 21:21:57 +00:00
Ahmed Bougacha ff75f3dd6c [CodeGen] Emit Constants for immediate inlineasm arguments.
For inline assembly immediate constraints, we currently always use
EmitScalarExpr, instead of directly emitting the constant. When the
overflow sanitizer is enabled, this generates overflow intrinsics
instead of constants.

Instead, emit a constant for constraints that either require an
immediate (e.g. 'I' on X86), or only accepts constants (immediate
or symbolic; i.e., don't accept registers or memory).

Fixes PR19763.

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

llvm-svn: 239549
2015-06-11 18:19:34 +00:00
Hans Wennborg 89e39a7d6f clang-cl: Add an alias for /wd4910
llvm-svn: 239548
2015-06-11 18:14:11 +00:00
Hans Wennborg 63899ea75c Spell -Wdllexport-explicit-instantiation-decl correctly.
llvm-svn: 239547
2015-06-11 17:51:58 +00:00
Douglas Katzman fd5286717c Add comments to PrintActions1 and Driver::PrintActions.
Differential Revision: http://reviews.llvm.org/D10214

llvm-svn: 239537
2015-06-11 15:05:22 +00:00
Sanjay Patel 2987c29a1e add the -mrecip driver flag and process its options (3rd try)
The 1st and 2nd tries to land this (r238055, r238851) were reverted due to
bot failures caused by the LLVM part of the patch. That was hopefully fixed 
after r239001.

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

llvm-svn: 239536
2015-06-11 14:53:41 +00:00
Daniel Jasper 20580fd5d3 clang-format: Make SFS_Inline imply SFS_Empty.
In the long run, these two might be independent or we might to only
allow specific combinations. Until we have a corresponding request,
however, it is hard to do the right thing and choose the right
configuration options. Thus, just don't touch the options yet and
just modify the behavior slightly.

llvm-svn: 239531
2015-06-11 13:31:45 +00:00
Daniel Jasper 56691b8cb9 clang-format: [JS] Ensure that formatting actually takes place in tests.
And fix formatting issue discovered by that :-).

llvm-svn: 239530
2015-06-11 13:29:20 +00:00
Yaron Keren b54db52a7b C++11 rangify several loops.
llvm-svn: 239528
2015-06-11 12:33:25 +00:00
Gabor Ballabas cebcb3b52f Allow case-insensitive values for -march for ARM in line with GCC.
GCC allows case-insensitive values for -mcpu, -march and -mtune options.
This patch implements the same behaviour for the -march option for ARM.

llvm-svn: 239527
2015-06-11 12:29:56 +00:00
Daniel Marjamaki 647e61244b Token: complement is() method with isOneOf() to allow easier usage
llvm-svn: 239526
2015-06-11 12:28:14 +00:00
Toma Tabacu b36d610cc2 [mips] Pass on -m{single,double}-float to GAS.
Summary: We already pass these to the IAS, but not to GAS.

Reviewers: dsanders, atanasyan

Reviewed By: atanasyan

Subscribers: llvm-commits

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

llvm-svn: 239525
2015-06-11 12:13:18 +00:00
Alexey Bataev 6e8248fdad [OPENMP] Fox for http://llvm.org/PR23663: OpenMP crash
Destroy RuntimeCleanupScope before generation of termination instruction in parallel loop precondition.

llvm-svn: 239524
2015-06-11 10:53:56 +00:00
Manuel Klimek f0c95b32ec Fix crash in clang-format.
The following example used to crash clang-format.
 #define a\
  /**/}

Adjusting the indentation level cache for the line starting with the
comment would lead to an out-of-bounds array read.

llvm-svn: 239521
2015-06-11 10:14:13 +00:00
Daniel Jasper 229628b39e clang-format: Don't add spaces in foreach macro definition.
Before clang-format would e.g. add a space into

   #define Q_FOREACH(x, y)

which turns this into a non-function-like macro.

Patch by Strager Neds, thank you!

llvm-svn: 239513
2015-06-11 08:38:19 +00:00
David Majnemer e0e228a380 Reinstate r239499 and r239503
They were reverted because the FileCheck patterns didn't match on
release builds.

llvm-svn: 239512
2015-06-11 08:12:44 +00:00
Manuel Klimek aad3b8486d Revert "[MS ABI] Allow fastcall member function pointers to get CodeGen'd"
Revert "[MS ABI] Allow memfn pointers with unconvertible types to be formed"

This reverts r239499 and r239503; the former breaks tests [1] and the
latter is based on the former.

[1]
http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_check/4473/testReport/Clang/CodeGenCXX/microsoft_abi_virtual_member_pointers_cpp/

llvm-svn: 239511
2015-06-11 07:54:35 +00:00
Nemanja Ivanovic b17f1129fa Clang support for vector quad bit permute and gather instructions through builtins
This patch corresponds to review:
http://reviews.llvm.org/D10095

This is for just two instructions and related builtins:
vbpermq
vgbbd

llvm-svn: 239506
2015-06-11 06:25:36 +00:00
Richard Smith 00be6d0ff8 [modules] Fix a few places where merging wasn't performed if modules was disabled but local module visibilty was enabled.
llvm-svn: 239504
2015-06-11 03:05:39 +00:00
David Majnemer 9321f926b0 [MS Compatibility] Handle cleanups we create for a ctor closure
This fixes PR23801.

llvm-svn: 239503
2015-06-11 02:38:06 +00:00
David Majnemer ac936ff5ab [MS ABI] Allow fastcall member function pointers to get CodeGen'd
This restriction appears unnecessary and most likely came about during
early work for musttail.

llvm-svn: 239500
2015-06-11 00:45:44 +00:00
David Majnemer 01b9bb42d4 [MS ABI] Allow memfn pointers with unconvertible types to be formed
Remove the restriction which forbade forming pointers to member
functions which had parameter types or return types which were not
convertible.

llvm-svn: 239499
2015-06-11 00:20:57 +00:00
Alexei Starovoitov f657ca8d78 [bpf] add support for BPF backend
add support for bpfel/bpfeb targets

llvm-svn: 239496
2015-06-10 22:59:13 +00:00
Richard Smith ae7c04f065 Work around MSVC miscompilation.
llvm-svn: 239494
2015-06-10 22:49:14 +00:00
Richard Smith 95d83959d8 [modules] Don't allow use of non-visible (inherited) default template arguments.
llvm-svn: 239487
2015-06-10 20:36:34 +00:00
Richard Smith e7bd6defd7 [modules] Track all default template arguments for a given parameter across
modules, and allow use of a default template argument if any of the parameters
providing it is visible.

llvm-svn: 239485
2015-06-10 20:30:23 +00:00
Serge Pavlov 47ebb75cf9 Do not parse members of incomplete class.
If definition of a class is unknown and out-of-line definition of its
member is encountered, do not parse the member declaration.
This change fixes PR18542.

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

llvm-svn: 239483
2015-06-10 19:06:59 +00:00
Teresa Johnson 88c3c67997 Pass down the -flto option to the -cc1 job, and from there into the
CodeGenOptions and onto the PassManagerBuilder. This enables gating
the new EliminateAvailableExternally module pass on whether we are
preparing for LTO.

If we are preparing for LTO (e.g. a -flto -c compile), the new pass is not
included as we want to preserve available externally functions for possible
link time inlining.

llvm-svn: 239481
2015-06-10 17:49:45 +00:00
Scott Douglass cc01359cfe some StmtExprs do not have side-effects
Differential Revision: http://reviews.llvm.org/D10211

llvm-svn: 239476
2015-06-10 15:18:23 +00:00
Scott Douglass 503fc39d1f add ConstEvaluatedExprVisitor
Differential Revision: http://reviews.llvm.org/D10210

llvm-svn: 239474
2015-06-10 13:53:15 +00:00
Alexander Musman 70e9f5fcb3 PR5172: Fix for a bug in pragma redefine_extname implementation:
it doesn't work correctly when a structure is declared before pragma
and then a function with the same name declared after pragma.

Patch by Andrey Bokhanko

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

llvm-svn: 239466
2015-06-10 11:20:26 +00:00
Daniel Jasper 11ca263994 clang-format: [JS] Only special case top level object literal
assignments as enums.

Top level object literals are treated as enums, and their k/v pairs are put on
separate lines:

  X.Y = {
    A: 1,
    B: 2
  };

However assignments within blocks should not be affected:

  function x() {
    y = {a:1, b:2};
  }

This change fixes the second case. Patch by Martin Probst.

llvm-svn: 239462
2015-06-10 09:21:09 +00:00
Yunzhong Gao d290eb4565 Fix the test case to handle different IR variable names.
llvm-svn: 239457
2015-06-10 03:19:08 +00:00
Richard Smith 8346e52f89 [modules] Reconstruct template default argument inheritance on reload rather
than wasting storage and triggering eager deserializations by serializing it.

llvm-svn: 239454
2015-06-10 01:47:58 +00:00
Sean Silva 4881e8b239 [cleanup] Remove unused default argument and tidy up.
The RequestingModule argument was unused and always its default value of
nullptr.

Also move a declaration closer to its use, and range-for'ify.

llvm-svn: 239453
2015-06-10 01:37:59 +00:00
Richard Smith 8dbe7e236c Revert accidentally-committed test change from r239447.
llvm-svn: 239452
2015-06-10 01:36:14 +00:00
Richard Smith 1469b9196c Refactor storage of default template arguments.
This is just a preparatory step towards fixing visibility for default template
arguments in modules builds.

llvm-svn: 239447
2015-06-10 00:29:03 +00:00
Yunzhong Gao cb77930d6b Implementing C99 partial re-initialization behavior (DR-253)
Based on previous discussion on the mailing list, clang currently lacks support
for C99 partial re-initialization behavior:
Reference: http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-April/029188.html
Reference: http://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_253.htm

This patch attempts to fix this problem.

Given the following code snippet,

struct P1 { char x[6]; };
struct LP1 { struct P1 p1; };

struct LP1 l = { .p1 = { "foo" }, .p1.x[2] = 'x' };
// this example is adapted from the example for "struct fred x[]" in DR-253;
// currently clang produces in l: { "\0\0x" },
//   whereas gcc 4.8 produces { "fox" };
// with this fix, clang will also produce: { "fox" };


Differential Review: http://reviews.llvm.org/D5789

llvm-svn: 239446
2015-06-10 00:27:52 +00:00
Akira Hatanaka 262a4c4ec0 Attach attribute "disable-tail-calls" to the functions in the IR.
This commit adds back the code that seems to have been dropped unintentionally
in r176985.

rdar://problem/13752163

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

llvm-svn: 239426
2015-06-09 19:04:36 +00:00
David Majnemer 2617ea6756 [ItaniumMangle] Mangle long double as __float128 for some Power targets
GCC mangles long double like __float128 in order to support
compatibility with ABI variants which had a different interpretation of
long double.

This fixes PR23791.

llvm-svn: 239421
2015-06-09 18:05:33 +00:00
Reid Kleckner 0b9bbbfc13 Revert "Re-land r236052, "[SEH] Add 32-bit lowering code for __try""
This reverts commit r239415. This was committed accidentally, LLVM isn't
ready for this.

llvm-svn: 239417
2015-06-09 17:49:42 +00:00
Reid Kleckner f8439940ef Disable style-on-command-line test on Windows
llvm-svn: 239416
2015-06-09 17:47:59 +00:00
Reid Kleckner 65870442b3 Re-land r236052, "[SEH] Add 32-bit lowering code for __try"
This reverts r236167.

LLVM should be ready for this now.

llvm-svn: 239415
2015-06-09 17:47:50 +00:00
Bill Seurer 703e8486ec [PowerPC] Reformat altivec.h with clang-format
This revision just fixes the formatting of altivec.h.

llvm-svn: 239408
2015-06-09 14:39:47 +00:00
Jonathan Roelofs 6eef12f06f Move target-specific Sema test to its own file.
Fixing the build-break introduced in r239406.

llvm-svn: 239407
2015-06-09 14:30:17 +00:00
Jonathan Roelofs 78f9e038e0 Fix printing of GCCAsmExprs with input or output arguments.
Patch by Nick Sumner!

llvm-svn: 239406
2015-06-09 14:13:31 +00:00
Daniel Jasper dee894f6bb clang-format: Support //!-comments, increase test coverage.
llvm-svn: 239404
2015-06-09 13:16:54 +00:00
Benjamin Kramer fea47d418a Remove rm invocations where the file is immediately rewritten later.
This may or may not help making this test less flaky on windows. There's
a race condition in lit somewhere.

llvm-svn: 239402
2015-06-09 12:41:02 +00:00
Benjamin Kramer a242aaa501 Remove unused diagnostics.
-Wreceiver-is-weak is unused but should be ignored, move it to the list
of diagnostic groups.

llvm-svn: 239401
2015-06-09 12:17:19 +00:00
Aaron Ballman 825fb3c9d4 Removing spurious semi colons; NFC.
llvm-svn: 239400
2015-06-09 12:04:17 +00:00
Daniel Jasper c83d76991c clang-format: [JS] Hotfix for runtime issue with deeply nested JS code.
I have not succeeded in writing a proper test case for this yet and we
also need to solve the underlying fundamental problem of trying too
many combinations with nested blocks (basically this somewhat works
around our Dijkstra algorithm). Preventing this linebreak is good
anyways as usually the penalties never make us choose it (that's why I
can't create a test) and it also looks ugly.

Also cleaned up state comparison code that I discovered while hunting
this down.

llvm-svn: 239398
2015-06-09 11:39:22 +00:00
Greg Bedwell 065f70ae80 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

llvm-svn: 239393
2015-06-09 10:24:06 +00:00
David Majnemer c7ee97d696 Reenable Misc/interpreter.c as r239388 correctly handles such targets
llvm-svn: 239389
2015-06-09 06:33:13 +00:00
David Majnemer 75fdd6b888 [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.

llvm-svn: 239388
2015-06-09 06:30:01 +00:00
NAKAMURA Takumi b21e942ac1 Disable clang/test/Misc/interpreter.c, for now, since r239273 mishandled *-msvc-elf.
llvm-svn: 239387
2015-06-09 06:27:21 +00:00
David Majnemer 78324f2bce [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.

llvm-svn: 239382
2015-06-09 02:41:08 +00:00
Sean Silva 14facf307c range-for'ify Args->filtered_begin(...) loops
We already have Args->filtered(...) which is a drop-in range-for
replacement.

llvm-svn: 239381
2015-06-09 01:57:17 +00:00
Sean Silva ab70cfa3af Simplify this code a bit.
We weren't using the short-circuiting property anyway.

llvm-svn: 239376
2015-06-09 00:47:20 +00:00
Hans Wennborg fce87cae44 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.

llvm-svn: 239375
2015-06-09 00:39:09 +00:00
Hans Wennborg c0875507be 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.

llvm-svn: 239374
2015-06-09 00:39:05 +00:00
Hans Wennborg bb1983cf3a 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.

llvm-svn: 239373
2015-06-09 00:39:03 +00:00
Hans Wennborg 29b7a93935 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.)

llvm-svn: 239372
2015-06-09 00:38:56 +00:00
Richard Smith 87bb569844 [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.

llvm-svn: 239371
2015-06-09 00:35:49 +00:00
Tyler Nowicki 4e8e900dd1 Eliminate unnecessary namespace to prevent conflicts.
llvm-svn: 239365
2015-06-08 23:27:35 +00:00
Tyler Nowicki 24853c123a 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').

llvm-svn: 239363
2015-06-08 23:13:43 +00:00
Tyler Nowicki 90203dc855 Moved CPP CodeGen tests into CodeGenCXX.
llvm-svn: 239362
2015-06-08 22:53:36 +00:00
Hubert Tong 13234ae40d 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

llvm-svn: 239356
2015-06-08 21:59:59 +00:00
Leny Kholodov 1c5ad681d7 Update test with target flag and amended results
llvm-svn: 239298
2015-06-08 11:39:16 +00:00
Leny Kholodov 8a7b827b3d Fix for temporary variable names in stack reuse tests in revision 239294
llvm-svn: 239296
2015-06-08 11:06:59 +00:00
Leny Kholodov 6aab1117e8 [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

llvm-svn: 239294
2015-06-08 10:23:49 +00:00
David Majnemer e11d373512 [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.

llvm-svn: 239273
2015-06-08 00:22:46 +00:00
Peter Collingbourne 8a484c3017 clang-cl: Implement /GL in terms of -flto.
No documentation yet; the linker needs more work.

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

llvm-svn: 239213
2015-06-06 02:09:34 +00:00
David Majnemer 8423df927e 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.

llvm-svn: 239197
2015-06-05 22:40:53 +00:00
Eric Christopher 56df435693 Fix typo of function name.
llvm-svn: 239194
2015-06-05 22:03:01 +00:00
Eric Christopher 162c91ccc4 Rename the single non-style conformant function in TargetCodeGenInfo
and update all callers.

llvm-svn: 239193
2015-06-05 22:03:00 +00:00
David Majnemer 81ecbf45d4 Revert accidental commit
This change was unrelated to r239170.

llvm-svn: 239176
2015-06-05 18:24:55 +00:00
David Majnemer cdffc36c11 [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.

llvm-svn: 239170
2015-06-05 18:03:58 +00:00
James Y Knight f9373862ea [SPARC] Fix windows test failure after r239154.
(Hopefully)

llvm-svn: 239156
2015-06-05 14:16:39 +00:00
James Y Knight 09677ad882 [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.

llvm-svn: 239154
2015-06-05 13:44:43 +00:00
Alexander Musman eae29e247e 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

llvm-svn: 239153
2015-06-05 13:40:59 +00:00
John Brawn 5a589ad603 [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

llvm-svn: 239152
2015-06-05 13:34:11 +00:00
Daniel Jasper 6f2b88a398 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.

llvm-svn: 239149
2015-06-05 13:18:09 +00:00
Yaron Keren 10d6d1689b C++ 11 rangify for loop.
llvm-svn: 239140
2015-06-05 09:40:53 +00:00
Daniel Jasper 3b0f304517 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));

llvm-svn: 239137
2015-06-05 08:25:37 +00:00
Hubert Tong 6e04f98bc3 [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

llvm-svn: 239128
2015-06-05 01:10:24 +00:00
Sean Silva 8230e5ee51 Remove unused defaulted argument `IncludeTextualHeaders`.
llvm-svn: 239123
2015-06-04 23:38:11 +00:00
Hubert Tong 64c2f5a50f Test commit access.
Fixes trailing whitespace in lib/Sema/JumpDiagnostics.cpp.

llvm-svn: 239112
2015-06-04 22:53:21 +00:00
Artyom Skrobov 902ac2d837 Simplify ARMTargetParser::parseArch(ARMTargetParser::getCanonical()), following r239099
Reviewers: rengolin

Reviewed By: rengolin

Subscribers: cfe-commits

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

llvm-svn: 239101
2015-06-04 21:31:41 +00:00
Chandler Carruth c925a905f7 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. ;]

llvm-svn: 239098
2015-06-04 21:23:07 +00:00
Ahmed Bougacha 01950a02c0 [CodeGen] Add testcase for r239002.
Just realized I forgot to add it when committing.

llvm-svn: 239093
2015-06-04 20:58:49 +00:00
Bill Seurer 8be14f11ce [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

llvm-svn: 239066
2015-06-04 18:45:44 +00:00
Yaron Keren 713bfbb2d4 C++11 rangify for loop.
llvm-svn: 239064
2015-06-04 18:33:04 +00:00
Gabor Ballabas 208826cc0f 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.

llvm-svn: 239059
2015-06-04 17:56:32 +00:00
James Y Knight c0aeadf92d [SPARC] Fix multiarch path detection for sparc and sparcv9.
llvm-svn: 239047
2015-06-04 15:36:30 +00:00
James Y Knight 4b4d19ede2 [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.

llvm-svn: 239046
2015-06-04 15:36:29 +00:00
Douglas Katzman f08fadfe2b Remove extraneous qualifiers due to "using namespace". NFC
llvm-svn: 239038
2015-06-04 14:40:44 +00:00
Brad Smith b58159ab1f Use the appropriate PIE level for OpenBSD/sparc.
llvm-svn: 239028
2015-06-04 08:45:23 +00:00
James Y Knight 4c5901eefc 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.

llvm-svn: 239009
2015-06-04 04:15:33 +00:00
Ahmed Bougacha 94df730f7d [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

llvm-svn: 239002
2015-06-04 01:43:41 +00:00
Justin Bogner 90e8e2c586 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.

llvm-svn: 238994
2015-06-04 00:30:22 +00:00
Devin Coughlin d7112c391c [analyzer]Test commit fixing 80-column violation in comment. NFC.
llvm-svn: 238993
2015-06-04 00:18:10 +00:00
Douglas Katzman fe77e0dcfc Save getArch() in a local var instead of calling it 20 times, etc.
Differential Revision: http://reviews.llvm.org/D10224

llvm-svn: 238992
2015-06-04 00:15:00 +00:00
Douglas Katzman 7ae27b88dd Change big 'if' statement into a switch. NFC
Differential Revision: http://reviews.llvm.org/D10223

llvm-svn: 238955
2015-06-03 19:40:30 +00:00
Colin LeMahieu e4c0d58f62 [Hexagon] Reapply 238773 after fix to LLVM.
llvm-svn: 238948
2015-06-03 17:34:22 +00:00
Daniel Jasper 3c306e895e 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.

llvm-svn: 238942
2015-06-03 17:08:40 +00:00
Douglas Katzman 9dc5fbb458 Fix misleading comment. NFC
llvm-svn: 238938
2015-06-03 16:56:50 +00:00
Russell Gallop 14c4dab603 [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

llvm-svn: 238928
2015-06-03 15:09:13 +00:00
Russell Gallop aef6d17c8d [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.

llvm-svn: 238926
2015-06-03 14:33:57 +00:00
Asaf Badouh 5a26b25471 minor test fix
llvm-svn: 238924
2015-06-03 13:42:46 +00:00
Manuel Klimek 94a89231f6 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 "::".

llvm-svn: 238922
2015-06-03 13:10:41 +00:00
Enrico Pertoso faed801f6e 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

llvm-svn: 238913
2015-06-03 10:12:40 +00:00
Vladimir Sukharev c85ed8567c Fix typo in cross-compilation docs: "-fpu" -> "-mfpu"
Reviewers: rengolin

Subscribers: cfe-commits

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

llvm-svn: 238912
2015-06-03 10:11:42 +00:00
Daniel Jasper 5962fa80c2 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;

llvm-svn: 238911
2015-06-03 09:26:03 +00:00
Enrico Pertoso 4432d87578 Fixes a typo in a comment.
llvm-svn: 238910
2015-06-03 09:10:58 +00:00
Daniel Jasper 9970df1f79 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()];

llvm-svn: 238909
2015-06-03 08:57:36 +00:00
Daniel Jasper 81dbb564a1 clang-format: [JS] Fix bug in type colon detection.
Before, this couldn't be formatted at all:
  class X {
    subs = {
      'b': {
        'c': 1,
      },
    };
  }

llvm-svn: 238907
2015-06-03 08:43:18 +00:00
Rafael Espindola dc9293d051 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.

llvm-svn: 238904
2015-06-03 05:44:28 +00:00
David Majnemer c6eb650120 [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.

llvm-svn: 238892
2015-06-03 00:26:35 +00:00
Douglas Katzman 677324e0b5 Fix typo in tutorial.
llvm-svn: 238885
2015-06-02 22:40:27 +00:00
David Majnemer 85bd120679 [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.

llvm-svn: 238877
2015-06-02 22:15:12 +00:00
Douglas Katzman 9c19d35fa7 Correct DriverInternals.rst: ccc-print-options is gone.
Was removed in svn r189802.

llvm-svn: 238876
2015-06-02 22:06:32 +00:00
Daniel Jasper e497beddb5 clang-format: [JS] Always add space after fat arrow.
Before:
  return () =>[];

After:
  return () => [];

llvm-svn: 238875
2015-06-02 22:06:07 +00:00
Daniel Jasper d492b5ec03 clang-format: [JS] Array literal detection fix #4.
llvm-svn: 238873
2015-06-02 21:57:51 +00:00
Andrea Di Biagio e7347c67cd [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

llvm-svn: 238861
2015-06-02 19:34:40 +00:00
Sanjay Patel 21141d7a9c add missing dependency for CodeGen lib
This looks to be exposed on some bots by r238851.

llvm-svn: 238855
2015-06-02 18:02:13 +00:00
Sanjay Patel d79da01631 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

llvm-svn: 238851
2015-06-02 16:55:12 +00:00
Daniel Jasper 1feab0f95e clang-format: Don't try to detect C++ lambdas in other languages.
llvm-svn: 238845
2015-06-02 15:31:37 +00:00
Daniel Jasper 199d0c9e76 clang-format: [JS] Fix incorrect line length calculation.
llvm-svn: 238841
2015-06-02 15:14:21 +00:00
Daniel Jasper 40432cee93 clang-format: [JS] Array literal detection fix #3.
llvm-svn: 238839
2015-06-02 15:04:29 +00:00
Daniel Jasper 4284e3623c clang-format: [JS] Fix another regression when detecting array literals.
llvm-svn: 238835
2015-06-02 14:20:08 +00:00
Daniel Jasper 5ce80de4de clang-format: [JS] Fix regression of detecting array literals.
llvm-svn: 238832
2015-06-02 13:56:43 +00:00
Manuel Klimek 995901756f 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.

llvm-svn: 238823
2015-06-02 12:01:50 +00:00
Manuel Klimek 21b4117a12 Remove error message when using the fallback style.
llvm-svn: 238822
2015-06-02 11:52:15 +00:00
David Majnemer 5c2589a50b [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.

llvm-svn: 238797
2015-06-01 23:38:25 +00:00
Rafael Espindola c0f18a91ac Replace a few std::string& with StringRef. NFC.
Patch by Косов Евгений!

llvm-svn: 238774
2015-06-01 20:00:16 +00:00
Rafael Espindola 015455848e 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.

llvm-svn: 238773
2015-06-01 19:46:36 +00:00
Jonathan Roelofs 104cbf9c32 Fix PR21945: Crash in constant evaluator.
Patch by Косов Евгений!

llvm-svn: 238758
2015-06-01 16:23:08 +00:00
Colin LeMahieu 743d1a7a69 [Hexagon] Test passes for hexagon target now that the backend correctly generates relocations.
llvm-svn: 238754
2015-06-01 15:47:46 +00:00
Daniel Jasper 1699eca119 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.

llvm-svn: 238736
2015-06-01 09:56:32 +00:00
David Majnemer f04e3862ca [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.

llvm-svn: 238731
2015-06-01 07:41:37 +00:00
Benjamin Kramer c7551a4843 [Format] Move UnwrappedLines instead of copying.
No functional change intended.

llvm-svn: 238673
2015-05-31 11:18:05 +00:00
Daniel Jasper be520bd1a6 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.

llvm-svn: 238672
2015-05-31 08:51:54 +00:00
Daniel Jasper cd8d4ff985 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
  };

llvm-svn: 238671
2015-05-31 08:40:37 +00:00