Commit Graph

58545 Commits

Author SHA1 Message Date
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