Граф коммитов

61275 Коммитов

Автор SHA1 Сообщение Дата
Argyrios Kyrtzidis 5528df3a47 [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
2016-02-13 05:17:15 +00:00
NAKAMURA Takumi 3f10def1e4 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
2016-02-13 04:01:49 +00:00
Steven Watanabe 67be982a79 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
2016-02-13 02:31:28 +00:00
Sunil Srivastava 49fb6c058c 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
2016-02-13 01:44:05 +00:00
Bob Wilson e63212a9d9 [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
2016-02-13 01:41:41 +00:00
Argyrios Kyrtzidis fe6dce9307 [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
2016-02-13 01:24:19 +00:00
Matt Arsenault 129719e629 AMDGPU: Add sin/cos builtins
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260783 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 01:21:09 +00:00
Matt Arsenault edd9756780 AMDGPU: Update builtin for intrinsic change
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260781 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 01:03:09 +00:00
Alexey Samsonov 8dbc4433b0 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
2016-02-13 01:02:59 +00:00
Richard Trieu b29394d660 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
2016-02-13 00:58:53 +00:00
Argyrios Kyrtzidis a04f05c81a [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
2016-02-12 23:30:07 +00:00
Argyrios Kyrtzidis 754b721c20 [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
2016-02-12 23:10:59 +00:00
Eugene Zelenko 24d973f5ae 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
2016-02-12 22:53:10 +00:00
Tim Northover 4089703402 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
2016-02-12 22:30:42 +00:00
Chris Bieneman 83d9cb8676 [CMake] Fixing bots I broke.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260744 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-12 21:46:25 +00:00
Chris Bieneman cff69f62d5 [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
2016-02-12 21:36:55 +00:00
Artem Belevich 5c41d3a5f8 Added missing '__'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260719 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-12 20:26:43 +00:00
Hubert Tong 70692f3f2f 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
2016-02-12 19:24:36 +00:00
David Majnemer 2460355769 [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
2016-02-12 19:21:02 +00:00
Chris Bieneman a8c2c99ef0 [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
2016-02-12 19:06:12 +00:00
Artem Belevich 2721c4d781 [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
2016-02-12 18:29:18 +00:00
Krzysztof Parzyszek 8148f06ebc [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
2016-02-12 14:48:34 +00:00
Olivier Goffart 26f6c2fd8a 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
2016-02-12 12:34:44 +00:00
Anastasia Stulova 87f6500b32 [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
2016-02-12 12:07:04 +00:00
Jonas Hahnfeld 1b363a46f7 [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
2016-02-12 07:48:37 +00:00
Jonas Hahnfeld 4773245d34 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
2016-02-12 07:48:28 +00:00
Eric Christopher 58e445a784 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
2016-02-12 02:22:53 +00:00
Richard Smith d14e35f115 <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
2016-02-12 01:15:33 +00:00
Hans Wennborg 25e062e55e UsersManual: update clang-cl commands
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260637 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-12 01:01:37 +00:00
Eric Christopher fa880b88b8 Use __ before argument names in provided headers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260631 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-12 00:32:23 +00:00
Mike Aizatsky a6d5566f86 [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
2016-02-12 00:29:45 +00:00
Joerg Sonnenberger f47b5f09bf 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
2016-02-11 23:35:03 +00:00
Joerg Sonnenberger 286b035690 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
2016-02-11 23:18:36 +00:00
Richard Smith 406deaced8 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
2016-02-11 22:18:10 +00:00
Devin Coughlin 6df7834ea1 [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
2016-02-11 22:13:20 +00:00
Tim Northover c8288db409 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
2016-02-11 21:31:51 +00:00
Richard Smith e1a89b0641 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
2016-02-11 20:36:47 +00:00
Carlo Bertolli d87df6d5ae 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
2016-02-11 20:12:28 +00:00
Richard Smith f6efc8c100 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
2016-02-11 19:57:37 +00:00
Manman Ren d32c1ae25a [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
2016-02-11 19:19:18 +00:00
Ben Langmuir 0a88921083 [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
2016-02-11 18:54:02 +00:00
Chad Rosier d0f4542438 [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
2016-02-11 18:09:31 +00:00
David Majnemer f76084e5c9 Remove unused includes
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260552 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-11 17:54:39 +00:00
David Majnemer ce1b4d57a6 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
2016-02-11 17:49:28 +00:00
Ben Langmuir 0ebc3ae333 [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
2016-02-11 17:04:42 +00:00
James Y Knight bad77a8763 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
2016-02-11 16:51:29 +00:00
NAKAMURA Takumi 73d5bb8e3a 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
2016-02-11 16:43:08 +00:00
NAKAMURA Takumi 7eba45f7ef 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
2016-02-11 16:33:20 +00:00
Oliver Stannard aba1af8a47 [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
2016-02-11 16:05:52 +00:00
Rafael Espindola 85d2dfdffd 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
2016-02-11 14:13:17 +00:00