]> granicus.if.org Git - clang/log
clang
8 years agoc-index-test: Fix libdeps corresponding to r260841.
NAKAMURA Takumi [Sun, 14 Feb 2016 09:19:04 +0000 (09:19 +0000)]
c-index-test: Fix libdeps corresponding to r260841.

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

8 years ago[c-index-test] Fix a gcc build error.
Argyrios Kyrtzidis [Sun, 14 Feb 2016 07:08:31 +0000 (07:08 +0000)]
[c-index-test] Fix a gcc build error.

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

8 years ago[index] Fix gcc builds.
Argyrios Kyrtzidis [Sun, 14 Feb 2016 06:53:20 +0000 (06:53 +0000)]
[index] Fix gcc builds.

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

8 years ago[index] Enhance c-index-test tool and have it link and test the clangIndex library...
Argyrios Kyrtzidis [Sun, 14 Feb 2016 06:39:11 +0000 (06:39 +0000)]
[index] Enhance c-index-test tool and have it link and test the clangIndex library directly.

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

8 years ago[index] Allow calling createIndexingAction() without passing another action to wrap...
Argyrios Kyrtzidis [Sun, 14 Feb 2016 06:39:03 +0000 (06:39 +0000)]
[index] Allow calling createIndexingAction() without passing another action to wrap over.

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

8 years ago[OpenMP] Rename the offload entry points.
Samuel Antao [Sat, 13 Feb 2016 23:35:10 +0000 (23:35 +0000)]
[OpenMP] Rename the offload entry points.

Summary:
Unlike other outlined regions in OpenMP, offloading entry points have to have be visible (external linkage) for the device side. Using dots in the names of the entries can be therefore problematic for some toolchains, e.g. NVPTX.

Also the patch drops the column information in the unique name of the entry points. The parsing of directives ignore unknown tokens, preventing several target  regions to be implemented in the same line. Therefore, the line information is sufficient for the name to be unique. Also, the preprocessor printer does not preserve the column information, causing offloading-entry detection issues if the host uses an integrated preprocessor and the target doesn't (or vice versa).

Reviewers: hfinkel, arpith-jacob, carlo.bertolli, kkwli0, ABataev

Subscribers: cfe-commits, fraggamuffin, caomhin

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

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

8 years ago[AST] Add a print() method in DeclarationName that accepts a PrintingPolicy.
Argyrios Kyrtzidis [Sat, 13 Feb 2016 21:46:50 +0000 (21:46 +0000)]
[AST] Add a print() method in DeclarationName that accepts a PrintingPolicy.

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

8 years agoFix a leak in the generated code for attributes with strings.
Benjamin Kramer [Sat, 13 Feb 2016 18:11:49 +0000 (18:11 +0000)]
Fix a leak in the generated code for attributes with strings.

Storing std::strings in attributes simply doesn't work, we never call
the destructor. Use an array of StringRefs instead of std::strings and
copy the data into memory taken from the ASTContext.

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

8 years agoRValue refs do not work that way.
Benjamin Kramer [Sat, 13 Feb 2016 16:00:13 +0000 (16:00 +0000)]
RValue refs do not work that way.

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

8 years agoDon't copy a DenseMap just to do lookup in it.
Benjamin Kramer [Sat, 13 Feb 2016 15:49:17 +0000 (15:49 +0000)]
Don't copy a DenseMap just to do lookup in it.

Also remove the now unused isPodLike specialization. DenseMap only uses
it for copies.

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

8 years agoReduce the number of implicit StringRef->std::string conversions by threading StringR...
Benjamin Kramer [Sat, 13 Feb 2016 13:42:54 +0000 (13:42 +0000)]
Reduce the number of implicit StringRef->std::string conversions by threading StringRef through more APIs.

No functionality change intended.

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

8 years agoFix use after free.
Benjamin Kramer [Sat, 13 Feb 2016 13:42:41 +0000 (13:42 +0000)]
Fix use after free.

Found by asan.

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

8 years ago[OPENMP] NFC rewrite ParseOpenMPDirectiveKind
Dmitry Polukhin [Sat, 13 Feb 2016 06:53:38 +0000 (06:53 +0000)]
[OPENMP] NFC rewrite ParseOpenMPDirectiveKind

New implementation is easier to read and extend.

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

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

8 years ago[index] Change some default parameters to fix an MSVC ICE.
Argyrios Kyrtzidis [Sat, 13 Feb 2016 05:17:15 +0000 (05:17 +0000)]
[index] Change some default parameters to fix an MSVC ICE.

Many thanks to Yunzhong Gao for tracking this down!

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

8 years agolibclang/CMakeLists.txt: Prune IndexingContext.h out of ADDITIONAL_HEADERS. VS IDE...
NAKAMURA Takumi [Sat, 13 Feb 2016 04:01:49 +0000 (04:01 +0000)]
libclang/CMakeLists.txt: Prune IndexingContext.h out of ADDITIONAL_HEADERS. VS IDE uses it.

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

8 years agoFix the ASTPrinter output for ascii char literals >127.
Steven Watanabe [Sat, 13 Feb 2016 02:31:28 +0000 (02:31 +0000)]
Fix the ASTPrinter output for ascii char literals >127.

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

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

8 years agoAccept "-Weverything" in clang diagnistic pragmas
Sunil Srivastava [Sat, 13 Feb 2016 01:44:05 +0000 (01:44 +0000)]
Accept "-Weverything" in clang diagnistic pragmas

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

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

8 years ago[Sema] More changes to fix Objective-C fallout from r249995.
Bob Wilson [Sat, 13 Feb 2016 01:41:41 +0000 (01:41 +0000)]
[Sema] More changes to fix Objective-C fallout from r249995.

This is a follow-up to PR26085. That was fixed in r257710 but the testcase
there was incomplete. There is a related issue where the overload resolution
for Objective-C incorrectly picks a method that is not valid without a
bridge cast. The call to Sema::CheckSingleAssignmentConstraints that was
added to SemaOverload.cpp's IsStandardConversion() function does not catch
that case and reports that the method is Compatible even when it is not.

The root cause here is that various Objective-C-related functions in Sema
do not consistently return a value to indicate whether there was an error.
This was fine in the past because they would report diagnostics when needed,
but r257710 changed them to suppress reporting diagnostics when checking
during overload resolution.

This patch adds a new ACR_error result to the ARCConversionResult enum and
updates Sema::CheckObjCARCConversion to return that value when there is an
error. Most of the calls to that function do not check the return value,
so adding this new result does not affect them. The one exception is in
SemaCast.cpp where it specifically checks for ACR_unbridged, so that is
also OK. The call in Sema::CheckSingleAssignmentConstraints can then check
for an ACR_okay result and identify assignments as Incompatible. To
preserve the existing behavior, it only changes the return value to
Incompatible when the new Diagnose argument (from r257710) is false.

Similarly, the CheckObjCBridgeRelatedConversions and
ConversionToObjCStringLiteralCheck need to identify when an assignment is
Incompatible. Those functions already return appropriate values but they
need some fixes related to the new Diagnose argument.

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

8 years ago[RecursiveASTVisitor] Introduce dataTraverseStmtPre()/dataTraverseStmtPost() to allow...
Argyrios Kyrtzidis [Sat, 13 Feb 2016 01:24:19 +0000 (01:24 +0000)]
[RecursiveASTVisitor] Introduce dataTraverseStmtPre()/dataTraverseStmtPost() to allow clients to do before/after actions during data recursive visitation.

This should fix the asan bot that hits stack overflow in a couple of test/Index tests.

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

8 years agoAMDGPU: Add sin/cos builtins
Matt Arsenault [Sat, 13 Feb 2016 01:21:09 +0000 (01:21 +0000)]
AMDGPU: Add sin/cos builtins

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

8 years agoAMDGPU: Update builtin for intrinsic change
Matt Arsenault [Sat, 13 Feb 2016 01:03:09 +0000 (01:03 +0000)]
AMDGPU: Update builtin for intrinsic change

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

8 years agoDisable two tests that use a lot of stack under ASan.
Alexey Samsonov [Sat, 13 Feb 2016 01:02:59 +0000 (01:02 +0000)]
Disable two tests that use a lot of stack under ASan.

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

8 years agoMake -Wnull-conversion more useful.
Richard Trieu [Sat, 13 Feb 2016 00:58:53 +0000 (00:58 +0000)]
Make -Wnull-conversion more useful.

When a null constant is used in a macro, walk through the macro stack to
determine where the null constant is written and where the context is located.
Only warn if both locations are within the same macro expansion.  This helps
function-like macros which involve pointers be treated as if they were
functions.

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

8 years ago[index] Add llvm/Support/DataTypes.h header to fix build failures in the bots.
Argyrios Kyrtzidis [Fri, 12 Feb 2016 23:30:07 +0000 (23:30 +0000)]
[index] Add llvm/Support/DataTypes.h header to fix build failures in the bots.

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

8 years ago[libclang] Separate the underlying indexing functionality of libclang and introduce...
Argyrios Kyrtzidis [Fri, 12 Feb 2016 23:10:59 +0000 (23:10 +0000)]
[libclang] Separate the underlying indexing functionality of libclang and introduce it into the clangIndex library.

It is a general goodness for libclang itself to mostly be a wrapper of functionality provided by the libraries.

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

8 years agoFix remaining Clang-tidy readability-redundant-control-flow warnings; other minor...
Eugene Zelenko [Fri, 12 Feb 2016 22:53:10 +0000 (22:53 +0000)]
Fix remaining Clang-tidy readability-redundant-control-flow warnings; other minor fixes.

Differential revision: http://reviews.llvm.org/D17218

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

8 years agoDarwin: pass -stdlib=libc++ down to cc1 whenever we're targeting libc++
Tim Northover [Fri, 12 Feb 2016 22:30:42 +0000 (22:30 +0000)]
Darwin: pass -stdlib=libc++ down to cc1 whenever we're targeting libc++

Recent refactoring meant it only got passed down when explicitly specified,
which breaks header search on Darwin.

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

8 years ago[CMake] Fixing bots I broke.
Chris Bieneman [Fri, 12 Feb 2016 21:46:25 +0000 (21:46 +0000)]
[CMake] Fixing bots I broke.

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

8 years ago[CMake] Improve the clang order-file generation workflow
Chris Bieneman [Fri, 12 Feb 2016 21:36:55 +0000 (21:36 +0000)]
[CMake] Improve the clang order-file generation workflow

Summary:
This commit re-lands r259862. The underlying cause of the build breakage was an incorrectly written capabilities test. In tools/Driver/CMakeLists.txt I was attempting to check if a linker flag worked, the test was passing it to the compiler, not the linker. CMake doesn't have a linker test, so we have a hand-rolled one.

Original Patch Review: http://reviews.llvm.org/D16896

Original Summary:
With this change generating clang order files using dtrace uses the following workflow:

cmake <whatever options you want>

ninja generate-order-file

ninja clang

This patch works by setting a default path to the order file (which can be overridden by the user). If the order file doesn't exist during configuration CMake will create an empty one.

CMake then ties up the dependencies between the clang link job and the order file, and generate-order-file overwrites CLANG_ORDER_FILE with the new order file.

Reviewers: bogner

Subscribers: cfe-commits

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

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

8 years agoAdded missing '__'.
Artem Belevich [Fri, 12 Feb 2016 20:26:43 +0000 (20:26 +0000)]
Added missing '__'.

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

8 years agotest/Headers/float.c: fix theoretical edge values
Hubert Tong [Fri, 12 Feb 2016 19:24:36 +0000 (19:24 +0000)]
test/Headers/float.c: fix theoretical edge values

For *_MANT_DIG, *_MAX_EXP and *_MIN_EXP, the C Standard does not list
the least requirements directly. This patch adjusts the test values with
refined ones.

Patch by Jorge Teixeira!

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

8 years ago[AST] Fix typos in RecordLayoutBuilder
David Majnemer [Fri, 12 Feb 2016 19:21:02 +0000 (19:21 +0000)]
[AST] Fix typos in RecordLayoutBuilder

No functional change is intended.

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

8 years ago[CMake] Pass stage1 tools through to stage2 when building with LTO
Chris Bieneman [Fri, 12 Feb 2016 19:06:12 +0000 (19:06 +0000)]
[CMake] Pass stage1 tools through to stage2 when building with LTO

This was originally a hacky if(APPLE) block. Now that we have an option for enabling LTO, it is better to properly gate this.

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

8 years ago[CUDA] Tweak attribute-based overload resolution to match nvcc behavior.
Artem Belevich [Fri, 12 Feb 2016 18:29:18 +0000 (18:29 +0000)]
[CUDA] Tweak attribute-based overload resolution to match nvcc behavior.

This is an artefact of split-mode CUDA compilation that we need to
mimic. HD functions are sometimes allowed to call H or D functions. Due
to split compilation mode device-side compilation will not see host-only
function and thus they will not be considered at all. For clang both H
and D variants will become function overloads visible to
compiler. Normally target attribute is considered only if C++ rules can
not determine which function is better. However in this case we need to
ignore functions that would not be present during current compilation
phase before we apply normal overload resolution rules.

Changes:
* introduced another level of call preference to better describe
  possible call combinations.
* removed WrongSide functions from consideration if the set contains
  SameSide function.
* disabled H->D, D->H and G->H calls. These combinations are
  not allowed by CUDA and we were reluctantly allowing them to work
  around device-side calls to math functions in std namespace.
  We no longer need it after r258880.

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

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

8 years ago[Hexagon] Specify vector alignment in DataLayout string
Krzysztof Parzyszek [Fri, 12 Feb 2016 14:48:34 +0000 (14:48 +0000)]
[Hexagon] Specify vector alignment in DataLayout string

The DataLayout can calculate alignment of vectors based on the alignment
of the element type and the number of elements. In fact, it is the product
of these two values. The problem is that for vectors of N x i1, this will
return the alignment of N bytes, since the alignment of i1 is 8 bits. The
vector types of vNi1 should be aligned to N bits instead. Provide explicit
alignment for HVX vectors to avoid such complications.

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

8 years agoFix ICE with constexpr and friend functions
Olivier Goffart [Fri, 12 Feb 2016 12:34:44 +0000 (12:34 +0000)]
Fix ICE with constexpr and friend functions

Fix a crash while parsing this code:

  struct X  {
    friend constexpr int foo(X*) { return 12; }
    static constexpr int j = foo(static_cast<X*>(nullptr));
  };

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

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

8 years ago[OpenCL] Disable C99 standard lib functions
Anastasia Stulova [Fri, 12 Feb 2016 12:07:04 +0000 (12:07 +0000)]
[OpenCL] Disable C99 standard lib functions

The library functions defined in the C99 standard headers
are not available (OpenCL v1.2 s6.9.f).

This change stops treating OpenCL builtin functions as standard C lib
functions to eliminate warning messages about printf format string.

Patch by Liu Yaxun (Sam)!

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

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

8 years ago[CMake] Add option to switch default C++ stdlib
Jonas Hahnfeld [Fri, 12 Feb 2016 07:48:37 +0000 (07:48 +0000)]
[CMake] Add option to switch default C++ stdlib

With this option one can optionally override the architecture dependent
default library to use if no -stdlib= is provided on compiler invocation.

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

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

8 years agotests: Add explicit -stdlib=libstdc++ to tests that require it
Jonas Hahnfeld [Fri, 12 Feb 2016 07:48:28 +0000 (07:48 +0000)]
tests: Add explicit -stdlib=libstdc++ to tests that require it

This will be needed for the next commit that allows to switch the default
C++ library which would otherwise make these tests fail.

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

8 years agoUpdate functions in clang supplied headers to use the compiler reserved
Eric Christopher [Fri, 12 Feb 2016 02:22:53 +0000 (02:22 +0000)]
Update functions in clang supplied headers to use the compiler reserved
namespace for arguments.

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

8 years ago<float.h>: do not define DECIMAL_DIG in -std=c89 mode; this macro was added in C99.
Richard Smith [Fri, 12 Feb 2016 01:15:33 +0000 (01:15 +0000)]
<float.h>: do not define DECIMAL_DIG in -std=c89 mode; this macro was added in C99.

Patch by Jorge Teixeira!

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

8 years agoUsersManual: update clang-cl commands
Hans Wennborg [Fri, 12 Feb 2016 01:01:37 +0000 (01:01 +0000)]
UsersManual: update clang-cl commands

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

8 years agoUse __ before argument names in provided headers.
Eric Christopher [Fri, 12 Feb 2016 00:32:23 +0000 (00:32 +0000)]
Use __ before argument names in provided headers.

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

8 years ago[sancov] improved object files handling.
Mike Aizatsky [Fri, 12 Feb 2016 00:29:45 +0000 (00:29 +0000)]
[sancov] improved object files handling.

Documentation change for: http://reviews.llvm.org/D17169

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

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

8 years agoRemove decision logic for old NetBSD development versions, the 7.0
Joerg Sonnenberger [Thu, 11 Feb 2016 23:35:03 +0000 (23:35 +0000)]
Remove decision logic for old NetBSD development versions, the 7.0
release made this obsolete.

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

8 years agoNow that Sparc/Sparc64 backend is mostly usable, provide the same
Joerg Sonnenberger [Thu, 11 Feb 2016 23:18:36 +0000 (23:18 +0000)]
Now that Sparc/Sparc64 backend is mostly usable, provide the same
linking defaults as other NetBSD targets, i.e. compiler_rt-in-libc and
libc++ as STL.

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

8 years agoRemove bogus check that larger floating point types have smaller minimum
Richard Smith [Thu, 11 Feb 2016 22:18:10 +0000 (22:18 +0000)]
Remove bogus check that larger floating point types have smaller minimum
normalized exponents. That's not true for double versus double double.

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

8 years ago[analyzer] Improve pattern matching in ObjCDealloc checker.
Devin Coughlin [Thu, 11 Feb 2016 22:13:20 +0000 (22:13 +0000)]
[analyzer] Improve pattern matching in ObjCDealloc checker.

Look through PseudoObjectExpr and OpaqueValueExprs when scanning for
release-like operations. This commit also adds additional tests in anticipation
of re-writing this as a path-sensitive checker.

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

8 years agoRelax recently added clang version checks.
Tim Northover [Thu, 11 Feb 2016 21:31:51 +0000 (21:31 +0000)]
Relax recently added clang version checks.

You can override the value of these during CMake, and we often use sentinels
with more than one digit (not to mention our actual Clang being 700.whatever).

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

8 years agoXFAIL this test for PPC64 for now. It looks like the *_MIN_EXP macros are in fact...
Richard Smith [Thu, 11 Feb 2016 20:36:47 +0000 (20:36 +0000)]
XFAIL this test for PPC64 for now. It looks like the *_MIN_EXP macros are in fact defined incorrectly for that target.

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

8 years agoAdd parse+sema and regression test for OpenMP firstprivate clause of target directive
Carlo Bertolli [Thu, 11 Feb 2016 20:12:28 +0000 (20:12 +0000)]
Add parse+sema and regression test for OpenMP firstprivate clause of target directive

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

8 years agoIn C11, provide macros FLT_DECIMAL_DIG, DBL_DECIMAL_DIG, and LDBL_DECIMAL_DIG in...
Richard Smith [Thu, 11 Feb 2016 19:57:37 +0000 (19:57 +0000)]
In C11, provide macros FLT_DECIMAL_DIG, DBL_DECIMAL_DIG, and LDBL_DECIMAL_DIG in <float.h>.

Patch by Jorge Teixeira!

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

8 years ago[PR26550] Use a different TBAA root for C++ vs C.
Manman Ren [Thu, 11 Feb 2016 19:19:18 +0000 (19:19 +0000)]
[PR26550] Use a different TBAA root for C++ vs C.

This commit changes the root from "Simple C/C++ TBAA" to "Simple C++ TBAA" for
C++.

The problem is that the type name in the TBAA nodes is generated differently
for C vs C++. If we link an IR file for C with an IR file for C++, since they
have the same root and the type names are different, accesses to the two type
nodes will be considered no-alias, even though the two type nodes are from
the same type in a header file.

The fix is to use different roots for C and C++. Types from C will be treated
conservatively in respect to types from C++.

Follow-up commits will change the C root to "Simple C TBAA" plus some mangling
change for C types to make it a little more aggresive.

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

8 years ago[Modules] Early-exit if ReadOptionsBlock fails to avoid crashing
Ben Langmuir [Thu, 11 Feb 2016 18:54:02 +0000 (18:54 +0000)]
[Modules] Early-exit if ReadOptionsBlock fails to avoid crashing

If we didn't tell ReadOptionsBlock to allow failures then we can't
assume that the stream is not in the middle of a block if it returns
out-of-date. This was causing a crash when we tried to continue reading.

Also, it's just generally a good idea to early-exit if we're doing
implicit module builds, since we will want to immediately rebuild this
module anyway and there's no reason to waste time continuing after
failure.

rdar://problem/24114938

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

8 years ago[Driver] Add support for Qualcomm's Kryo CPU.
Chad Rosier [Thu, 11 Feb 2016 18:09:31 +0000 (18:09 +0000)]
[Driver] Add support for Qualcomm's Kryo CPU.

http://reviews.llvm.org/D17124

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

8 years agoRemove unused includes
David Majnemer [Thu, 11 Feb 2016 17:54:39 +0000 (17:54 +0000)]
Remove unused includes

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

8 years agoRevert "Revert r260388 "[MS ABI] Never reference dllimport'd vtables""
David Majnemer [Thu, 11 Feb 2016 17:49:28 +0000 (17:49 +0000)]
Revert "Revert r260388 "[MS ABI] Never reference dllimport'd vtables""

This reverts commit r260449.

We would supress our emission of vftable definitions if we thought
another translation unit would provide the definition because we saw an
explicit instantiation declaration.  This is not the case with
dllimport, we want to synthesize a definition of the vftable regardless.

This fixes PR26569.

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

8 years ago[Modules] Don't infinite recurse on implicit import of circular modules in preamble
Ben Langmuir [Thu, 11 Feb 2016 17:04:42 +0000 (17:04 +0000)]
[Modules] Don't infinite recurse  on implicit import of circular modules in preamble

Update the Preprocessor's VisibleModuleSet when typo-correction creates
an implicit module import so that we won't accidentally write an invalid
SourceLocation into the preamble AST.  This would later lead to infinite
recursion when loading the preamble AST because we use the value in
ImportLocs to prevent visiting a module twice.

rdar://problem/24440990

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

8 years agoUse new --match-full-lines FileCheck feature for Preprocessor/init.c.
James Y Knight [Thu, 11 Feb 2016 16:51:29 +0000 (16:51 +0000)]
Use new --match-full-lines FileCheck feature for Preprocessor/init.c.

This required fixing a few check lines which had omitted trailing
characters, and were passing incorrectly (e.g., asserting that
__UINT64_C_SUFFIX__ is "UL" instead of the "ULL" that it actually is set
to). All were obviously broken tests, not broken code.

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

8 years agoRevert r260266 (and r260276), "clang-cl: Enable plugins on Windows"
NAKAMURA Takumi [Thu, 11 Feb 2016 16:43:08 +0000 (16:43 +0000)]
Revert r260266 (and r260276), "clang-cl: Enable plugins on Windows"

It doesn't work, at least, i686-win32.

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

8 years agoRevert r260265, "clang-cl: Support loading plugins on Windows"
NAKAMURA Takumi [Thu, 11 Feb 2016 16:33:20 +0000 (16:33 +0000)]
Revert r260265, "clang-cl: Support loading plugins on Windows"

It causes memory exhaust on mingw-w64(x64). Investigating.

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

8 years ago[ARM] Add command-line options for ARMv8.2-A
Oliver Stannard [Thu, 11 Feb 2016 16:05:52 +0000 (16:05 +0000)]
[ARM] Add command-line options for ARMv8.2-A

This allows ARMv8.2-A to be targeted either by using "armv8.2a" in the
triple, or by using -march=armv8.2-a (or the alias -march=armv8.2a).

The FP16 extension can be enabled with the "+fp16" suffix to the -march
or -mcpu option. This is consistent with the AArch64 option, rather than
the usual ARM option of -mfpu. We have agreed with the team which will
be upstreaming this to GCC that we want to use this new option format
for new architecture extensions for both ARM and AArch64.

Most of the work for this was done by the TargetParser patch in llvm.

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

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

8 years agoRevert "Bail on compilation as soon as a job fails."
Rafael Espindola [Thu, 11 Feb 2016 14:13:17 +0000 (14:13 +0000)]
Revert "Bail on compilation as soon as a job fails."

This reverts commit r260448.

It was causing Driver/output-file-cleanup.c to fail.

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

8 years agoPartial revert of rL260506.
Andrey Bokhanko [Thu, 11 Feb 2016 13:27:02 +0000 (13:27 +0000)]
Partial revert of rL260506.

After some experiments I discovered that clang doesn't support static
initialization of flexible array members in full, so restored this paragraph in
"GCC extensions not implemented yet" list.

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

8 years agoclang-format: [JS] Support for (.. of ..) loops.
Daniel Jasper [Thu, 11 Feb 2016 13:24:15 +0000 (13:24 +0000)]
clang-format: [JS] Support for (.. of ..) loops.

Before:
  for (var i of[2, 3]) {}

After:
  for (var i of [2, 3]) {}

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

8 years agoclang-format: Make indentation after "<<" more consistent.
Daniel Jasper [Thu, 11 Feb 2016 13:15:14 +0000 (13:15 +0000)]
clang-format: Make indentation after "<<" more consistent.

Before:
  Diag(aaaaaaaaaaaaaaaaaaaaaaaaaaaa)
      << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
  Diag(aaaaaaaaaaaaaaaaaaaaaaaaaaaa)
      << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
      << aaa;

After:
  Diag(aaaaaaaaaaaaaaaaaaaaaaaaaaaa)
      << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
  Diag(aaaaaaaaaaaaaaaaaaaaaaaaaaaa)
      << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
      << aaa;

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

8 years ago[MCU] Fix assertion failure on function returning empty union.
Denis Zobnin [Thu, 11 Feb 2016 11:26:03 +0000 (11:26 +0000)]
[MCU] Fix assertion failure on function returning empty union.

Treat empty struct/union in return type as void for MCU ABI. PR26438.

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

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

8 years agoUpdate of "GCC extensions not implemented yet" in Clang User's Manual
Andrey Bokhanko [Thu, 11 Feb 2016 10:36:06 +0000 (10:36 +0000)]
Update of "GCC extensions not implemented yet" in Clang User's Manual

#pragma weak, global register variables and static initialization of flexible
array members are supported now, so they are removed from "GCC extensions not
implemented yet" list.

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

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

8 years agoclang-format: Make it more expensive to break template parameters.
Daniel Jasper [Thu, 11 Feb 2016 06:43:01 +0000 (06:43 +0000)]
clang-format: Make it more expensive to break template parameters.

In particular, make it more expensive than breaking after the return
type of a function definition/declaration.

Before:
  template <typename T>
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaa<
      T>::aaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaa);

After:
  template <typename T>
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  aaaaaaaaaaaaaaaaaaaaaaa<T>::aaaaaaaaaaaaa(
      aaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaa);

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

8 years ago[Objective-c] Stop attaching section "datacoal_nt" to global variables.
Akira Hatanaka [Thu, 11 Feb 2016 06:36:35 +0000 (06:36 +0000)]
[Objective-c] Stop attaching section "datacoal_nt" to global variables.

The current macho linker just copies symbols in section datacoal_nt to
section data, so it doesn't really matter whether or not section
"datacoal_nt" is attached to the global variable.

This is a follow-up to r250370, which made changes in llvm to stop
putting functions and data in the *coal* sections.

rdar://problem/24528611

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

8 years ago[OPENMP] Rename OMPCapturedFieldDecl to OMPCapturedExprDecl, NFC.
Alexey Bataev [Thu, 11 Feb 2016 05:35:55 +0000 (05:35 +0000)]
[OPENMP] Rename OMPCapturedFieldDecl to OMPCapturedExprDecl, NFC.
OMPCapturedExprDecl allows caopturing not only of fielddecls, but also
other expressions. It also allows to simplify codegen for several
clauses.

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

8 years ago[CUDA] Don't crash when trying to printf a non-scalar object.
Justin Lebar [Thu, 11 Feb 2016 02:00:52 +0000 (02:00 +0000)]
[CUDA] Don't crash when trying to printf a non-scalar object.

Summary:
We can't do the right thing, since there's no right thing to do, but at
least we can not crash the compiler.

Reviewers: majnemer, rnk

Subscribers: cfe-commits, jhen, tra

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

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

8 years agoRemove unused ToolChain arg from Driver::ConstructPhaseAction and BuildAction.
Justin Lebar [Thu, 11 Feb 2016 02:00:50 +0000 (02:00 +0000)]
Remove unused ToolChain arg from Driver::ConstructPhaseAction and BuildAction.

Summary:
Actions don't depend on the toolchain; they get bound to a particular
toolchain via BindArch.

No functional changes.

Reviewers: echristo

Subscribers: cfe-commits

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

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

8 years agoFix two tests relying on LLVM -O1 behavior
Reid Kleckner [Thu, 11 Feb 2016 00:14:04 +0000 (00:14 +0000)]
Fix two tests relying on LLVM -O1 behavior

Something changed the inference of nonnull.

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

8 years agoRevert r260388 "[MS ABI] Never reference dllimport'd vtables"
Hans Wennborg [Wed, 10 Feb 2016 22:18:37 +0000 (22:18 +0000)]
Revert r260388 "[MS ABI] Never reference dllimport'd vtables"

This caused the compiler to fail with "invalid linkage type
for global declaration" (PR26569).

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

8 years agoBail on compilation as soon as a job fails.
Justin Lebar [Wed, 10 Feb 2016 22:17:00 +0000 (22:17 +0000)]
Bail on compilation as soon as a job fails.

Previously we attempted to be smart; if one job failed, we'd run all
jobs that didn't depend on the failing job.

Problem is, this doesn't work well for e.g. CUDA compilation without
-save-temps.  In this case, the device-side and host-side Assemble
actions (which actually are responsible for preprocess, compile,
backend, and assemble, since we're not saving temps) are necessarily
distinct.  So our clever heuristic doesn't help us, and we repeat every
error message once for host and once for each device arch.

The main effect of this change, other than fixing CUDA, is that if you
pass multiple cc files to one instance of clang and you get a compile
error, we'll stop when the first cc1 job fails.

Reviewers: tra, echristo

Subscribers: jhen, cfe-commits

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

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

8 years ago[clang-cl] /Z7 now generates normal debug info, not just line info
Reid Kleckner [Wed, 10 Feb 2016 21:28:38 +0000 (21:28 +0000)]
[clang-cl] /Z7 now generates normal debug info, not just line info

Previously LLVM could not process any debug info we produced, so it
didn't make sense to spend time generating it. Now that it has primitive
support for local variable info, it does make sense to generate normal
debug info.

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

8 years agoTest commit, fixed "clang" to "Clang" in docs
Mandeep Singh Grang [Wed, 10 Feb 2016 21:06:10 +0000 (21:06 +0000)]
Test commit, fixed "clang" to "Clang" in docs

Reviewers: weimingz

Subscribers: cfe-commits

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

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

8 years ago[analyzer] Windows: launch scan-build from an arbitrary location.
Anton Yartsev [Wed, 10 Feb 2016 19:46:41 +0000 (19:46 +0000)]
[analyzer] Windows: launch scan-build from an arbitrary location.

The following batch files allow to launch scan-build from an arbitrary location if path to clang\tools\scan-build-py\bin is added to %PATH%.

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

8 years agoFix some Clang-tidy readability-redundant-control-flow warnings; other minor fixes.
Eugene Zelenko [Wed, 10 Feb 2016 19:11:58 +0000 (19:11 +0000)]
Fix some Clang-tidy readability-redundant-control-flow warnings; other minor fixes.

Differential revision: http://reviews.llvm.org/D17060

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

8 years agoSilence some MSVC false positive warnings about integer zexts and falling off the...
Reid Kleckner [Wed, 10 Feb 2016 19:09:15 +0000 (19:09 +0000)]
Silence some MSVC false positive warnings about integer zexts and falling off the end of a covered switch

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

8 years ago[MS ABI] Never reference dllimport'd vtables
David Majnemer [Wed, 10 Feb 2016 17:40:47 +0000 (17:40 +0000)]
[MS ABI] Never reference dllimport'd vtables

Referencing a dllimported vtable is impossible in a constexpr
constructor.  It would be friendlier to C++ programmers if we
synthesized a copy of the vftable which referenced imported virtual
functions.  This would let us initialize the object in a way which
preserves both the intent to import functionality from another DLL while
also making constexpr work.

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

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

8 years agoReapply the patch of r260376.
Andrey Turetskiy [Wed, 10 Feb 2016 12:56:10 +0000 (12:56 +0000)]
Reapply the patch of r260376.

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

8 years agoclang-format sort include use the source file name to determine the
Daniel Jasper [Wed, 10 Feb 2016 12:42:58 +0000 (12:42 +0000)]
clang-format sort include use the source file name to determine the
"main include" that will be the 1st include (category 0).

Because the clang-format visual studio extension does not pass the file
name and use the standard input, sort include cannot find a "main
include":

Testing fix on llvm\tools\clang\lib\Format\Format.cpp:
Original file:
  #include "clang/Format/Format.h"
  ...
  #include "clang/Basic/SourceManager.h"
  #include "clang/Lex/Lexer.h"

Without fix, selecting the includes and running visual studio
clang-format:
  ...
  #include "clang/Basic/SourceManager.h"
  #include "clang/Format/Format.h"
  #include "clang/Lex/Lexer.h"

With fix, selecting the includes and running visual studio clang-format:
  #include "clang/Format/Format.h"
  ...
  #include "clang/Basic/SourceManager.h"
  #include "clang/Lex/Lexer.h"

Test 2 with main header not at the start:
Original file:
  ...
  #include "clang/Format/Format.h"
  #include "clang/Basic/SourceManager.h"
  #include "clang/Lex/Lexer.h"

Without fix, selecting the includes and running visual studio
clang-format:
  ...
  #include "clang/Basic/SourceManager.h"
  #include "clang/Format/Format.h"
  #include "clang/Lex/Lexer.h"

With fix, selecting the includes and running visual studio clang-format:
  #include "clang/Format/Format.h"
  ...
  #include "clang/Basic/SourceManager.h"
  #include "clang/Lex/Lexer.h"

Patch by Jean-Philippe Dufraigne, thank you.
Review: http://reviews.llvm.org/D16524

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

8 years ago[X86] Fix stack alignment for MCU target (Clang part), by Anton Nadolskiy.
Andrey Turetskiy [Wed, 10 Feb 2016 11:58:46 +0000 (11:58 +0000)]
[X86] Fix stack alignment for MCU target (Clang part), by Anton Nadolskiy.

This patch fixes stack alignments for MCU (should be aligned to 4 bytes).

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

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

8 years ago[OPENMP 4.5] Initial support for data members in 'firstprivate' clause.
Alexey Bataev [Wed, 10 Feb 2016 11:29:16 +0000 (11:29 +0000)]
[OPENMP 4.5] Initial support for data members in 'firstprivate' clause.
OpenMP 4.5 allows privatization of non-static data members of current
class in non-static member functions.

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

8 years agoFix assertion "Chunk.Kind == DeclaratorChunk::Function" with attributed type.
Denis Zobnin [Wed, 10 Feb 2016 11:23:48 +0000 (11:23 +0000)]
Fix assertion "Chunk.Kind == DeclaratorChunk::Function" with attributed type.

This patch is to upgrade FunctionTypeUnwrapper for correct processing of
AttributedType. Fixes PR25786.
Patch by Alexander Makarov.

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

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

8 years agoFix PR26543: add a check for definition in CXXRecordDecl.
Alexey Bataev [Wed, 10 Feb 2016 10:50:12 +0000 (10:50 +0000)]
Fix PR26543: add a check for definition in CXXRecordDecl.

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

8 years ago[Sema] Issue a warning for integer overflow in nested struct initializer
Akira Hatanaka [Wed, 10 Feb 2016 06:06:06 +0000 (06:06 +0000)]
[Sema] Issue a warning for integer overflow in nested struct initializer

r257357 fixed clang to warn on integer overflow in struct initializers.
However, it didn't warn when a struct had a nested initializer. This
commit makes changes in Sema::CheckForIntOverflow to handle nested
initializers.

For example:

struct s {
  struct t {
    unsigned x;
  } t;
} s = {
  {
    .x = 4 * 1024 * 1024 * 1024
  }
};

rdar://problem/23526454

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

8 years ago[CMake] For multi-stage builds to be deterministic we need to disable timestamps.
Chris Bieneman [Wed, 10 Feb 2016 02:17:21 +0000 (02:17 +0000)]
[CMake] For multi-stage builds to be deterministic we need to disable timestamps.

Duh! With this change I've verified -O3 builds are deterministic.

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

8 years agoGet rid of another SAME-NOT. FileCheck does not have this suffix.
Paul Robinson [Wed, 10 Feb 2016 02:08:24 +0000 (02:08 +0000)]
Get rid of another SAME-NOT. FileCheck does not have this suffix.

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

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

8 years agoclang/test/Index/skip-parsed-bodies/compile_commands.json: Appease targeting msvc.
NAKAMURA Takumi [Wed, 10 Feb 2016 01:45:51 +0000 (01:45 +0000)]
clang/test/Index/skip-parsed-bodies/compile_commands.json: Appease targeting msvc.

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

8 years agoRemove some unnecessary CHECK-SAMEs in ModuleDebugInfo.{cpp,m}.
Justin Lebar [Wed, 10 Feb 2016 01:34:17 +0000 (01:34 +0000)]
Remove some unnecessary CHECK-SAMEs in ModuleDebugInfo.{cpp,m}.

Suggested by Paul Robinson.

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

8 years agolibclang: Enable skip-parsed-bodies on win32.
NAKAMURA Takumi [Wed, 10 Feb 2016 01:29:57 +0000 (01:29 +0000)]
libclang: Enable skip-parsed-bodies on win32.

I guess it would be working since Rafael's r187619.

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

8 years ago[CMake] Pass LLVM_EXTERNAL_*_SOURCE_DIR variables to subsequent stages
Chris Bieneman [Wed, 10 Feb 2016 01:09:59 +0000 (01:09 +0000)]
[CMake] Pass LLVM_EXTERNAL_*_SOURCE_DIR variables to subsequent stages

For multi-stage builds we need to pass any overridden source directory variables. Without passing these the subsequent stages won't find the project sources.

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

8 years ago[CMake] Fixing the 3-stage cmake cache.
Chris Bieneman [Wed, 10 Feb 2016 01:09:56 +0000 (01:09 +0000)]
[CMake] Fixing the 3-stage cmake cache.

I had hoped this would work from a single cache file, but turns out there is a bug I can't quite figure out relating to passing list arguments to recursive CMake invocations.

This change works around that.

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

8 years agoGet rid of CHECK-SAME-NOT in tests.
Justin Lebar [Wed, 10 Feb 2016 00:38:15 +0000 (00:38 +0000)]
Get rid of CHECK-SAME-NOT in tests.

Summary: This isn't a FileCheck directive; it does nothing.

Reviewers: jroelofs

Subscribers: cfe-commits, majnemer

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

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

8 years agoThis patch adds doxygen comments for all the intrinsincs in the header file f16cintri...
Ekaterina Romanova [Wed, 10 Feb 2016 00:12:24 +0000 (00:12 +0000)]
This patch adds doxygen comments for all the intrinsincs in the header file f16cintrin.h. The doxygen comments are automatically generated based on Sony's intrinsics document.

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

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

8 years agoUpdate documentation to reflect that libc++abi provides __cxa_thread_atexit (and...
Richard Smith [Tue, 9 Feb 2016 22:48:14 +0000 (22:48 +0000)]
Update documentation to reflect that libc++abi provides __cxa_thread_atexit (and has for quite a while). Also document that we have not yet implemented the new inheriting constructor rules.

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

8 years agoPR26349: correctly check whether a digit sequence is empty in the presence of digit...
Richard Smith [Tue, 9 Feb 2016 22:34:35 +0000 (22:34 +0000)]
PR26349: correctly check whether a digit sequence is empty in the presence of digit separators.

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