]> granicus.if.org Git - clang/log
clang
8 years ago[CMake] Pass DYLD_LIBRARY_PATH as CMake variable instead of as envar
Chris Bieneman [Mon, 25 Jul 2016 23:48:14 +0000 (23:48 +0000)]
[CMake] Pass DYLD_LIBRARY_PATH as CMake variable instead of as envar

On OS X 10.11 System Integrity Protection prevents the DYLD environment variables from being set on system binaries. To work around this r276710 accepts DYLD_LIBRARY_PATH as a CMake variable and sets it directly on the archiver commands.

To make this work with bootstrapping we need to set DYLD_LIBRARY_PATH to the current stage's library directory and pass that into the next stage's configuration.

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

8 years ago[Sema][ObjC] Compute the nullability of a conditional expression based
Akira Hatanaka [Mon, 25 Jul 2016 21:58:19 +0000 (21:58 +0000)]
[Sema][ObjC] Compute the nullability of a conditional expression based
on the nullabilities of its operands.

This commit is a follow-up to r276076 and enables
computeConditionalNullability to compute the merged nullability when
the operands are objective-c pointers.

rdar://problem/22074116

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

8 years ago[CMake] Cleaning up some CMake warnings
Chris Bieneman [Mon, 25 Jul 2016 18:54:30 +0000 (18:54 +0000)]
[CMake] Cleaning up some CMake warnings

In Bootstrap builds Clang logs some warnings. These are caused because Clang passes CLANG_STAGE and BOOTSTRAP_DEFAULT_PASSTHROUGH into the next stage's configuration.

BOOTSTRAP_DEFAULT_PASSTHROUGH shouldn't be passed, so it is renamed to _BOOTSTRAP_DEFAULT_PASSTHROUGH, to prevent passthrough.

CLANG_STAGE should be passed, so I've changed the code to log it if it is set outside the if(CLANG_ENABLE_BOOTSTRAP) block. This makes the variable always used, so the warning goes away.

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

8 years ago[cc1as] Add MCTargetOptions argument to createAsmBackend
Joel Jones [Mon, 25 Jul 2016 17:18:44 +0000 (17:18 +0000)]
[cc1as] Add MCTargetOptions argument to createAsmBackend

Allow an assembler backend to get ABI options. This is to match the changes
to http://reviews.llvm.org/D16213.

Tested with "make check-clang"

Patch by: Joel Jones

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

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

8 years agoSupport '#pragma once' in headers when using PCH
Sunil Srivastava [Mon, 25 Jul 2016 17:17:06 +0000 (17:17 +0000)]
Support '#pragma once' in headers when using PCH

The '#pragma once' directive was erroneously ignored when encountered
in the header-file specified in generate-PCH-mode. This resulted in
compile-time errors in some cases with legal code, and also a misleading
warning being produced.

Patch by Warren Ristow!

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

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

8 years ago[Myriad]: better compatibility with vendor source
Douglas Katzman [Mon, 25 Jul 2016 16:36:02 +0000 (16:36 +0000)]
[Myriad]: better compatibility with vendor source

- Accept ma{2100,2150,2150} for -mcpu
- Define more preprocessor macros
- Don't append "le/" to little-endian lib dirs

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

8 years agoMPI-Checker: move MPIFunctionClassifier.h
Alexander Kornienko [Mon, 25 Jul 2016 15:27:16 +0000 (15:27 +0000)]
MPI-Checker: move  MPIFunctionClassifier.h

Summary:
This patch moves the MPIFunctionClassifier header to `clang/include/clang/StaticAnalyzer/Checkers`,
in order to make it accessible in other parts of the architecture.

Reviewers: dcoughlin, zaks.anna

Subscribers: alexfh, cfe-commits

Patch by Alexander Droste!

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

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

8 years agoUpdate description for CLANG_DEFAULT_CXX_STDLIB and add comment. NFC
Jonas Hahnfeld [Mon, 25 Jul 2016 08:04:26 +0000 (08:04 +0000)]
Update description for CLANG_DEFAULT_CXX_STDLIB and add comment. NFC

We agreed to call it "platform default" instead of "architecture default".
(see D17286)

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

8 years agoUpdate test to account for r276604
David Majnemer [Mon, 25 Jul 2016 04:47:45 +0000 (04:47 +0000)]
Update test to account for r276604

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

8 years ago[MSVCToolChain] Guard hardcoded Windows paths with LLVM_ON_WIN32
David Majnemer [Mon, 25 Jul 2016 04:47:44 +0000 (04:47 +0000)]
[MSVCToolChain] Guard hardcoded Windows paths with LLVM_ON_WIN32

Paths like C:/foo will never work on UNIX platforms, don't bother
implicitly adding them to the search path.

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

8 years ago[Sema] Replace mem_fn with lambdas. NFC.
George Burgess IV [Sun, 24 Jul 2016 23:12:40 +0000 (23:12 +0000)]
[Sema] Replace mem_fn with lambdas. NFC.

I'm told that some optimizers like lambdas a lot more than mem_fn.
Given that the readability difference is basically nil, and we seem to
use lambdas basically everywhere else, it seems sensible to just use
lambdas.

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

8 years ago[Driver] Switch some getenv calls to llvm::sys::Process::GetEnv
David Majnemer [Sun, 24 Jul 2016 17:44:03 +0000 (17:44 +0000)]
[Driver] Switch some getenv calls to llvm::sys::Process::GetEnv

No functional change is intended.

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

8 years ago[X86] Block pbroadcastq instructions on 32-bit targets instead of pbroadcastb.
Craig Topper [Sun, 24 Jul 2016 14:58:06 +0000 (14:58 +0000)]
[X86] Block pbroadcastq instructions on 32-bit targets instead of pbroadcastb.

Thanks to Simon Pilgrim for catching the mistake.

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

8 years ago[analyzer] Pring LocationContext in ExplodedGraph dumps.
Artem Dergachev [Sun, 24 Jul 2016 08:15:58 +0000 (08:15 +0000)]
[analyzer] Pring LocationContext in ExplodedGraph dumps.

Remove some FIXMEs in the surrounding code,
which have been addressed long time ago
by introducing checker-specific tags.

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

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

8 years ago[Profile] Use a flag to enable PGO rather than the profraw filename
Xinliang David Li [Sat, 23 Jul 2016 04:28:59 +0000 (04:28 +0000)]
[Profile] Use a flag to enable PGO rather than the profraw filename

Patch by Jake VanAdrighem

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

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

8 years ago[cxx1z-constexpr-lambda] Make a lambda's closure type eligible as a literal-type...
Faisal Vali [Sat, 23 Jul 2016 04:05:19 +0000 (04:05 +0000)]
[cxx1z-constexpr-lambda] Make a lambda's closure type eligible as a literal-type in C++1z

Additionally, for pre-C++1z, instead of forbidding a lambda's closure type from being a literal type through circumlocutorily setting HasNonLiteralTypeFieldsOrBases falsely to true -- handle lambda's more directly in CXXRecordDecl::isLiteral().

One additional small step towards implementing constexpr-lambdas.

Thanks to Richard Smith for his review!
https://reviews.llvm.org/D22662

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

8 years agoWork around MSVC's lack of support for unrestricted unions by making this
Richard Smith [Sat, 23 Jul 2016 02:39:52 +0000 (02:39 +0000)]
Work around MSVC's lack of support for unrestricted unions by making this
struct a bit bigger under MSVC (this shouldn't be a big deal; we typically
allocate no more than two of these at a time, on the stack).

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

8 years agoAdd -fmodules-ts flag to cc1 for the provisional C++ modules TS, and mark
Richard Smith [Sat, 23 Jul 2016 02:32:21 +0000 (02:32 +0000)]
Add -fmodules-ts flag to cc1 for the provisional C++ modules TS, and mark
'module' and 'import' as keywords when the flag is specified.

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

8 years agoAdd doxygen comments to emmintrin.h's intrinsics.
Ekaterina Romanova [Fri, 22 Jul 2016 23:49:37 +0000 (23:49 +0000)]
Add doxygen comments to emmintrin.h's intrinsics.

Only around 50% of the intrinsics in this file are documented now. The patches for the rest of the intrisics in this file will be send out later.

The doxygen comments are automatically generated based on Sony's intrinsics docu
ment.

I got an OK from Eric Christopher to commit doxygen comments without prior code
review upstream. This patch was internally reviewed by Paul Robinson.

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

8 years agoP0217R3: Parsing support and framework for AST representation of C++1z
Richard Smith [Fri, 22 Jul 2016 23:36:59 +0000 (23:36 +0000)]
P0217R3: Parsing support and framework for AST representation of C++1z
decomposition declarations.

There are a couple of things in the wording that seem strange here:
decomposition declarations are permitted at namespace scope (which we partially
support here) and they are permitted as the declaration in a template (which we
reject).

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

8 years ago[Profile] Enable profile merging with -fprofile-generat[=<dir>]
Xinliang David Li [Fri, 22 Jul 2016 22:25:01 +0000 (22:25 +0000)]
[Profile] Enable profile merging with -fprofile-generat[=<dir>]

This patch enables raw profile merging for this option which is the
new intended behavior.

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

8 years ago[modules] Teach the ASTWriter to ignore mutations coming from the ASTReader.
Vassil Vassilev [Fri, 22 Jul 2016 21:08:24 +0000 (21:08 +0000)]
[modules] Teach the ASTWriter to ignore mutations coming from the ASTReader.

Processing update records (and loading a module, in general) might trigger
unexpected calls to the ASTWriter (being a mutation listener). Now we have a
mechanism to suppress those calls to the ASTWriter but notify other possible
mutation listeners.

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

Patch by Cristina Cristescu and me.

Reviewed by Richard Smith (D21800).

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

8 years agoAdd regression test for PR27699.
Vassil Vassilev [Fri, 22 Jul 2016 20:49:31 +0000 (20:49 +0000)]
Add regression test for PR27699.

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

8 years agoAdd .rgba syntax extension to ext_vector_type types
Pirama Arumuga Nainar [Fri, 22 Jul 2016 18:49:43 +0000 (18:49 +0000)]
Add .rgba syntax extension to ext_vector_type types

Summary:
This patch enables .rgba accessors to ext_vector_type types and adds
tests for syntax validation and code generation.

'a' and 'b' can appear either in the point access mode or the numeric
access mode (for indices 10 and 11).  To disambiguate between the two
usages, the accessor type is explicitly passed to relevant methods.

Reviewers: rsmith

Subscribers: Anastasia, bader, srhines, cfe-commits

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

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

8 years agoClang changes for overloading invariant.start and end intrinsics
Anna Thomas [Fri, 22 Jul 2016 17:50:08 +0000 (17:50 +0000)]
Clang changes for overloading invariant.start and end intrinsics

This change depends on the corresponding LLVM change at:
https://reviews.llvm.org/D22519

The llvm.invariant.start and llvm.invariant.end intrinsics currently
support specifying invariant memory objects only in the default address
space.

With this LLVM change, these intrinsics are overloaded for any adddress space
for memory objects and we can use these llvm invariant intrinsics in
non-default address spaces.

Example: llvm.invariant.start.p1i8(i64 4, i8 addrspace(1)* %ptr)

This overloaded intrinsic is needed for representing final or invariant
memory in managed languages.

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

8 years agotest commit. update comment grammatically. NFC
Anna Thomas [Fri, 22 Jul 2016 15:37:56 +0000 (15:37 +0000)]
test commit. update comment grammatically. NFC

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

8 years ago[X86][AVX] Added support for lowering to VBROADCASTF128/VBROADCASTI128 with generic IR
Simon Pilgrim [Fri, 22 Jul 2016 13:58:56 +0000 (13:58 +0000)]
[X86][AVX] Added support for lowering to VBROADCASTF128/VBROADCASTI128 with generic IR

As discussed on D22460, I've updated the vbroadcastf128 pd256/ps256 builtins to map directly to generic IR - load+splat a 128-bit vector to both lanes of a 256-bit vector.

Fix for PR28657.

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

8 years ago[Coverage] Attempt to appease a Windows builder
Vedant Kumar [Fri, 22 Jul 2016 00:25:09 +0000 (00:25 +0000)]
[Coverage] Attempt to appease a Windows builder

The builder prints out the following IR:

  \5CCoverageMapping\5COutput\5Ctest\5Cf1.c

The updated test in r276367 expects path separators to be either '/' or
'\\', so it chokes on the unexpected "5C" stuff. I'm not sure what that
is, but I included a kludge that should work around it.

Failing bot:

  http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/8718

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

8 years ago[Coverage] Strengthen a test case
Vedant Kumar [Fri, 22 Jul 2016 00:00:02 +0000 (00:00 +0000)]
[Coverage] Strengthen a test case

We should be able to use `mkdir` without turning on `REQUIRES: shell`.
Moreover, this test should check for a path separator which precedes the
relative filename to make sure that absolute paths are being used.

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

8 years ago[analyzer] Add checker modeling potential C++ self-assignment
Devin Coughlin [Thu, 21 Jul 2016 23:42:31 +0000 (23:42 +0000)]
[analyzer] Add checker modeling potential C++ self-assignment

This checker checks copy and move assignment operators whether they are
protected against self-assignment. Since C++ core guidelines discourages
explicit checking for `&rhs==this` in general we take a different approach: in
top-frame analysis we branch the exploded graph for two cases, where &rhs==this
and &rhs!=this and let existing checkers (e.g. unix.Malloc) do the rest of the
work. It is important that we check all copy and move assignment operator in top
frame even if we checked them already since self-assignments may happen
undetected even in the same translation unit (e.g. using random indices for an
array what may or may not be the same).

This reapplies r275820 after fixing a string-lifetime issue discovered by the
bots.

A patch by Ádám Balogh!

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

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

8 years agoReverting r275115 which caused PR28634.
Wolfgang Pieb [Thu, 21 Jul 2016 23:28:18 +0000 (23:28 +0000)]
Reverting r275115 which caused PR28634.
When empty (forwarding) basic blocks that are referenced by user labels
are removed, incorrect code may be generated.

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

8 years ago[profile] update test case with interface change.
Xinliang David Li [Thu, 21 Jul 2016 23:19:39 +0000 (23:19 +0000)]
[profile] update test case with interface change.

See http://reviews.llvm.org/D22613, http://reviews.llvm.org/D22614

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

8 years ago[Sema] Handle errors during rewriteBuiltinFunctionDecl
David Majnemer [Thu, 21 Jul 2016 23:03:43 +0000 (23:03 +0000)]
[Sema] Handle errors during rewriteBuiltinFunctionDecl

rewriteBuiltinFunctionDecl can encounter errors when performing
DefaultFunctionArrayLvalueConversion.  These errors were not handled
which led to a null pointer dereference.

This fixes PR28651.

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

8 years ago[CodeGen] Fix a crash when constant folding switch statement
Erik Pilkington [Thu, 21 Jul 2016 22:31:40 +0000 (22:31 +0000)]
[CodeGen] Fix a crash when constant folding switch statement

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

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

8 years agoDisable a flaky test on Windows that uses "echo >>"
Reid Kleckner [Thu, 21 Jul 2016 21:07:47 +0000 (21:07 +0000)]
Disable a flaky test on Windows that uses "echo >>"

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

8 years agoReroll "Include unreferenced nested types in member list only for CodeView"
Adrian McCarthy [Thu, 21 Jul 2016 18:43:20 +0000 (18:43 +0000)]
Reroll "Include unreferenced nested types in member list only for CodeView"

Another attempt at r276271, hopefully without breaking ModuleDebugInfo test.

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

8 years agoMove some IntrusiveRefCntPtrs instead of copying.
Benjamin Kramer [Thu, 21 Jul 2016 15:06:51 +0000 (15:06 +0000)]
Move some IntrusiveRefCntPtrs instead of copying.

No functionality change intended.

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

8 years agoRevert "Include unreferenced nested types in member list only for CodeView"
Adrian McCarthy [Thu, 21 Jul 2016 13:41:25 +0000 (13:41 +0000)]
Revert "Include unreferenced nested types in member list only for CodeView"

Patch broke ModuleDebugInfo test on the build bots (but not locally).  Again.

svn revision:  r276271

This reverts commit 9da8a1b05362bc96f2855fb32b5588b89407685d.

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

8 years agoInclude unreferenced nested types in member list only for CodeView
Adrian McCarthy [Thu, 21 Jul 2016 13:16:14 +0000 (13:16 +0000)]
Include unreferenced nested types in member list only for CodeView

Unreferenced nested structs and classes were omitted from the debug info.  In DWARF, this was intentional, to avoid bloat.  But for CodeView, we want this information to be consistent with what Microsoft tools would produce and expect.

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

8 years agoProvide __GLIBCXX_TYPE_INT_N_0 and __GLIBCXX_BITSIZE_INT_N_0 when in C++ gnu language...
Yaron Keren [Thu, 21 Jul 2016 07:44:41 +0000 (07:44 +0000)]
Provide __GLIBCXX_TYPE_INT_N_0 and __GLIBCXX_BITSIZE_INT_N_0 when in C++ gnu language extensions.
These are used by libstdc++ <type_traits> for is_integral<__int128>.
Addresses http://llvm.org/pr23156.

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

8 years ago[Sema,X86] Add explicit check to ensure that builtins that require x86-64 target...
Craig Topper [Thu, 21 Jul 2016 07:38:43 +0000 (07:38 +0000)]
[Sema,X86] Add explicit check to ensure that builtins that require x86-64 target throw an error if used on 32-bit target.

If these builtins are allowed to go through on a 32-bit target they will fire assertions in the backend.

Fixes PR28635.

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

8 years ago[X86] Add missing __x86_64__ qualifiers on a bunch of intrinsics that assume 64-bit...
Craig Topper [Thu, 21 Jul 2016 07:38:39 +0000 (07:38 +0000)]
[X86] Add missing __x86_64__ qualifiers on a bunch of intrinsics that assume 64-bit GPRs are available.

Usages of these intrinsics in a 32-bit build results in assertions in the backend.

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

8 years ago[CodeGen] Handle recursion in LLVMIRGeneration Timer.
Davide Italiano [Thu, 21 Jul 2016 06:28:48 +0000 (06:28 +0000)]
[CodeGen] Handle recursion in LLVMIRGeneration Timer.

This can happen when emitting a local decl, which triggers
loading a decl imported from an AST file, which we then
hand to the AST consumer. Timer is not allowed to recurse
so an assertion fire. Keep a reference counter to avoid this
problem. LGTM'd by Richard Smith on IRC.

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

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

8 years ago[Sema] Fix PR28623.
George Burgess IV [Thu, 21 Jul 2016 03:28:13 +0000 (03:28 +0000)]
[Sema] Fix PR28623.

In atomic builtins, we assumed that the LValue conversion on the first
argument would succeed. So, we would crash given code like:

```
void ovl(char);
void ovl(int);
__atomic_store_n(ovl, 0, 0);
```

This patch makes us not assume that said conversion is successful. :)

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

8 years ago[Profile] Document new profile file name modifiers
Xinliang David Li [Wed, 20 Jul 2016 23:32:50 +0000 (23:32 +0000)]
[Profile] Document new profile file name modifiers

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

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

8 years ago[OpenMP] Sema and parsing for 'target simd' pragma
Kelvin Li [Wed, 20 Jul 2016 22:57:10 +0000 (22:57 +0000)]
[OpenMP] Sema and parsing for 'target simd' pragma

This patch is to implement sema and parsing for 'target simd' pragma.

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

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

8 years agoFix memory leak introduced in r276159.
Richard Smith [Wed, 20 Jul 2016 21:38:26 +0000 (21:38 +0000)]
Fix memory leak introduced in r276159.

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

8 years agoWhen copying an array into a lambda, destroy temporaries from
John McCall [Wed, 20 Jul 2016 21:02:43 +0000 (21:02 +0000)]
When copying an array into a lambda, destroy temporaries from
the copy-constructor immediately and enter a partial array
cleanup for previously-copied elements.

Fixes PR28595.

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

8 years ago[OpenMP] Allow negative lower bound in array sections based on pointers
Kelvin Li [Wed, 20 Jul 2016 20:45:29 +0000 (20:45 +0000)]
[OpenMP] Allow negative lower bound in array sections based on pointers

OpenMP 4.5 removed the restriction that array section lower bound must be non negative.
This change is to allow negative values for array section based on pointers.
For array section based on array type there is still a restriction: "The array section must be a subset of the original array."

Patch by David S.

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

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

8 years ago[OpenMP] Ignore parens in atomic capture
Kelvin Li [Wed, 20 Jul 2016 19:41:17 +0000 (19:41 +0000)]
[OpenMP] Ignore parens in atomic capture

Clang misdiagnoses atomic captures cases that contains parens.
i.e.

  int v, int *p;
#pragma omp atomic capture
{ v = (*p); (*p)++; }

Patch by David S.

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

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

8 years ago[OpenCL] AMDGCN target will generate images in constant address space
Yaxun Liu [Wed, 20 Jul 2016 19:21:11 +0000 (19:21 +0000)]
[OpenCL] AMDGCN target will generate images in constant address space

Allows AMDGCN target to generate images (such as %opencl.image2d_t) in constant address space.
Images will still be generated in global address space by default.

Added tests to existing opencl-types.cl in test\CodeGenOpenCL.

Patch by Aaron En Ye Shi.

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

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

8 years ago[modules] Don't emit initializers for VarDecls within a module eagerly whenever
Richard Smith [Wed, 20 Jul 2016 19:10:16 +0000 (19:10 +0000)]
[modules] Don't emit initializers for VarDecls within a module eagerly whenever
we first touch any part of that module. Instead, defer them until the first
time that module is (transitively) imported. The initializer step for a module
then recursively initializes modules that its own headers imported.

For example, this avoids running the <iostream> global initializer in programs
that don't actually use iostreams, but do use other parts of the standard
library.

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

8 years agoFix modules self-host: add missing include and forward-decl.
Richard Smith [Wed, 20 Jul 2016 18:28:19 +0000 (18:28 +0000)]
Fix modules self-host: add missing include and forward-decl.

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

8 years ago[MS] Improve VPtrInfo field names and doc comments
Reid Kleckner [Wed, 20 Jul 2016 14:40:25 +0000 (14:40 +0000)]
[MS] Improve VPtrInfo field names and doc comments

'ReusingBase' was a terrible name. It might actually refer to the most
derived class, which is not a base. 'BaseWithVPtr' was also bad, since
again, it could refer to the most derived class. It was actually the
first base to introduce the vptr, so now it is 'IntroducingObject'.

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

8 years ago[X86][SSE] Reimplement SSE fp2si conversion intrinsics instead of using generic IR
Simon Pilgrim [Wed, 20 Jul 2016 10:18:01 +0000 (10:18 +0000)]
[X86][SSE] Reimplement SSE fp2si conversion intrinsics instead of using generic IR

D20859 and D20860 attempted to replace the SSE (V)CVTTPS2DQ and VCVTTPD2DQ truncating conversions with generic IR instead.

It turns out that the behaviour of these intrinsics is different enough from generic IR that this will cause problems, INF/NAN/out of range values are guaranteed to result in a 0x80000000 value - which plays havoc with constant folding which converts them to either zero or UNDEF. This is also an issue with the scalar implementations (which were already generic IR and what I was trying to match).

This patch changes both scalar and packed versions back to using x86-specific builtins.

It also deals with the other scalar conversion cases that are runtime rounding mode dependent and can have similar issues with constant folding.

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

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

8 years ago[Sema] Compute the nullability of a conditional expression based on the
Akira Hatanaka [Wed, 20 Jul 2016 01:48:11 +0000 (01:48 +0000)]
[Sema] Compute the nullability of a conditional expression based on the
nullabilities of its operands.

This patch defines a function to compute the nullability of conditional
expressions, which enables Sema to precisely detect implicit conversions
of nullable conditional expressions to nonnull pointers.

rdar://problem/25166556

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

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

8 years agoRevert r276069: MSVC bots not happy
Hubert Tong [Wed, 20 Jul 2016 01:05:31 +0000 (01:05 +0000)]
Revert r276069: MSVC bots not happy

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

8 years agoFix r276069: add default argument for new parameter
Hubert Tong [Wed, 20 Jul 2016 00:57:56 +0000 (00:57 +0000)]
Fix r276069: add default argument for new parameter

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

8 years agoFix r276069: use LLVM_CONSTEXPR
Hubert Tong [Wed, 20 Jul 2016 00:41:30 +0000 (00:41 +0000)]
Fix r276069: use LLVM_CONSTEXPR

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

8 years agoConcepts: Create space for requires-clause in TemplateParameterList; NFC
Hubert Tong [Wed, 20 Jul 2016 00:30:15 +0000 (00:30 +0000)]
Concepts: Create space for requires-clause in TemplateParameterList; NFC

Summary:
Space for storing the //constraint-expression// of the
//requires-clause// associated with a `TemplateParameterList` is
arranged by taking a bit out of the `NumParams` field for the purpose
of determining whether there is a //requires-clause// or not, and by
adding to the trailing objects tied to the `TemplateParameterList`. An
accessor is provided.

An appropriate argument is supplied to `TemplateParameterList::Create`
at the various call sites.

Serialization changes will addressed as the Concepts implementation
becomes more solid.

Drive-by fix:
This change also replaces the custom
`FixedSizeTemplateParameterListStorage` implementation with one that
follows the interface provided by `llvm::TrailingObjects`.

Reviewers: aaron.ballman, faisalv, rsmith

Subscribers: cfe-commits, nwilson

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

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

8 years ago[SemaObjC] Improve ObjCDictionaryLiteral and ObjCArryLiteral diagnostics
Bruno Cardoso Lopes [Tue, 19 Jul 2016 20:21:18 +0000 (20:21 +0000)]
[SemaObjC] Improve ObjCDictionaryLiteral and ObjCArryLiteral diagnostics

Sema actions on ObjCDictionaryLiteral and ObjCArryLiteral are currently
done as a side-effect of Sema upon parent expressions, which incurs of
delayed typo corrections for such literals to be performed by TypoTransforms
upon the ObjCDictionaryLiteral and ObjCArryLiteral themselves instead of
its elements individually.

This is specially bad because it was not designed to act on several
elements; searching through all possible combinations of corrections for
several elements is very expensive. Additionally, when one of the
elements has no correction candidate, we still explore all options and
at the end emit no typo corrections whatsoever.

Do the proper sema actions by acting on each element alone during appropriate
literal parsing time to get proper diagonistics and decent compile time
behavior.

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

rdar://problem/21046678

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

8 years agoLet FuncAttrs infer the 'returned' argument attribute
David Majnemer [Tue, 19 Jul 2016 19:59:24 +0000 (19:59 +0000)]
Let FuncAttrs infer the 'returned' argument attribute

This reverts commit r275756.

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

8 years ago[OpenCL] Fixes bug of missing OCL version metadata on the AMDGCN target
Yaxun Liu [Tue, 19 Jul 2016 19:39:45 +0000 (19:39 +0000)]
[OpenCL] Fixes bug of missing OCL version metadata on the AMDGCN target

Added the opencl.ocl.version metadata to be emitted with amdgcn. Created a static function emitOCLVerMD which is shared between triple spir and target amdgcn.

Also added new testcases to existing test file, spir_version.cl inside test/CodeGenOpenCL.

Patch by Aaron En Ye Shi.

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

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

8 years agoAdd support of the latest Ubuntu (Yakkety Yak - 16.10)
Sylvestre Ledru [Tue, 19 Jul 2016 14:00:57 +0000 (14:00 +0000)]
Add support of the latest Ubuntu (Yakkety Yak - 16.10)

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

8 years agoFix for failing bot sanitizer-x86_64-linux-fast after r275970
Dmitry Polukhin [Tue, 19 Jul 2016 13:35:15 +0000 (13:35 +0000)]
Fix for failing bot sanitizer-x86_64-linux-fast after r275970

More info http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/14774/steps/check-clang%20msan/logs/stdio

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

8 years agoDeprecated (legacy) string literal conversion to 'char *' causes strange overloading...
Dmitry Polukhin [Tue, 19 Jul 2016 11:29:16 +0000 (11:29 +0000)]
Deprecated (legacy) string literal conversion to 'char *' causes strange overloading resolution

It's a patch for PR28050. Seems like overloading resolution wipes out
the first standard conversion sequence (before user-defined conversion)
in case of deprecated string literal conversion.

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

Patch by Alexander Makarov

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

8 years ago[mips] Correct label prefixes for N32 and N64.
Daniel Sanders [Tue, 19 Jul 2016 10:49:03 +0000 (10:49 +0000)]
[mips] Correct label prefixes for N32 and N64.

Summary:
N32 and N64 follow the standard ELF conventions (.L) whereas O32 uses its own
($).

This fixes the majority of object differences between -fintegrated-as and
-fno-integrated-as.

Reviewers: sdardis

Subscribers: dsanders, sdardis, llvm-commits

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

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

8 years ago[driver][mips] Remove empty folder from test inputs
Simon Atanasyan [Tue, 19 Jul 2016 07:23:15 +0000 (07:23 +0000)]
[driver][mips] Remove empty folder from test inputs

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

8 years ago[driver][mips] Support MIPS targets in modern Android NDK
Simon Atanasyan [Tue, 19 Jul 2016 07:09:48 +0000 (07:09 +0000)]
[driver][mips] Support MIPS targets in modern Android NDK

Initial patch provided by Duane Sand.

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

8 years ago[OPENMP] Removed loop statement as its body executes at most once, NFC.
Alexey Bataev [Tue, 19 Jul 2016 05:06:39 +0000 (05:06 +0000)]
[OPENMP] Removed loop statement as its body executes at most once, NFC.

Removed not required loop statement, addressing comments from Richard
Smith.

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

8 years ago[OPENMP] Improved processing of 'priority' clause, NFC.
Alexey Bataev [Tue, 19 Jul 2016 04:21:09 +0000 (04:21 +0000)]
[OPENMP] Improved processing of 'priority' clause, NFC.

Removed some old comments + improved handling of 'priority' clause value
during codegen after comments from Richard Smith.

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

8 years agoAppend clang system include path for offloading tool chains.
Samuel Antao [Tue, 19 Jul 2016 00:01:12 +0000 (00:01 +0000)]
Append clang system include path for offloading tool chains.

Summary:
This patch adds clang system include path when offloading tool chains, e.g. CUDA, are used in the current compilation.

This fixes an issue detected by @rsmith in response to r275645.

Reviewers: rsmith, tra

Subscribers: rsmith, cfe-commits

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

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

8 years ago[OpenMP] Remove dead code in conditional of mappable expressions SEMA.
Samuel Antao [Mon, 18 Jul 2016 23:22:11 +0000 (23:22 +0000)]
[OpenMP] Remove dead code in conditional of mappable expressions SEMA.

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

8 years ago[OpenMP] Fix incorrect diagnostics in map clause
Kelvin Li [Mon, 18 Jul 2016 22:49:16 +0000 (22:49 +0000)]
[OpenMP] Fix incorrect diagnostics in map clause

Having the following code pattern will result in incorrect diagnostic

int main() {
  int arr[10];
#pragma omp target data map(arr[:])
#pragma omp target map(arr)
  {}
}

t.cpp:4:24: error: original storage of expression in data environment is shared
      but data environment do not fully contain mapped expression storage
#pragma omp target map(arr)
                       ^~~
t.cpp:3:29: note: used here
#pragma omp target data map(arr[:])
                            ^~~~~~
1 error generated.

Patch by David S.

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

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

8 years agoFix some minor issues found by Coverity.
Richard Smith [Mon, 18 Jul 2016 22:37:35 +0000 (22:37 +0000)]
Fix some minor issues found by Coverity.

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

8 years ago[Coverage] Remove '..' from filenames *after* getting an absolute path
Vedant Kumar [Mon, 18 Jul 2016 22:32:02 +0000 (22:32 +0000)]
[Coverage] Remove '..' from filenames *after* getting an absolute path

Failure to do this breaks relative paths which begin with '..'.

This issue was caught by the (still nascent) coverage bot.

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

8 years ago[Coverage] Normalize '..' out of filename strings
Vedant Kumar [Mon, 18 Jul 2016 21:01:27 +0000 (21:01 +0000)]
[Coverage] Normalize '..' out of filename strings

This fixes the issue of having duplicate entries for the same file in a
coverage report s.t none of the entries actually displayed the correct
coverage information.

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

8 years ago[Sema] Create a separate group for incompatible function pointer warning
Bruno Cardoso Lopes [Mon, 18 Jul 2016 20:37:06 +0000 (20:37 +0000)]
[Sema] Create a separate group for incompatible function pointer warning

Give incompatible function pointer warning its own diagnostic group
but still leave it as a subgroup of incompatible-pointer-types. This is in
preparation to promote -Wincompatible-function-pointer-types to error on
darwin.

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

rdar://problem/12907612

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

8 years agoAdd missing header in ClangFuzzer (after r275882 cleanup)
Mehdi Amini [Mon, 18 Jul 2016 20:33:09 +0000 (20:33 +0000)]
Add missing header in ClangFuzzer (after r275882 cleanup)

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

8 years agoAllow iOS and tvOS version numbers with 2-digit major version numbers.
Bob Wilson [Mon, 18 Jul 2016 20:29:14 +0000 (20:29 +0000)]
Allow iOS and tvOS version numbers with 2-digit major version numbers.

rdar://problem/26921601

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

8 years ago[Driver] Compute effective target triples once per job (NFCI)
Vedant Kumar [Mon, 18 Jul 2016 19:56:38 +0000 (19:56 +0000)]
[Driver] Compute effective target triples once per job (NFCI)

Compute an effective target triple exactly once in ConstructJob(), and
then simply pass around references to it. This eliminates wasteful
re-computation of effective triples (e.g in getARMFloatABI()).

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

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

8 years ago[Driver] Make Driver::DefaultTargetTriple private (NFCI)
Vedant Kumar [Mon, 18 Jul 2016 19:56:33 +0000 (19:56 +0000)]
[Driver] Make Driver::DefaultTargetTriple private (NFCI)

No in-tree targets access this `DefaultTargetTriple` directly, and usage
of default triples is generally discouraged. Make the field private.

This is part of en effort to make the clang driver use effective triples
more pervasively.

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

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

8 years ago[NFC] Header cleanup
Mehdi Amini [Mon, 18 Jul 2016 19:02:11 +0000 (19:02 +0000)]
[NFC] Header cleanup

Summary: Removed unused headers, replaced some headers with forward class declarations

Patch by: Eugene <claprix@yandex.ru>

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

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

8 years agoRevert "[analyzer] Add checker modeling potential C++ self-assignment"
Devin Coughlin [Mon, 18 Jul 2016 18:57:50 +0000 (18:57 +0000)]
Revert "[analyzer] Add checker modeling potential C++ self-assignment"

This reverts commit r275820. It is failing on the bots.

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

8 years agoSupport -masm= flag for x86 assembly targets.
Yunzhong Gao [Mon, 18 Jul 2016 18:44:51 +0000 (18:44 +0000)]
Support -masm= flag for x86 assembly targets.

For assembly files without .intel_syntax or .att_syntax directives, allow the
-masm= flag to supply a default assembly dialect. For example,

C:\TMP> type intel.s
.text
mov al,0

C:\TMP> clang -masm=intel -c intel.s

Without this patch, one would need to pass an "-mllvm -x86-asm-syntax=" flag
directly to the backend.
C:\TMP> clang -mllvm --x86-asm-syntax=intel -c intel.s

Differentials Review: http://reviews.llvm.org/D22285

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

8 years agodocs/conf.py: update version to 4.0
Hans Wennborg [Mon, 18 Jul 2016 18:13:08 +0000 (18:13 +0000)]
docs/conf.py: update version to 4.0

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

8 years agoTrunk release notes are now for 4.0.0
Hans Wennborg [Mon, 18 Jul 2016 18:05:19 +0000 (18:05 +0000)]
Trunk release notes are now for 4.0.0

The 3.9 release are on the 3.9 branch.

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

8 years ago[clang-cl] Reinstate -gline-tables-only as a CoreOption while we sort out the fate...
Reid Kleckner [Mon, 18 Jul 2016 17:49:40 +0000 (17:49 +0000)]
[clang-cl] Reinstate -gline-tables-only as a CoreOption while we sort out the fate of /Zd

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

8 years ago[analyzer] Add checker modeling potential C++ self-assignment
Devin Coughlin [Mon, 18 Jul 2016 17:23:30 +0000 (17:23 +0000)]
[analyzer] Add checker modeling potential C++ self-assignment

This checker checks copy and move assignment operators whether they are
protected against self-assignment. Since C++ core guidelines discourages
explicit checking for `&rhs==this` in general we take a different approach: in
top-frame analysis we branch the exploded graph for two cases, where &rhs==this
and &rhs!=this and let existing checkers (e.g. unix.Malloc) do the rest of the
work. It is important that we check all copy and move assignment operator in top
frame even if we checked them already since self-assignments may happen
undetected even in the same translation unit (e.g. using random indices for an
array what may or may not be the same).

A patch by Ádám Balogh!

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

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

8 years agoRelease note for 'nodebug' on variables
Paul Robinson [Mon, 18 Jul 2016 17:19:12 +0000 (17:19 +0000)]
Release note for 'nodebug' on variables

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

8 years ago[OpenMP] update test cases for -std=c++11 compile
Kelvin Li [Mon, 18 Jul 2016 16:09:53 +0000 (16:09 +0000)]
[OpenMP] update test cases for -std=c++11 compile

target_parallel_for_simd_collapse_messages.cpp and target_parallel_for_simd_ordered_messages.cpp give different diagnostic messages in compiling with -std=c++11. The test cases are updated to make it compatible.

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

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

8 years agoRevert r275678, "Revert "Revert r275027 - Let FuncAttrs infer the 'returned' argument...
NAKAMURA Takumi [Mon, 18 Jul 2016 03:23:25 +0000 (03:23 +0000)]
Revert r275678, "Revert "Revert r275027 - Let FuncAttrs infer the 'returned' argument attribute""

This reverts also r275029, "Update Clang tests after adding inference for the returned argument attribute"

It broke LTO build. Seems miscompilation.

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

8 years agotest: add missing triple to test
Saleem Abdulrasool [Sun, 17 Jul 2016 22:54:42 +0000 (22:54 +0000)]
test: add missing triple to test

The test was relying on the default triple which may not be correct.  Explicitly
provide it a triple.  Should repair the windows on Linux builder.

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

8 years agoCodeGen: honour dllstorage on ObjC types
Saleem Abdulrasool [Sun, 17 Jul 2016 22:27:44 +0000 (22:27 +0000)]
CodeGen: honour dllstorage on ObjC types

Add support for ObjC types to respect the DLLImport/DLLExport storage
annotations.  This only effects COFF output.  This would allow usage with
clang/C2, but not with clang/LLVM due to hard coded section names.

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

8 years agoCodeGen: whitespace, formatting cleanups, NFC
Saleem Abdulrasool [Sun, 17 Jul 2016 22:27:41 +0000 (22:27 +0000)]
CodeGen: whitespace, formatting cleanups, NFC

Format some code which was oddly formatted.  Use a bit of auto to make the code
more legible.  NFC.

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

8 years agoCodeGen: whitespace cleanup, StringRef usage in ObjC EH type construction
Saleem Abdulrasool [Sun, 17 Jul 2016 22:27:38 +0000 (22:27 +0000)]
CodeGen: whitespace cleanup, StringRef usage in ObjC EH type construction

Clean up some formatting issues and use a bit more StringRef based operations
instead of SmallStrings.  NFC.

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

8 years agoAttempt to work around MSVC rejects-valid, round 2.
Richard Smith [Sun, 17 Jul 2016 20:00:59 +0000 (20:00 +0000)]
Attempt to work around MSVC rejects-valid, round 2.

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

8 years agoPR28589: attempt to work around MSVC rejects-valid.
Richard Smith [Sun, 17 Jul 2016 19:24:51 +0000 (19:24 +0000)]
PR28589: attempt to work around MSVC rejects-valid.

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

8 years ago[CodeGen] Some assorted cleanups
David Majnemer [Sun, 17 Jul 2016 00:39:12 +0000 (00:39 +0000)]
[CodeGen] Some assorted cleanups

No functional change, just some cleanups:
- Use auto when it is appropriate.
- There were some strange static_casts which were superfluous.
- Use range-based for loops when appropriate.
- The dyn_cast_or_null construct was used when null was impossible.

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

8 years agoCodeGen: use StringRefs more in ObjC class generation, NFC
Saleem Abdulrasool [Sat, 16 Jul 2016 22:42:06 +0000 (22:42 +0000)]
CodeGen: use StringRefs more in ObjC class generation, NFC

Rather than building up a number of SmallString-s in order to construct a
std::string, use more StringRefs and construct the string once before use.  This
avoids unnecessary string constructions.  NFC.

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