]> granicus.if.org Git - clang/log
clang
7 years agoRevert "set the underlying value of “#pragma STDC FP_CONTRACT” on by default"
Renato Golin [Fri, 23 Sep 2016 20:32:52 +0000 (20:32 +0000)]
Revert "set the underlying value of “#pragma STDC FP_CONTRACT” on by default"

This reverts commit r282259, as it broke the AArch64 test-suite bots.

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

7 years agoset the underlying value of “#pragma STDC FP_CONTRACT” on by default
Sebastian Pop [Fri, 23 Sep 2016 16:16:25 +0000 (16:16 +0000)]
set the underlying value of “#pragma STDC FP_CONTRACT” on by default

Clang has the default FP contraction setting of “-ffp-contract=on”, which
doesn't really mean “on” in the conventional sense of the word, but rather
really means “according to the per-statement effective value of the relevant
pragma”.

Before this patch, Clang has that pragma defaulting to “off”. Since the
“-ffp-contract=on” mode is really an AND of two booleans and the second of them
defaults to “off”, the whole thing effectively defaults to “off”. This patch
changes the default value of the pragma to “on”, thus making the default pair of
booleans (on, on) rather than (on, off). This makes FP optimization slightly
more aggressive than before when not using either “-Ofast”, “-ffast-math”, or
“-ffp-contract=fast”. Even with this patch the compiler still respects
“-ffp-contract=off”.

As per a suggestion by Steve Canon, the added code does _not_ require “-O3” or
higher. This is so as to try our best to preserve identical floating-point
results for unchanged source code compiling for an unchanged target when only
changing from any optimization level in the set (“-O0”, “-O1”, “-O2”, “-O3”) to
any other optimization level in that set. “-Os” and “-Oz” seem to be behaving
identically, i.e. should probably be considered a part of the aforementioned
set, but I have not reviewed this rigorously. “-Ofast” is explicitly _not_ a
member of that set.

Patch authored by Abe Skolnik [a.skolnik@samsung.com] and Stephen Canon [scanon@apple.com].

Differential Revision: https://reviews.llvm.org/D24481

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

7 years agoRevert of r282255 because of "Fell off the end of a string-switch" buildbot
Sjoerd Meijer [Fri, 23 Sep 2016 15:37:17 +0000 (15:37 +0000)]
Revert of r282255 because of "Fell off the end of a string-switch" buildbot
failures.

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

7 years agoFix for r280064 that added options for fp denormals and exceptions.
Sjoerd Meijer [Fri, 23 Sep 2016 15:21:33 +0000 (15:21 +0000)]
Fix for r280064 that added options for fp denormals and exceptions.
These options were forgotten to be copied in setCommandLineOpts.

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

7 years ago[clang-format] support header deletion in cleanupAroundReplacemnts.
Eric Liu [Fri, 23 Sep 2016 15:10:56 +0000 (15:10 +0000)]
[clang-format] support header deletion in cleanupAroundReplacemnts.

Summary:
- If a replacement has offset UINT_MAX, length 0, and a replacement text
  that is an #include directive, this will insert the #include into the
  correct block in the \p Code.
- If a replacement has offset UINT_MAX, length 1, and a replacement text
  that is the name of the header to be removed, the header will be removed
  from \p Code if it exists.

Reviewers: djasper

Subscribers: cfe-commits, klimek

Differential Revision: https://reviews.llvm.org/D24829

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

7 years ago[OpenCL] Augment pipe built-ins with pipe packet size and alignment.
Alexey Bader [Fri, 23 Sep 2016 14:20:00 +0000 (14:20 +0000)]
[OpenCL] Augment pipe built-ins with pipe packet size and alignment.

Reviewers: Anastasia, vpykhtin

Subscribers: dmitry, cfe-commits

Differential Revision: https://reviews.llvm.org/D23992

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

7 years ago[asan] Fix incorrect SEH symbol mangling on win64.
Etienne Bergeron [Fri, 23 Sep 2016 14:07:47 +0000 (14:07 +0000)]
[asan] Fix incorrect SEH symbol mangling on win64.

Summary:
The ASAN unittests are failing (check-asan-dynamic) due to an incorrect symbol name:
```
LINK : error LNK2001: unresolved external symbol ___asan_seh_interceptor
```

On win64, the linker is not adding an extra underscore. This was correctly fixed in the same file for other uses.

After that patch, most of the unittests are passing, but some related to SEH needs to be fixed.
```
Failing Tests (4):
    AddressSanitizer-x86_64-windows-dynamic :: TestCases/Windows/dll_intercept_memchr.cc
    AddressSanitizer-x86_64-windows-dynamic :: TestCases/Windows/dll_intercept_memcpy_indirect.cc
    AddressSanitizer-x86_64-windows-dynamic :: TestCases/Windows/dll_seh.cc
    AddressSanitizer-x86_64-windows-dynamic :: TestCases/Windows/seh.cc

  Expected Passes    : 339
  Passes With Retry  : 3
  Expected Failures  : 16
  Unsupported Tests  : 152
  Unexpected Failures: 4
```

Reviewers: rnk, kcc, majnemer

Subscribers: majnemer, chrisha, cfe-commits

Differential Revision: https://reviews.llvm.org/D24841

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

7 years agoMinor tweak. Avoid hardcoding.
Daniel Marjamaki [Fri, 23 Sep 2016 12:23:44 +0000 (12:23 +0000)]
Minor tweak. Avoid hardcoding.

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

7 years agoFix indentation
Daniel Marjamaki [Fri, 23 Sep 2016 08:27:24 +0000 (08:27 +0000)]
Fix indentation

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

7 years ago[AVX-512] Add initial support for checking rounding mode arguments of builtins.
Craig Topper [Fri, 23 Sep 2016 04:48:31 +0000 (04:48 +0000)]
[AVX-512] Add initial support for checking rounding mode arguments of builtins.

The backend can't encode all possible values of the argument and will fail isel. Checking in the frontend presents a friendlier experience to the user.

I started with builtins that can only take _MM_CUR_DIRECTION or _MM_NO_EXC. More builtins coming in the future.

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

7 years ago[X86] Split up the single switch statement in Sema::CheckX86BuiltinFunctionCall into...
Craig Topper [Fri, 23 Sep 2016 04:48:27 +0000 (04:48 +0000)]
[X86] Split up the single switch statement in Sema::CheckX86BuiltinFunctionCall into different switches or ifs for each type of check.

This in preparation for a new check that will check some of the builtins that already had the immediate range check.

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

7 years ago[OpenBSD] Add type sign information for OpenBSD
Renato Golin [Thu, 22 Sep 2016 19:28:20 +0000 (19:28 +0000)]
[OpenBSD] Add type sign information for OpenBSD

Like NetBSD, OpenBSD prefers having a consistent set of typedefs
across the architectures it supports over strictly following the ARM
ABIs.  The diff below makes sure that clang's view of those types
matches OpenBSD's system header files.  It also adds a test that
checks the relevant types on all OpenBSD platforms that clang works
on.  Hopefully we can add mips64 and powerpc to that list in the
future.

Patch by Mark Kettenis <mark.kettenis@xs4all.nl>

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

7 years ago[docs] Touch up the coverage docs some more
Vedant Kumar [Thu, 22 Sep 2016 15:34:33 +0000 (15:34 +0000)]
[docs] Touch up the coverage docs some more

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

7 years agoFix Wbitfield-constant-conversion false positives
Daniel Marjamaki [Thu, 22 Sep 2016 14:13:46 +0000 (14:13 +0000)]
Fix Wbitfield-constant-conversion false positives

Summary:
The diagnostic did not handle ~ well. An expression such as ~0 is often used when 'all ones' is needed.

Differential Revision: https://reviews.llvm.org/D24232

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

7 years agoThird attempt to fix Sphinx bot
Teresa Johnson [Thu, 22 Sep 2016 13:58:33 +0000 (13:58 +0000)]
Third attempt to fix Sphinx bot

Bot now complaining about -flto=thin reference, used similar workaround
for that failure.

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

7 years agoSecond attempt to fix Sphinx bot
Teresa Johnson [Thu, 22 Sep 2016 13:41:10 +0000 (13:41 +0000)]
Second attempt to fix Sphinx bot

The fix in r282148 was not enough to fix the following error:
/home/llvmbb/llvm-build-dir/clang-sphinx-docs/llvm/src/tools/clang/docs/CommandGuide/clang.rst:338:
WARNING: unknown option: -flto=full

on the sphinx bot:
  http://lab.llvm.org:8011/builders/clang-sphinx-docs/builds/16313

(not reproducible locally).

This time, simply remove the option reference.

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

7 years agoFixing sphinx build due to diagnostic:
Aaron Ballman [Thu, 22 Sep 2016 12:15:18 +0000 (12:15 +0000)]
Fixing sphinx build due to diagnostic:

/opt/llvm/build.attributes.src/tools/clang/docs/CommandGuide/clang.rst:338: WARNING: unknown option: -flto=full

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

7 years agoclang-format: [JS] reserved words in method names.
Martin Probst [Thu, 22 Sep 2016 07:18:00 +0000 (07:18 +0000)]
clang-format: [JS] reserved words in method names.

Summary:
Before:
    class X {
      delete () {
        ...
      }
    }

After:
    class X {
      delete() {
        ...
      }
    }

Reviewers: djasper

Subscribers: cfe-commits, klimek

Differential Revision: https://reviews.llvm.org/D24804

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

7 years ago[X86] Fix some illegal rounding modes in some builtin test cases to ones that would...
Craig Topper [Thu, 22 Sep 2016 06:13:33 +0000 (06:13 +0000)]
[X86] Fix some illegal rounding modes in some builtin test cases to ones that would properly compile to valid assembly.

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

7 years agoclang-format: Add an option to git-clang-format to diff between to commits
Stephen Hines [Thu, 22 Sep 2016 05:52:55 +0000 (05:52 +0000)]
clang-format: Add an option to git-clang-format to diff between to commits

Summary:
When building pre-upload hooks using git-clang-format, it is useful to limit the scope to a diff of two commits (instead of from a commit against the working tree) to allow for less false positives in dependent commits.

This change adds the option of specifying two git commits to git-clang-format when using the `--diff` flag, which uses a different strategy to diff (using `git-diff-tree` instead of `git-diff-index`), and runs clang-format against the second commit instead of the working directory.

There is a slight backwards-incompatibility introduced with this change: if a filename matches a branch name or other commit-ish, then `git clang-format <commit> <file>` will no longer work as expected; use `git clang-format <commit> -- <file>` instead.

Patch by Luis Hector Chavez!

Reviewers: djasper, lodato

Subscribers: lodato, cfe-commits, srhines

Projects: #clang-c

Differential Revision: https://reviews.llvm.org/D24319

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

7 years ago[CMake] More robust handling for bootstrap variables
Chris Bieneman [Thu, 22 Sep 2016 00:18:12 +0000 (00:18 +0000)]
[CMake] More robust handling for bootstrap variables

Checking defined isn't good enough we also need to handle defined to empty string.

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

7 years ago[Sema] Fix PR30481: crash on checking printf args.
George Burgess IV [Thu, 22 Sep 2016 00:00:26 +0000 (00:00 +0000)]
[Sema] Fix PR30481: crash on checking printf args.

We were falling through from one case to another in a switch statement.
Oops.

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

7 years ago[CMake] Check if passthrough variables are defined
Chris Bieneman [Wed, 21 Sep 2016 23:24:15 +0000 (23:24 +0000)]
[CMake] Check if passthrough variables are defined

Checking if they evaluate to true cases prevents passing values that evaluate to false cases. Instead we should check if the variables are defined.

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

7 years ago[CMake] Pass CLANG_VERSION_* variables into later stages
Chris Bieneman [Wed, 21 Sep 2016 20:43:43 +0000 (20:43 +0000)]
[CMake] Pass CLANG_VERSION_* variables into later stages

When supporting overriding clang versions we also need to pass those through to the next stage so they remain overridden.

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

7 years agoAdd -Wignored-pragma-intrinsic flag
Albert Gutowski [Wed, 21 Sep 2016 20:19:21 +0000 (20:19 +0000)]
Add -Wignored-pragma-intrinsic flag

Summary: People might want to receive warnings about pragmas but not about intrinsics that are implemented in intrin.h.

Reviewers: thakis, hans

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D24775

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

7 years ago[docs] Add ThinLTO user documentation
Teresa Johnson [Wed, 21 Sep 2016 16:57:03 +0000 (16:57 +0000)]
[docs] Add ThinLTO user documentation

Summary: Add some user facing documentation on ThinLTO and how to use it.

Reviewers: mehdi_amini

Subscribers: mehdi_amini, cfe-commits

Differential Revision: https://reviews.llvm.org/D24806

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

7 years ago[AVX512] Fix return types on __builtin_ia32_gather3XivXdi builtins
Cameron McInally [Wed, 21 Sep 2016 16:07:40 +0000 (16:07 +0000)]
[AVX512] Fix return types on __builtin_ia32_gather3XivXdi builtins

The return types on the AVX512 __builtin_ia32_gather3XivXdi builtins are incorrect. The return type should match the type of the pass through vector.

Differential Revision: https://reviews.llvm.org/D24785

-This line, and those below, will be ignored--

M    include/clang/Basic/BuiltinsX86.def

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

7 years agoPR30401: Fix substitutions for functions with abi_tag
Dmitry Polukhin [Wed, 21 Sep 2016 08:27:03 +0000 (08:27 +0000)]
PR30401: Fix substitutions for functions with abi_tag

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

7 years agoclang-format: [JS] do not wrapp @returns tags.
Martin Probst [Wed, 21 Sep 2016 06:56:38 +0000 (06:56 +0000)]
clang-format: [JS] do not wrapp @returns tags.

Summary: @returns is incorrect code, the standard is @return. However wrapping it can still confuse users.

Reviewers: djasper

Subscribers: klimek, cfe-commits

Differential Revision: https://reviews.llvm.org/D24767

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

7 years ago[analyzer] Add a checker that detects blocks in critical sections
Anna Zaks [Tue, 20 Sep 2016 20:28:50 +0000 (20:28 +0000)]
[analyzer] Add a checker that detects blocks in critical sections

This checker should find the calls to blocking functions (for example: sleep, getc, fgets,read,recv etc.) inside a critical section. When sleep(x) is called while a mutex is held, other threads cannot lock the same mutex. This might take some time, leading to bad performance or even deadlock.

Example:

mutex_t m;

void f() {
  sleep(1000); // Error: sleep() while m is locked! [f() is called from foobar() while m is locked]
  // do some work
}

void foobar() {
  lock(m);
  f();
  unlock(m);
}

A patch by zdtorok (Zoltán Dániel Török)!

Differential Revision: https://reviews.llvm.org/D21506

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

7 years agoRemove some boilerplate comments that don't explain anything.
Eric Christopher [Tue, 20 Sep 2016 19:45:06 +0000 (19:45 +0000)]
Remove some boilerplate comments that don't explain anything.

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

7 years agoFix a regex error breaking tests.
Zachary Turner [Tue, 20 Sep 2016 19:10:56 +0000 (19:10 +0000)]
Fix a regex error breaking tests.

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

7 years ago[CMake] Support overriding CLANG_VERSION_*
Chris Bieneman [Tue, 20 Sep 2016 19:09:21 +0000 (19:09 +0000)]
[CMake] Support overriding CLANG_VERSION_*

As with how we handle LLVM_VERSION_* variables we should support
overriding clang version variables.

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

7 years agoAdd some entropy to the folder name in Driver/warning-options.cpp.
Zachary Turner [Tue, 20 Sep 2016 18:41:19 +0000 (18:41 +0000)]
Add some entropy to the folder name in Driver/warning-options.cpp.

It was trying to check that things behave correctly when a
non-existant folder was specified for -isysroot.  Incidentally,
I have a folder named FOO in the root of my drive, so this test
was failing.  Make this impossible by using %T to refer to a
definitely non-existant folder.:

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

7 years agoCodeGen: further merge cstring literal construction
Saleem Abdulrasool [Tue, 20 Sep 2016 18:38:54 +0000 (18:38 +0000)]
CodeGen: further merge cstring literal construction

Use the new CreateCStringLiteral in an additional site.  Now all the C string
literals are created in one function.  Furthermore, mark the additional literal
as an `unnamed_addr constant`.

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

7 years agoFix typo in documentation.
Nick Lewycky [Tue, 20 Sep 2016 18:37:25 +0000 (18:37 +0000)]
Fix typo in documentation.

Since this is a header it will break links to this section.

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

7 years ago[cleanup] Remove excessive padding from TextTokenRetokenizer::Position
Alexander Shaposhnikov [Tue, 20 Sep 2016 18:32:48 +0000 (18:32 +0000)]
[cleanup] Remove excessive padding from TextTokenRetokenizer::Position

Reorder the fields of the struct TextTokenRetokenizer::Position to remove excessive padding.
Test plan: make -j8 check-clang

Differential revision: https://reviews.llvm.org/D24751

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

7 years ago[docs] Extend the code coverage docs some more
Vedant Kumar [Tue, 20 Sep 2016 17:11:18 +0000 (17:11 +0000)]
[docs] Extend the code coverage docs some more

Flesh out the section on interpreting coverage reports, mention the
coverage export feature, and add notes on how to build llvm with
coverage turned on.

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

7 years agoReplace 'isProvablyNonNull' with existing utility llvm::IsKnownNonNull which handles...
Nick Lewycky [Tue, 20 Sep 2016 15:49:58 +0000 (15:49 +0000)]
Replace 'isProvablyNonNull' with existing utility llvm::IsKnownNonNull which handles more cases. Noticed by inspection.

Because of how the IR generation works, this isn't expected to cause an observable difference.

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

7 years ago[mips] MSA intrinsics header file
Simon Dardis [Tue, 20 Sep 2016 15:07:36 +0000 (15:07 +0000)]
[mips] MSA intrinsics header file

This patch adds the msa.h header file containing the shorter names for the
MSA instrinsics, e.g. msa_sll_b for builtin_msa_sll_b.

Reviewers: vkalintiris, zoran.jovanovic

Differential Review: https://reviews.llvm.org/D24674

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

7 years ago[analyzer] Calculate extent size for memory regions allocated by new expression.
Gabor Horvath [Mon, 19 Sep 2016 20:39:52 +0000 (20:39 +0000)]
[analyzer] Calculate extent size for memory regions allocated by new expression.

ArrayBoundChecker did not detect out of bounds memory access errors in case an
array was allocated by the new expression. This patch resolves this issue.

Patch by Daniel Krupp!

Differential Revision: https://reviews.llvm.org/D24307

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

7 years agoReorder initializers in CallStackFrame so that we don't get a warning.
Samuel Antao [Mon, 19 Sep 2016 18:13:13 +0000 (18:13 +0000)]
Reorder initializers in CallStackFrame so that we don't get a warning.

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

7 years ago[OpenCL] Allow half type kernel argument when cl_khr_fp16 is enabled
Yaxun Liu [Mon, 19 Sep 2016 17:11:22 +0000 (17:11 +0000)]
[OpenCL] Allow half type kernel argument when cl_khr_fp16 is enabled

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

7 years agoRemove InstructionCombining and its related pass from sample pgo passes as we can...
Dehao Chen [Mon, 19 Sep 2016 16:02:52 +0000 (16:02 +0000)]
Remove InstructionCombining and its related pass from sample pgo passes as we can handle "invoke" correctly.

Summary: We previously relies on InstructionCombining pass to remove invoke instructions. Now that we can inline invoke instructions correctly, we do not need these passes any more.

Reviewers: dnovillo

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D24730

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

7 years agoRemove excessive padding from the struct CallStackFrame
Alexander Shaposhnikov [Mon, 19 Sep 2016 15:57:29 +0000 (15:57 +0000)]
Remove excessive padding from the struct CallStackFrame

The struct CallStackFrame is in lib/AST/ExprConstant.cpp
inside anonymous namespace.
This diff reorders the fields and removes excessive padding.
Test plan: make -j8 check-clang

Differential revision: https://reviews.llvm.org/D23901

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

7 years ago[OpenCL] Diagnose assignment to dereference of half type pointer
Yaxun Liu [Mon, 19 Sep 2016 14:54:41 +0000 (14:54 +0000)]
[OpenCL] Diagnose assignment to dereference of half type pointer

Differential Revision: https://reviews.llvm.org/D24626

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

7 years agoReverting r281714 due to causing an assert when calling builtins that expect a double...
Neil Hickey [Mon, 19 Sep 2016 11:42:14 +0000 (11:42 +0000)]
Reverting r281714 due to causing an assert when calling builtins that expect a double, from CL

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

7 years agoRecommit r281457 "Supports adding insertion around non-insertion replacements".
Eric Liu [Mon, 19 Sep 2016 08:40:42 +0000 (08:40 +0000)]
Recommit r281457 "Supports adding insertion around non-insertion replacements".

Summary:
Diff to r281457:
- added a test case `CalculateRangesOfInsertionAroundReplacement`.

Reviewers: djasper

Subscribers: cfe-commits, klimek

Differential Revision: https://reviews.llvm.org/D24606

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

7 years agoclang-format: [JS] Fix line breaks before comments when sorting imports.
Martin Probst [Mon, 19 Sep 2016 07:02:34 +0000 (07:02 +0000)]
clang-format: [JS] Fix line breaks before comments when sorting imports.

Summary:
Previously, clang-format would always insert an additional line break after the
import block if the main body started with a comment, due to loosing track of
the first non-import line.

Reviewers: djasper

Subscribers: cfe-commits, klimek

Differential Revision: https://reviews.llvm.org/D24708

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

7 years ago[docs] Touch up the code coverage doc
Vedant Kumar [Mon, 19 Sep 2016 01:42:38 +0000 (01:42 +0000)]
[docs] Touch up the code coverage doc

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

7 years ago[analyzer] SATestBuild.py: Treat '#' as comment in projectMap.csv
Devin Coughlin [Mon, 19 Sep 2016 01:36:40 +0000 (01:36 +0000)]
[analyzer] SATestBuild.py: Treat '#' as comment in projectMap.csv

Treat lines in projectMap.csv that start with '#' as comments. This enables a
workflow where projects can be temporarily disabled with a comment describing
when they should be turned back on.

Differential Revision: https://reviews.llvm.org/D24709

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

7 years ago[XRay] ARM 32-bit no-Thumb support in Clang
Dean Michael Berris [Mon, 19 Sep 2016 00:59:19 +0000 (00:59 +0000)]
[XRay] ARM 32-bit no-Thumb support in Clang

Just a test for now, adapted from x86_64 tests of XRay.
This is one of 3 commits to different repositories of XRay ARM port. The other 2 are:

https://reviews.llvm.org/D23931 (LLVM)
https://reviews.llvm.org/D23933 (compiler-rt)

Differential Revision: https://reviews.llvm.org/D23932

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

7 years agoclang-format: [JS] Do not wrap taze annotation comments.
Martin Probst [Sun, 18 Sep 2016 17:33:51 +0000 (17:33 +0000)]
clang-format: [JS] Do not wrap taze annotation comments.

Summary:
`// taze: ... from ...` comments are used help tools where a
specific global symbol comes from.

Before:
    // taze: many, different, symbols from
    // 'some_long_location_here'

After:
    // taze: many, different, symbols from 'some_long_location_here'

Reviewers: djasper

Subscribers: klimek, cfe-commits

Differential Revision: https://reviews.llvm.org/D24477

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

7 years agoclang-format: [JS] ASI insertion after boolean literals.
Martin Probst [Sun, 18 Sep 2016 17:21:52 +0000 (17:21 +0000)]
clang-format: [JS] ASI insertion after boolean literals.

Summary:
Before when a semicolon was missing after a boolean literal:
    a = true
    return 1;

clang-format would parse this as one line and format as:
    a = true return 1;

It turns out that C++ does not consider `true` and `false` to be literals, we
have to check for that explicitly.

Reviewers: djasper

Subscribers: klimek, cfe-commits

Differential Revision: https://reviews.llvm.org/D24574

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

7 years agoCodeGen: mark ObjC cstring literals as unnamed_addr
Saleem Abdulrasool [Sun, 18 Sep 2016 16:12:14 +0000 (16:12 +0000)]
CodeGen: mark ObjC cstring literals as unnamed_addr

These are all emitted into a section with a cstring_literal attribute.  The
attribute permits the linker to coalesce the string contents.  The address of
the strings are not important.

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

7 years agoCodeGen: mark ObjC cstring literals as constant
Saleem Abdulrasool [Sun, 18 Sep 2016 16:12:04 +0000 (16:12 +0000)]
CodeGen: mark ObjC cstring literals as constant

These strings are constants, mark them as such.  This doesn't matter too much in
practice on MachO since the constants are placed into a special section and not
referred to directly.

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

7 years ago[libFuzzer] use 'if guard' instead of 'if guard >= 0' with trace-pc; change the guard...
Kostya Serebryany [Sun, 18 Sep 2016 04:52:23 +0000 (04:52 +0000)]
[libFuzzer] use 'if guard' instead of 'if guard >= 0' with trace-pc; change the guard type to intptr_t; use separate array for 8-bit counters

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

7 years agoWhen replacements have the same offset, make replacements with smaller length order...
Eric Liu [Sat, 17 Sep 2016 12:26:42 +0000 (12:26 +0000)]
When replacements have the same offset, make replacements with smaller length order first in the set.

Summary:
No behavioral change intended. The change makes iterating the replacements set more intuitive in Replacements class implementation. Previously, insertion is ordered before an deletion/replacement with the same offset, which is counter-intuitive for implementation, especially for a followup patch to support adding insertions around replacements.

With the current ordering, we only need to make `applyAllReplacements` iterate the replacements set reversely when applying them so that deletion/replacement is still applied before insertion with the same offset.

Reviewers: klimek, djasper

Subscribers: klimek, cfe-commits

Differential Revision: https://reviews.llvm.org/D24663

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

7 years agoclang-format: [JS] Fix a crash in handledTemplateStrings.
Daniel Jasper [Sat, 17 Sep 2016 07:20:36 +0000 (07:20 +0000)]
clang-format: [JS] Fix a crash in handledTemplateStrings.

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

7 years ago[sanitizer-coverage] change trace-pc to use 8-byte guards
Kostya Serebryany [Sat, 17 Sep 2016 05:03:05 +0000 (05:03 +0000)]
[sanitizer-coverage] change trace-pc to use 8-byte guards

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

7 years agoCodeGen: refactor the ObjC cstring literal creation
Saleem Abdulrasool [Fri, 16 Sep 2016 23:41:13 +0000 (23:41 +0000)]
CodeGen: refactor the ObjC cstring literal creation

This refactors the cstring literal creation as mentioned in the couple of FIXMEs
littered in the various invocations to CreateMetadataVar.  This centralises the
definition of the literals, and will enable changing the literal creation to a
single site.  NFC.

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

7 years agoFix a couple of wrong-code bugs in switch-on-constant optimization:
Richard Smith [Fri, 16 Sep 2016 23:30:39 +0000 (23:30 +0000)]
Fix a couple of wrong-code bugs in switch-on-constant optimization:

 * recurse through intermediate LabelStmts and AttributedStmts when checking
   whether a statement inside a switch declares a variable
 * if the end of a compound statement is reachable from the chosen case label,
   and the compound statement contains a variable declaration, it's not valid
   to just emit the contents of the compound statement -- we must emit the
   statement itself or we lose the scope (and thus end lifetimes at the wrong
   point)

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

7 years agoAdd REQUIRES line.
Peter Collingbourne [Fri, 16 Sep 2016 22:56:12 +0000 (22:56 +0000)]
Add REQUIRES line.

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

7 years agoAdd target triples to fix test on non-x86.
Peter Collingbourne [Fri, 16 Sep 2016 22:26:45 +0000 (22:26 +0000)]
Add target triples to fix test on non-x86.

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

7 years agoCodeGen: Add more checks to nobuiltin.c test, add a negative test.
Peter Collingbourne [Fri, 16 Sep 2016 22:05:53 +0000 (22:05 +0000)]
CodeGen: Add more checks to nobuiltin.c test, add a negative test.

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

7 years agoIntroduce inline assembly parsing test is PR30372.
Nirav Dave [Fri, 16 Sep 2016 17:42:02 +0000 (17:42 +0000)]
Introduce inline assembly parsing test is PR30372.

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

7 years agoCodeGen: use pointer rather than reference in range loop
Saleem Abdulrasool [Fri, 16 Sep 2016 14:24:26 +0000 (14:24 +0000)]
CodeGen: use pointer rather than reference in range loop

Address post-commit comments from Justin Bogner.  Explicitly indicate
that the dereferenced iterator provides a pointer rather than a
reference.  NFC.

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

7 years agoImprove handling of floating point literals in OpenCL to only use double precision...
Neil Hickey [Fri, 16 Sep 2016 10:15:06 +0000 (10:15 +0000)]
Improve handling of floating point literals in OpenCL to only use double precision if the target supports fp64

https://reviews.llvm.org/D24235

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

7 years agoTouch up [[clang::require_constant_initialization]] docs
Eric Fiselier [Fri, 16 Sep 2016 10:04:38 +0000 (10:04 +0000)]
Touch up [[clang::require_constant_initialization]] docs

* Fix an egregious comma usage.
* Remove the `static` keyword in the example since the variables should have
  external linkage.
* Use C++11 attributes in the example.

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

7 years agoTesting commit rights. Removing trailing white space from test file.
Neil Hickey [Fri, 16 Sep 2016 09:38:11 +0000 (09:38 +0000)]
Testing commit rights. Removing trailing white space from test file.

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

7 years agoFix unused result from sign extending an Offset.
Stephen Hines [Fri, 16 Sep 2016 07:21:24 +0000 (07:21 +0000)]
Fix unused result from sign extending an Offset.

Summary:
Offset was doubled in size, but the assignment was missing. We just need
to reassign to the original variable in this case to fix it.

Reviewers: cfe-commits, echristo

Subscribers: meikeb

Differential Revision: https://reviews.llvm.org/D24648

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

7 years agoAlter the iOS/tvOS ARM64 C++ ABI to ignore the upper half of the
John McCall [Fri, 16 Sep 2016 02:40:45 +0000 (02:40 +0000)]
Alter the iOS/tvOS ARM64 C++ ABI to ignore the upper half of the
virtual table offset in a member function pointer.

We are reserving this space for future ABI use relating to alternative
v-table configurations.  In the meantime, continue to zero-initialize
this space when actually emitting a member pointer literal.

This will successfully interoperate with existing compilers.
Future versions of the compiler may place additional data in
this location, and at that point, code emitted by compilers
prior to this patch will fail if exposed to such a member pointer.
This is therefore a somewhat hard ABI break.  However, because
it is limited to an uncommon case of an uncommon language feature,
and especially because interoperation with the standard library
does not depend on member pointers, we believe that with a
sufficiently advance compiler change the impact of this break
will be minimal in practice.

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

7 years agoDo not warn about format strings that are indexed string literals.
Stephen Hines [Fri, 16 Sep 2016 01:07:04 +0000 (01:07 +0000)]
Do not warn about format strings that are indexed string literals.

Summary:
The warning for a format string not being a string literal and therefore
being potentially insecure is overly strict for indices into string
literals. This fix checks if the index into the string literal is
precomputable. If that's the case it will check if the suffix of that
string literal is a valid format string string literal. It will still
issue the aforementioned warning for out of range indices into the
string literal.

Patch by Meike Baumgärtner (meikeb)

Reviewers: rsmith

Subscribers: srhines, cfe-commits

Differential Revision: https://reviews.llvm.org/D24584

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

7 years ago[CodeGen][ObjC] Block captures should inherit the type of the captured
Akira Hatanaka [Fri, 16 Sep 2016 00:02:06 +0000 (00:02 +0000)]
[CodeGen][ObjC] Block captures should inherit the type of the captured
field in the enclosing lambda or block.

This patch fixes a bug in code-gen where it uses the type of the
declared variable rather than the type of the capture of the enclosing
lambda or block for the block capture. For example, in the following
function, code-gen currently uses i32* for the block capture "a" because
"a" is passed to foo1 as a reference, but it should use i32 since the
enclosing lambda captures "a" by value.

void foo1(int &a) {
  auto lambda = [a]{
    auto block1 = ^{
      i = a;
    };
    block1();
  };
  lambda();
}

rdar://problem/18586386

Differential Revision: https://reviews.llvm.org/D21104

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

7 years ago[CUDA] Don't try to run sanitizers on NVPTX.
Justin Lebar [Thu, 15 Sep 2016 23:44:13 +0000 (23:44 +0000)]
[CUDA] Don't try to run sanitizers on NVPTX.

Summary:
Sanitizers aren't supported on NVPTX -- don't try to run them.

This lets you e.g. pass -fsanitize=address and get asan on your host
code.

Reviewers: kcc

Subscribers: cfe-commits, tra, jhen

Differential Revision: https://reviews.llvm.org/D24640

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

7 years ago[Sema] Allow shifting a scalar operand by a vector operand.
Akira Hatanaka [Thu, 15 Sep 2016 22:19:25 +0000 (22:19 +0000)]
[Sema] Allow shifting a scalar operand by a vector operand.

r278501 inadvertently introduced a bug in which it disallowed shifting
scalar operands by vector operands when not compiling for OpenCL. This
commit fixes it.

Patch by Vladimir Yakovlev.

Differential Revision: https://reviews.llvm.org/D24467

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

7 years agoSimplify Clang's version number configuration in CMake.
David L. Jones [Thu, 15 Sep 2016 22:12:26 +0000 (22:12 +0000)]
Simplify Clang's version number configuration in CMake.

Currently, the Clang version is computed as follows:

 1. LLVM defines major, minor, and patch versions, all statically set. Today,
    these are 4, 0, and 0, respectively.
 2. The static version numbers are combined into PACKAGE_VERSION along with a
    suffix, so the result today looks like "4.0.0svn".
 3. Clang extracts CLANG_VERSION from PACKAGE_VERSION using a regexp. The regexp
    allows the patch level to omitted, and drops any non-digit trailing values.
    Today, this result looks like "4.0.0".
 4. CLANG_VERSION is then split further into CLANG_VERSION_MAJOR and
    CLANG_VERSION_MINOR. Today, these resolve to 4 and 0, respectively.
 5. If CLANG_VERSION matches a regexp with three version components, then
    CLANG_VERSION_PATCHLEVEL is extracted and the CLANG_HAS_VERSION_PATCHLEVEL
    variable is set to 1. Today, these values are 0 and 1, respectively.
 6. The CLANG_VERSION_* variables (and CLANG_HAS_VERSION_PATCHLEVEL) are
    configured into [llvm/tools/clang/]include/clang/Basic/Version.inc
    verbatim by CMake.
 7. In [llvm/tools/clang/]include/clang/Basic/Version.h, macros are defined
    conditionally, based on CLANG_HAS_VERSION_PATCHLEVEL, to compute
    CLANG_VERSION_STRING as either a two- or three-level version number. Today,
    this value is "4.0.0", because despite the patchlevel being 0, it was
    matched by regexp and is thus "HAS"ed by the preprocessor. This string is
    then used wherever Clang's "version" is needed [*].

[*] Including, notably, by compiler-rt, for computing its installation path.

This change collapses steps 2-5 by defaulting Clang to use LLVM's (non-string)
version components for the Clang version (see [*] for why not PACKAGE_VERSION),
and collapses steps 6 and 7 by simply writing CLANG_VERSION_STRING into
Version.inc. The Clang version today always uses the patchlevel form, so the
collapsed Version.inc does not have logic for a version without a patch level.

Historically speaking, this technique began with the VER file in r82085 (which
survives in the form of the regexp in #3). The major, minor, and patchlevel
versions were introduced by r106863 (which remains in #4-6). The VER file itself
was deleted in favor of the LLVM version number in r106914. On the LLVM side,
the individual LLVM_VERSION_MAJOR, LLVM_VERSION_MINOR, and PACKAGE_VERSION
weren't introduced for nearly two more years, until r150405.

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

7 years ago[sanitizer-coverage] make trace-pc-guard and indirect-call work together
Kostya Serebryany [Thu, 15 Sep 2016 22:11:08 +0000 (22:11 +0000)]
[sanitizer-coverage] make trace-pc-guard and indirect-call work together

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

7 years agoclang-format VS plugin: upgrade the project files to VS2015
Hans Wennborg [Thu, 15 Sep 2016 19:44:49 +0000 (19:44 +0000)]
clang-format VS plugin: upgrade the project files to VS2015

The plugin itself runs on previous VS versions, but this enables
it to be built with VS2015.

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

7 years agoReapply: Silence false positive diagnostics regarding passing an object of enumeratio...
Aaron Ballman [Thu, 15 Sep 2016 18:07:51 +0000 (18:07 +0000)]
Reapply: Silence false positive diagnostics regarding passing an object of enumeration type to va_start().

The underlying type for an enumeration in C is either char, signed int, or unsigned int. In the case the underlying type is chosen to be char (such as when passing -fshort-enums or using __attribute__((packed)) on the enum declaration), the enumeration can result in undefined behavior. However, when the underlying type is signed int or unsigned int (or long long as an extension), there is no undefined behavior because the types are compatible. This patch silences diagnostics for the latter while retaining the diagnostics for the former.

This patch addresses PR29140.

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

7 years ago[analyzer] Fix HTMLRewriter style sheets to support non-webkit browsers.
Artem Dergachev [Thu, 15 Sep 2016 16:25:42 +0000 (16:25 +0000)]
[analyzer] Fix HTMLRewriter style sheets to support non-webkit browsers.

This fixes rounded corners and shadows of analyzer diagnostic pieces
in browsers such as Firefox.

Differential Revision: https://reviews.llvm.org/D23272

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

7 years agoReverting r281609; it caused some build bots to break.
Aaron Ballman [Thu, 15 Sep 2016 14:12:33 +0000 (14:12 +0000)]
Reverting r281609; it caused some build bots to break.

http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/20061/steps/test/logs/stdio

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

7 years ago[mips][ias] Enable IAS by default for N64 on Debian mips64el.
Simon Dardis [Thu, 15 Sep 2016 14:01:55 +0000 (14:01 +0000)]
[mips][ias] Enable IAS by default for N64 on Debian mips64el.

Unfortunately we can't enable it for all N64 because it is not yet possible to
distinguish N32 from N64 from the triple on other environments.

N64 has been confirmed to produce identical (within reason) objects to GAS
during stage 2 of compiler recursion on N64-abi Fedora. Unfortunately,
Fedora's triples do not distinguish N32 from N64 so I can't enable it by
default there. I'm currently repeating this testing for Debian mips64el but
it's very unlikely to produce a different result.

Patch by: Daniel Sanders

Reviewers: sdardis

Differential Review: https://reviews.llvm.org/D22679

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

7 years agoSilence false positive diagnostics regarding passing an object of enumeration type...
Aaron Ballman [Thu, 15 Sep 2016 14:01:10 +0000 (14:01 +0000)]
Silence false positive diagnostics regarding passing an object of enumeration type to va_start(). The underlying type for an enumeration in C is either char, signed int, or unsigned int. In the case the underlying type is chosen to be char (such as when passing -fshort-enums or using __attribute__((packed)) on the enum declaration), the enumeration can result in undefined behavior. However, when the underlying type is signed int or unsigned int (or long long as an extension), there is no undefined behavior because the types are compatible. This patch silences diagnostics for the latter while retaining the diagnostics for the former.

This patch addresses PR29140.

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

7 years ago[ARM] ARM-specific attributes should be accepted for big-endian
Oliver Stannard [Thu, 15 Sep 2016 08:55:41 +0000 (08:55 +0000)]
[ARM] ARM-specific attributes should be accepted for big-endian

The ARM-specific C attributes (currently just interrupt) need to check
for both the big- and little-endian versions of the triples, so that
they are accepted for both big and little endian targets.

TargetWindows and TargetMicrosoftCXXABI also only use the little-endian
triples, but this is correct as windows is not supported on big-endian
ARM targets (and this is asserted in lib/Basic/Targets.cpp).

Differential Revision: https://reviews.llvm.org/D24245

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

7 years agoUpdate clang unittests for rL281586.
Wei Mi [Thu, 15 Sep 2016 06:31:30 +0000 (06:31 +0000)]
Update clang unittests for rL281586.

The change in rL281586 is in llvm component and tests updated here are
in clang component, so I have to commit them consecutively.

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

7 years agoBuiltins.def: Explicitly undef finitef, to appease mingw. It defines finitef as alias...
NAKAMURA Takumi [Thu, 15 Sep 2016 05:11:43 +0000 (05:11 +0000)]
Builtins.def: Explicitly undef finitef, to appease mingw. It defines finitef as alias of _finitef.

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

7 years agoRevert r281457 "Supports adding insertion around non-insertion replacements."
Artem Belevich [Wed, 14 Sep 2016 23:03:06 +0000 (23:03 +0000)]
Revert r281457 "Supports adding insertion around non-insertion replacements."

Commit was breaking our internal tests.

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

7 years ago[clang-cl] Accept the joined equals version of -resource-dir=
Reid Kleckner [Wed, 14 Sep 2016 22:31:24 +0000 (22:31 +0000)]
[clang-cl] Accept the joined equals version of -resource-dir=

lib/Tooling injects this argument without regard for what driver syntax
is in use.

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

7 years ago[CUDA] Make __clang_cuda_cmath.h compatible with libc++.
Justin Lebar [Wed, 14 Sep 2016 21:50:14 +0000 (21:50 +0000)]
[CUDA] Make __clang_cuda_cmath.h compatible with libc++.

Summary:
We need to add a bunch more "using"s, which weren't necessary with
libstdc++.

Once this is in I can check in a test to the test-suite.

Reviewers: tra

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D24588

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

7 years ago[CUDA] Add test checking our ability to take a function pointer to a __global__ funct...
Justin Lebar [Wed, 14 Sep 2016 21:50:11 +0000 (21:50 +0000)]
[CUDA] Add test checking our ability to take a function pointer to a __global__ function on the host side.

Summary: This functionality is used by Thrust.

Reviewers: tra

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D24581

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

7 years agoAdd some MS aliases for existing intrinsics
Albert Gutowski [Wed, 14 Sep 2016 21:19:43 +0000 (21:19 +0000)]
Add some MS aliases for existing intrinsics

Reviewers: thakis, compnerd, majnemer, rsmith, rnk

Subscribers: alexshap, cfe-commits

Differential Revision: https://reviews.llvm.org/D24330

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

7 years agoRevert "Do not warn about format strings that are indexed string literals."
Stephen Hines [Wed, 14 Sep 2016 20:20:14 +0000 (20:20 +0000)]
Revert "Do not warn about format strings that are indexed string literals."

Summary: This reverts r281527 because I messed up the attribution.

Reviewers: srhines

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D24579

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

7 years agoDo not warn about format strings that are indexed string literals.
Stephen Hines [Wed, 14 Sep 2016 20:05:20 +0000 (20:05 +0000)]
Do not warn about format strings that are indexed string literals.

Summary:
The warning for a format string not being a sting literal and therefore
being potentially insecure is overly strict for indecies into sting
literals. This fix checks if the index into the string literal is
precomputable. If thats the case it will check if the suffix of that
sting literal is a valid format string string literal. It will still
issue the aforementioned warning for out of range indecies into the
string literal.

Reviewers: rsmith

Subscribers: srhines, cfe-commits

Differential Revision: https://reviews.llvm.org/D23820

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

7 years agoCorrect assert text in DeclGroup::getSingleDecl()
Kirill Bobyrev [Wed, 14 Sep 2016 19:59:26 +0000 (19:59 +0000)]
Correct assert text in DeclGroup::getSingleDecl()

Assert text for getSingleDecl() is inaccurate. Appears to have been copy pasted
from getDeclGroup().

Patch by Ben Taylor!

Reviewers: alexfh

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D24518

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

7 years ago[analyzer] scan-build-py: Remove relative path hack for SATestsBuild.py
Devin Coughlin [Wed, 14 Sep 2016 18:14:11 +0000 (18:14 +0000)]
[analyzer] scan-build-py: Remove relative path hack for SATestsBuild.py

Remove the relative path hack in scan-build-py that converts a fully qualified
directory name and a fully qualified file path to a relative path before running
the analyzer on a file.

This hack is not needed: the bad interaction with SATestsBuild.py it was
intended to address is actually the same underlying problem that r280768 fixed.
Further, because the hack would always relativize paths, it caused
SATestBuild.py to be unable to properly line up issues when the build system
changed directory and then built a source file in a child directory but used a
fully-qualified path for the source file.

Differential Revision: https://reviews.llvm.org/D24470

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

7 years agoConvert finite to builtin
Dehao Chen [Wed, 14 Sep 2016 17:34:14 +0000 (17:34 +0000)]
Convert finite to builtin

Summary: This patch converts finite/__finite to builtin functions so that it will be inlined by compiler.

Reviewers: hfinkel, davidxl, efriedma

Subscribers: efriedma, llvm-commits

Differential Revision: https://reviews.llvm.org/D24483

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

7 years agoCodeGen: simplify the logic a slight bit
Saleem Abdulrasool [Wed, 14 Sep 2016 15:17:46 +0000 (15:17 +0000)]
CodeGen: simplify the logic a slight bit

Move the definition of `getTriple()` into the header.  It would just call
`getTarget().getTriple()`.  Inline the definition to allow the compiler to see
the same amount of the layout as previously.  Remove the more verbose
`getTarget().getTriple()` in favour of `getTriple()`.

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

7 years agoFix documentation of MemberExpr::getMemberDecl
Stephan Bergmann [Wed, 14 Sep 2016 14:03:50 +0000 (14:03 +0000)]
Fix documentation of MemberExpr::getMemberDecl

Differential Revision: https://reviews.llvm.org/D23907

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

7 years agoSupports adding insertion around non-insertion replacements.
Eric Liu [Wed, 14 Sep 2016 13:04:51 +0000 (13:04 +0000)]
Supports adding insertion around non-insertion replacements.

Summary:
Extend `tooling::Replacements::add()` to support adding order-independent replacements.

Two replacements are considered order-independent if one of the following conditions is true:
  - They do not overlap. (This is already supported.)
  - One replacement is insertion, and the other is a replacement with
    length > 0, and the insertion is adjecent to but not contained in the
    other replacement. In this case, the replacement should always change
    the original code instead of the inserted text.

Reviewers: klimek, djasper

Subscribers: cfe-commits, klimek

Differential Revision: https://reviews.llvm.org/D24515

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