]> granicus.if.org Git - clang/log
clang
9 years agoProtection against stack-based memory corruption errors using SafeStack: Clang comman...
Peter Collingbourne [Mon, 15 Jun 2015 21:08:13 +0000 (21:08 +0000)]
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

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

9 years agoparser: improve diagnostics for MS attributes
Saleem Abdulrasool [Mon, 15 Jun 2015 20:57:04 +0000 (20:57 +0000)]
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.

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

9 years agoWildcard out some SSA value names from the ACLE intrinsic test case
Reid Kleckner [Mon, 15 Jun 2015 20:55:43 +0000 (20:55 +0000)]
Wildcard out some SSA value names from the ACLE intrinsic test case

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

9 years ago[Sparc] Make soft-float emit an error.
James Y Knight [Mon, 15 Jun 2015 20:51:24 +0000 (20:51 +0000)]
[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

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

9 years ago[modules] Better support for redefinitions of an entity from the same module.
Richard Smith [Mon, 15 Jun 2015 20:15:48 +0000 (20:15 +0000)]
[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.

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

9 years agoThis patch implements clang support for the ACLE special register intrinsics
Luke Cheeseman [Mon, 15 Jun 2015 17:51:01 +0000 (17:51 +0000)]
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

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

9 years agoclang-format: NFC. Move testing of selective formatting to a separate file.
Daniel Jasper [Mon, 15 Jun 2015 15:25:11 +0000 (15:25 +0000)]
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.

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

9 years agoFix spelling in comment.
Douglas Katzman [Mon, 15 Jun 2015 13:46:40 +0000 (13:46 +0000)]
Fix spelling in comment.

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

9 years agoRevert r239721 - Replace string GNU Triples with llvm::Triple in InitMCObjectFileInfo...
Daniel Sanders [Mon, 15 Jun 2015 10:34:38 +0000 (10:34 +0000)]
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.

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

9 years agoclang-format: [JS] Tweak behavior for multiline array initializer parameters
Daniel Jasper [Mon, 15 Jun 2015 09:23:17 +0000 (09:23 +0000)]
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);

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

9 years agoReplace string GNU Triples with llvm::Triple in InitMCObjectFileInfo. NFC.
Daniel Sanders [Mon, 15 Jun 2015 09:19:41 +0000 (09:19 +0000)]
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

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

9 years ago[analyzer] Remove ObjCContainersChecker size information when a CFMutableArrayRef...
Devin Coughlin [Mon, 15 Jun 2015 01:00:42 +0000 (01:00 +0000)]
[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

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

9 years agoAdd test for parsing the XOR operator in Intel syntax inline assembly.
Michael Kuperstein [Sun, 14 Jun 2015 13:03:27 +0000 (13:03 +0000)]
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

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

9 years agoclang-format: [JS] Fix corner case in template string parsing.
Daniel Jasper [Sun, 14 Jun 2015 07:16:57 +0000 (07:16 +0000)]
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 "

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

9 years agoAdd some basic support for CloudABI on i686.
Ed Schouten [Sat, 13 Jun 2015 21:33:49 +0000 (21:33 +0000)]
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.

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

9 years agoDon't use std::errc.
Rafael Espindola [Sat, 13 Jun 2015 17:23:13 +0000 (17:23 +0000)]
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.

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

9 years agoUpdate for llvm api change.
Rafael Espindola [Sat, 13 Jun 2015 12:50:07 +0000 (12:50 +0000)]
Update for llvm api change.

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

9 years agoAdd `-verify-ignore-unexpected` option to ignore unexpected diagnostics in VerifyDiag...
Eric Fiselier [Sat, 13 Jun 2015 07:11:40 +0000 (07:11 +0000)]
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

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

9 years agoRevert r239213: "clang-cl: Implement /GL in terms of -flto."
Hans Wennborg [Sat, 13 Jun 2015 02:53:50 +0000 (02:53 +0000)]
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.

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

9 years agodocs: grammar adjustments in clang manpage
Saleem Abdulrasool [Sat, 13 Jun 2015 01:21:58 +0000 (01:21 +0000)]
docs: grammar adjustments in clang manpage

Fix a few typos and run-on sentences in the clang POD documentation.

Patch by Brian R. Gaeke!

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

9 years ago[CodeGen] Don't evaluate immediate inlineasm arguments using isICE().
Ahmed Bougacha [Sat, 13 Jun 2015 01:16:10 +0000 (01:16 +0000)]
[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

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

9 years ago[CodeGen] Use IRBuilder to create llvm.lifetime intrinsics.
Alexey Samsonov [Fri, 12 Jun 2015 22:31:32 +0000 (22:31 +0000)]
[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

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

9 years ago[ms] Don't try to delay lookup for failures in SFINAE context (PR23823)
Hans Wennborg [Fri, 12 Jun 2015 21:23:23 +0000 (21:23 +0000)]
[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

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

9 years ago[CGCall] Fix potential invalid iterator decrement in findDominatingStoreToReturnValue.
Alexey Samsonov [Fri, 12 Jun 2015 21:05:32 +0000 (21:05 +0000)]
[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.

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

9 years agoQuote the user provided string in the warning message and update
Eric Christopher [Fri, 12 Jun 2015 20:13:50 +0000 (20:13 +0000)]
Quote the user provided string in the warning message and update
tests accordingly.

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

9 years agoDriver: only set -mlinker-version based on host if it's valid
Tim Northover [Fri, 12 Jun 2015 19:21:35 +0000 (19:21 +0000)]
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.

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

9 years ago[MS ABI] Lock-in the derived memptr rep. for base-to-derived conversions
David Majnemer [Fri, 12 Jun 2015 17:55:44 +0000 (17:55 +0000)]
[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.

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

9 years agoAllow case-insensitive values for -mcpu for AArch64 target in line with GCC.
Gabor Ballabas [Fri, 12 Jun 2015 17:33:37 +0000 (17:33 +0000)]
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.

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

9 years agoUse Clang version numbers for the Windows VERSIONINFO resource.
Greg Bedwell [Fri, 12 Jun 2015 16:33:38 +0000 (16:33 +0000)]
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.

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

9 years agoThis patch makes the NEON intrinsics vget_lane_f16, vgetq_lane_f16,
Luke Cheeseman [Fri, 12 Jun 2015 15:52:39 +0000 (15:52 +0000)]
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

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

9 years agoscan-build: Remove useless whitespace in File path
Sylvestre Ledru [Fri, 12 Jun 2015 15:50:27 +0000 (15:50 +0000)]
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

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

9 years agoAllow ToolChain to decide if Clang is not the right C compiler.
Douglas Katzman [Fri, 12 Jun 2015 15:45:21 +0000 (15:45 +0000)]
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

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

9 years agopush_back() loop -> append() for random access iterators.
Benjamin Kramer [Fri, 12 Jun 2015 15:31:50 +0000 (15:31 +0000)]
push_back() loop -> append() for random access iterators.

append will resize the vector to the optimal size. No functional change
intended.

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

9 years ago[clang-format] Use in-class initializers to simplify constructor.
Benjamin Kramer [Fri, 12 Jun 2015 14:39:08 +0000 (14:39 +0000)]
[clang-format] Use in-class initializers to simplify constructor.

Sadly C++11 doesn't let us use initializers on bitfield members (DR1341). NFC.

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

9 years ago[clang-format] Reorder and pack ParenState members to minimize padding
Benjamin Kramer [Fri, 12 Jun 2015 13:07:03 +0000 (13:07 +0000)]
[clang-format] Reorder and pack ParenState members to minimize padding

sizeof(ParenState) goes from 64 bytes to 52 bytes. NFC.

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

9 years ago[clang-format] Hoist vector allocation out of loop. NFC.
Benjamin Kramer [Fri, 12 Jun 2015 13:06:57 +0000 (13:06 +0000)]
[clang-format] Hoist vector allocation out of loop. NFC.

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

9 years agoclang-format: Always add space before lambda-{
Daniel Jasper [Fri, 12 Jun 2015 09:59:16 +0000 (09:59 +0000)]
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!

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

9 years agoclang-format: Understand C-style case in case label.
Daniel Jasper [Fri, 12 Jun 2015 07:15:33 +0000 (07:15 +0000)]
clang-format: Understand C-style case in case label.

Before:
  case (my_int) ONE:

After:
  case (my_int)ONE:

This fixed llvm.org/PR23760

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

9 years agoclang-format: [JS] Support "export enum" declarations.
Daniel Jasper [Fri, 12 Jun 2015 05:08:18 +0000 (05:08 +0000)]
clang-format: [JS] Support "export enum" declarations.

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

9 years agoclang-format: [JS] Add tests to ensure clang-format doesn't break code
Daniel Jasper [Fri, 12 Jun 2015 04:58:27 +0000 (04:58 +0000)]
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.

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

9 years agoclang-format: [JS] Fix regression caused by r239592.
Daniel Jasper [Fri, 12 Jun 2015 04:56:34 +0000 (04:56 +0000)]
clang-format: [JS] Fix regression caused by r239592.

Without it, it would do:

  interface I {
    x: string;
  } var y;

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

9 years agoclang-format: [JS] fix incorrectly collapsed lines after export
Daniel Jasper [Fri, 12 Jun 2015 04:52:02 +0000 (04:52 +0000)]
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;

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

9 years agoWrap to 80 columns. No behavior change.
Nico Weber [Fri, 12 Jun 2015 04:44:52 +0000 (04:44 +0000)]
Wrap to 80 columns. No behavior change.

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

9 years agoRevert commit r239481 as it is dependent on reverted llvm commit r239480.
Teresa Johnson [Fri, 12 Jun 2015 03:11:50 +0000 (03:11 +0000)]
Revert commit r239481 as it is dependent on reverted llvm commit r239480.

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

9 years agoAdd a warning for unsupported elements of the target attribute.
Eric Christopher [Fri, 12 Jun 2015 01:36:05 +0000 (01:36 +0000)]
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.

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

9 years agoHandle fpmath= in the target attribute.
Eric Christopher [Fri, 12 Jun 2015 01:36:00 +0000 (01:36 +0000)]
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.

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

9 years agoHandle -mno-<feature> in target attribute strings by replacing the
Eric Christopher [Fri, 12 Jun 2015 01:35:58 +0000 (01:35 +0000)]
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.

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

9 years agoAdd support for tune= to the target attribute support by ignoring it.
Eric Christopher [Fri, 12 Jun 2015 01:35:56 +0000 (01:35 +0000)]
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.

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

9 years agoAdd support for the the target attribute.
Eric Christopher [Fri, 12 Jun 2015 01:35:52 +0000 (01:35 +0000)]
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).

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

9 years ago[modules] Apply name visibility rules to names found by ADL.
Richard Smith [Fri, 12 Jun 2015 01:32:13 +0000 (01:32 +0000)]
[modules] Apply name visibility rules to names found by ADL.

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

9 years ago[IRGen] Fix the MSVC2013 build
David Majnemer [Fri, 12 Jun 2015 00:17:26 +0000 (00:17 +0000)]
[IRGen] Fix the MSVC2013 build

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

9 years ago[modules] Fix crash with multiple levels of default template argument merging.
Richard Smith [Thu, 11 Jun 2015 23:46:11 +0000 (23:46 +0000)]
[modules] Fix crash with multiple levels of default template argument merging.

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

9 years ago[cleanup] Remove some unused #ifdef's
Sean Silva [Thu, 11 Jun 2015 23:34:13 +0000 (23:34 +0000)]
[cleanup] Remove some unused #ifdef's

This is all going through the VFS layer now, so there's nothing
platform-specific here.

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

9 years agoAdd assume_safety option for pragma loop vectorize and interleave.
Tyler Nowicki [Thu, 11 Jun 2015 23:23:17 +0000 (23:23 +0000)]
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.

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

9 years ago[modules] Fix assert/crash when parsing and merging a definition of a class with...
Richard Smith [Thu, 11 Jun 2015 22:48:25 +0000 (22:48 +0000)]
[modules] Fix assert/crash when parsing and merging a definition of a class with a base-specifier inside a namespace.

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

9 years ago[ms] Do lookup in dependent base classes also when overload resolution fails (PR23810)
Hans Wennborg [Thu, 11 Jun 2015 21:21:57 +0000 (21:21 +0000)]
[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

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

9 years ago[CodeGen] Emit Constants for immediate inlineasm arguments.
Ahmed Bougacha [Thu, 11 Jun 2015 18:19:34 +0000 (18:19 +0000)]
[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

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

9 years agoclang-cl: Add an alias for /wd4910
Hans Wennborg [Thu, 11 Jun 2015 18:14:11 +0000 (18:14 +0000)]
clang-cl: Add an alias for /wd4910

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

9 years agoSpell -Wdllexport-explicit-instantiation-decl correctly.
Hans Wennborg [Thu, 11 Jun 2015 17:51:58 +0000 (17:51 +0000)]
Spell -Wdllexport-explicit-instantiation-decl correctly.

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

9 years agoAdd comments to PrintActions1 and Driver::PrintActions.
Douglas Katzman [Thu, 11 Jun 2015 15:05:22 +0000 (15:05 +0000)]
Add comments to PrintActions1 and Driver::PrintActions.

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

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

9 years agoadd the -mrecip driver flag and process its options (3rd try)
Sanjay Patel [Thu, 11 Jun 2015 14:53:41 +0000 (14:53 +0000)]
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

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

9 years agoclang-format: Make SFS_Inline imply SFS_Empty.
Daniel Jasper [Thu, 11 Jun 2015 13:31:45 +0000 (13:31 +0000)]
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.

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

9 years agoclang-format: [JS] Ensure that formatting actually takes place in tests.
Daniel Jasper [Thu, 11 Jun 2015 13:29:20 +0000 (13:29 +0000)]
clang-format: [JS] Ensure that formatting actually takes place in tests.

And fix formatting issue discovered by that :-).

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

9 years agoC++11 rangify several loops.
Yaron Keren [Thu, 11 Jun 2015 12:33:25 +0000 (12:33 +0000)]
C++11 rangify several loops.

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

9 years agoAllow case-insensitive values for -march for ARM in line with GCC.
Gabor Ballabas [Thu, 11 Jun 2015 12:29:56 +0000 (12:29 +0000)]
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.

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

9 years agoToken: complement is() method with isOneOf() to allow easier usage
Daniel Marjamaki [Thu, 11 Jun 2015 12:28:14 +0000 (12:28 +0000)]
Token: complement is() method with isOneOf() to allow easier usage

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

9 years ago[mips] Pass on -m{single,double}-float to GAS.
Toma Tabacu [Thu, 11 Jun 2015 12:13:18 +0000 (12:13 +0000)]
[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

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

9 years ago[OPENMP] Fox for http://llvm.org/PR23663: OpenMP crash
Alexey Bataev [Thu, 11 Jun 2015 10:53:56 +0000 (10:53 +0000)]
[OPENMP] Fox for http://llvm.org/PR23663: OpenMP crash

Destroy RuntimeCleanupScope before generation of termination instruction in parallel loop precondition.

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

9 years agoFix crash in clang-format.
Manuel Klimek [Thu, 11 Jun 2015 10:14:13 +0000 (10:14 +0000)]
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.

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

9 years agoclang-format: Don't add spaces in foreach macro definition.
Daniel Jasper [Thu, 11 Jun 2015 08:38:19 +0000 (08:38 +0000)]
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!

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

9 years agoReinstate r239499 and r239503
David Majnemer [Thu, 11 Jun 2015 08:12:44 +0000 (08:12 +0000)]
Reinstate r239499 and r239503

They were reverted because the FileCheck patterns didn't match on
release builds.

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

9 years agoRevert "[MS ABI] Allow fastcall member function pointers to get CodeGen'd"
Manuel Klimek [Thu, 11 Jun 2015 07:54:35 +0000 (07:54 +0000)]
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/

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

9 years agoClang support for vector quad bit permute and gather instructions through builtins
Nemanja Ivanovic [Thu, 11 Jun 2015 06:25:36 +0000 (06:25 +0000)]
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

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

9 years ago[modules] Fix a few places where merging wasn't performed if modules was disabled...
Richard Smith [Thu, 11 Jun 2015 03:05:39 +0000 (03:05 +0000)]
[modules] Fix a few places where merging wasn't performed if modules was disabled but local module visibilty was enabled.

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

9 years ago[MS Compatibility] Handle cleanups we create for a ctor closure
David Majnemer [Thu, 11 Jun 2015 02:38:06 +0000 (02:38 +0000)]
[MS Compatibility] Handle cleanups we create for a ctor closure

This fixes PR23801.

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

9 years ago[MS ABI] Allow fastcall member function pointers to get CodeGen'd
David Majnemer [Thu, 11 Jun 2015 00:45:44 +0000 (00:45 +0000)]
[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.

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

9 years ago[MS ABI] Allow memfn pointers with unconvertible types to be formed
David Majnemer [Thu, 11 Jun 2015 00:20:57 +0000 (00:20 +0000)]
[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.

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

9 years ago[bpf] add support for BPF backend
Alexei Starovoitov [Wed, 10 Jun 2015 22:59:13 +0000 (22:59 +0000)]
[bpf] add support for BPF backend

add support for bpfel/bpfeb targets

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

9 years agoWork around MSVC miscompilation.
Richard Smith [Wed, 10 Jun 2015 22:49:14 +0000 (22:49 +0000)]
Work around MSVC miscompilation.

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

9 years ago[modules] Don't allow use of non-visible (inherited) default template arguments.
Richard Smith [Wed, 10 Jun 2015 20:36:34 +0000 (20:36 +0000)]
[modules] Don't allow use of non-visible (inherited) default template arguments.

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

9 years ago[modules] Track all default template arguments for a given parameter across
Richard Smith [Wed, 10 Jun 2015 20:30:23 +0000 (20:30 +0000)]
[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.

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

9 years agoDo not parse members of incomplete class.
Serge Pavlov [Wed, 10 Jun 2015 19:06:59 +0000 (19:06 +0000)]
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

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

9 years agoPass down the -flto option to the -cc1 job, and from there into the
Teresa Johnson [Wed, 10 Jun 2015 17:49:45 +0000 (17:49 +0000)]
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.

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

9 years agosome StmtExprs do not have side-effects
Scott Douglass [Wed, 10 Jun 2015 15:18:23 +0000 (15:18 +0000)]
some StmtExprs do not have side-effects

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

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

9 years agoadd ConstEvaluatedExprVisitor
Scott Douglass [Wed, 10 Jun 2015 13:53:15 +0000 (13:53 +0000)]
add ConstEvaluatedExprVisitor

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

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

9 years agoPR5172: Fix for a bug in pragma redefine_extname implementation:
Alexander Musman [Wed, 10 Jun 2015 11:20:26 +0000 (11:20 +0000)]
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

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

9 years agoclang-format: [JS] Only special case top level object literal
Daniel Jasper [Wed, 10 Jun 2015 09:21:09 +0000 (09:21 +0000)]
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.

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

9 years agoFix the test case to handle different IR variable names.
Yunzhong Gao [Wed, 10 Jun 2015 03:19:08 +0000 (03:19 +0000)]
Fix the test case to handle different IR variable names.

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

9 years ago[modules] Reconstruct template default argument inheritance on reload rather
Richard Smith [Wed, 10 Jun 2015 01:47:58 +0000 (01:47 +0000)]
[modules] Reconstruct template default argument inheritance on reload rather
than wasting storage and triggering eager deserializations by serializing it.

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

9 years ago[cleanup] Remove unused default argument and tidy up.
Sean Silva [Wed, 10 Jun 2015 01:37:59 +0000 (01:37 +0000)]
[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.

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

9 years agoRevert accidentally-committed test change from r239447.
Richard Smith [Wed, 10 Jun 2015 01:36:14 +0000 (01:36 +0000)]
Revert accidentally-committed test change from r239447.

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

9 years agoRefactor storage of default template arguments.
Richard Smith [Wed, 10 Jun 2015 00:29:03 +0000 (00:29 +0000)]
Refactor storage of default template arguments.

This is just a preparatory step towards fixing visibility for default template
arguments in modules builds.

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

9 years agoImplementing C99 partial re-initialization behavior (DR-253)
Yunzhong Gao [Wed, 10 Jun 2015 00:27:52 +0000 (00:27 +0000)]
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

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

9 years agoAttach attribute "disable-tail-calls" to the functions in the IR.
Akira Hatanaka [Tue, 9 Jun 2015 19:04:36 +0000 (19:04 +0000)]
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

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

9 years ago[ItaniumMangle] Mangle long double as __float128 for some Power targets
David Majnemer [Tue, 9 Jun 2015 18:05:33 +0000 (18:05 +0000)]
[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.

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

9 years agoRevert "Re-land r236052, "[SEH] Add 32-bit lowering code for __try""
Reid Kleckner [Tue, 9 Jun 2015 17:49:42 +0000 (17:49 +0000)]
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.

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

9 years agoDisable style-on-command-line test on Windows
Reid Kleckner [Tue, 9 Jun 2015 17:47:59 +0000 (17:47 +0000)]
Disable style-on-command-line test on Windows

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

9 years agoRe-land r236052, "[SEH] Add 32-bit lowering code for __try"
Reid Kleckner [Tue, 9 Jun 2015 17:47:50 +0000 (17:47 +0000)]
Re-land r236052, "[SEH] Add 32-bit lowering code for __try"

This reverts r236167.

LLVM should be ready for this now.

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

9 years ago[PowerPC] Reformat altivec.h with clang-format
Bill Seurer [Tue, 9 Jun 2015 14:39:47 +0000 (14:39 +0000)]
[PowerPC] Reformat altivec.h with clang-format

This revision just fixes the formatting of altivec.h.

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

9 years agoMove target-specific Sema test to its own file.
Jonathan Roelofs [Tue, 9 Jun 2015 14:30:17 +0000 (14:30 +0000)]
Move target-specific Sema test to its own file.

Fixing the build-break introduced in r239406.

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