summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Accept "-Weverything" in clang diagnistic pragmasSunil Srivastava2016-02-134-4/+81
| | | | | | Differential Revision: http://reviews.llvm.org/D15095 llvm-svn: 260788
* [Sema] More changes to fix Objective-C fallout from r249995.Bob Wilson2016-02-134-39/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 260787
* [RecursiveASTVisitor] Introduce dataTraverseStmtPre()/dataTraverseStmtPost() ↵Argyrios Kyrtzidis2016-02-132-4/+23
| | | | | | | | 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. llvm-svn: 260785
* AMDGPU: Add sin/cos builtinsMatt Arsenault2016-02-133-0/+30
| | | | llvm-svn: 260783
* AMDGPU: Update builtin for intrinsic changeMatt Arsenault2016-02-133-13/+13
| | | | llvm-svn: 260781
* Disable two tests that use a lot of stack under ASan.Alexey Samsonov2016-02-132-4/+4
| | | | llvm-svn: 260779
* Make -Wnull-conversion more useful.Richard Trieu2016-02-132-7/+56
| | | | | | | | | | 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. llvm-svn: 260776
* [index] Add llvm/Support/DataTypes.h header to fix build failures in the bots.Argyrios Kyrtzidis2016-02-121-0/+1
| | | | llvm-svn: 260762
* [libclang] Separate the underlying indexing functionality of libclang and ↵Argyrios Kyrtzidis2016-02-1216-694/+2023
| | | | | | | | 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. llvm-svn: 260760
* Fix remaining Clang-tidy readability-redundant-control-flow warnings; other ↵Eugene Zelenko2016-02-1214-213/+110
| | | | | | | | minor fixes. Differential revision: http://reviews.llvm.org/D17218 llvm-svn: 260757
* Darwin: pass -stdlib=libc++ down to cc1 whenever we're targeting libc++Tim Northover2016-02-122-0/+22
| | | | | | | Recent refactoring meant it only got passed down when explicitly specified, which breaks header search on Darwin. llvm-svn: 260755
* [CMake] Fixing bots I broke.Chris Bieneman2016-02-121-1/+1
| | | | llvm-svn: 260744
* [CMake] Improve the clang order-file generation workflowChris Bieneman2016-02-123-11/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 260742
* Added missing '__'.Artem Belevich2016-02-121-1/+1
| | | | llvm-svn: 260719
* test/Headers/float.c: fix theoretical edge valuesHubert Tong2016-02-121-11/+11
| | | | | | | | | | 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! llvm-svn: 260710
* [AST] Fix typos in RecordLayoutBuilderDavid Majnemer2016-02-121-5/+5
| | | | | | No functional change is intended. llvm-svn: 260709
* [CMake] Pass stage1 tools through to stage2 when building with LTOChris Bieneman2016-02-121-2/+6
| | | | | | This was originally a hacky if(APPLE) block. Now that we have an option for enabling LTO, it is better to properly gate this. llvm-svn: 260707
* [CUDA] Tweak attribute-based overload resolution to match nvcc behavior.Artem Belevich2016-02-125-96/+207
| | | | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 260697
* [Hexagon] Specify vector alignment in DataLayout stringKrzysztof Parzyszek2016-02-122-4/+7
| | | | | | | | | | | 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. llvm-svn: 260680
* Fix ICE with constexpr and friend functionsOlivier Goffart2016-02-122-7/+19
| | | | | | | | | | | | | 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 llvm-svn: 260675
* [OpenCL] Disable C99 standard lib functionsAnastasia Stulova2016-02-122-1/+18
| | | | | | | | | | | | | | 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 llvm-svn: 260671
* [CMake] Add option to switch default C++ stdlibJonas Hahnfeld2016-02-127-29/+58
| | | | | | | | | 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 llvm-svn: 260662
* tests: Add explicit -stdlib=libstdc++ to tests that require itJonas Hahnfeld2016-02-1212-178/+180
| | | | | | | This will be needed for the next commit that allows to switch the default C++ library which would otherwise make these tests fail. llvm-svn: 260661
* Update functions in clang supplied headers to use the compiler reservedEric Christopher2016-02-127-262/+280
| | | | | | namespace for arguments. llvm-svn: 260647
* <float.h>: do not define DECIMAL_DIG in -std=c89 mode; this macro was added ↵Richard Smith2016-02-122-8/+26
| | | | | | | | in C99. Patch by Jorge Teixeira! llvm-svn: 260639
* UsersManual: update clang-cl commandsHans Wennborg2016-02-121-5/+7
| | | | llvm-svn: 260637
* Use __ before argument names in provided headers.Eric Christopher2016-02-121-4/+4
| | | | llvm-svn: 260631
* [sancov] improved object files handling.Mike Aizatsky2016-02-121-4/+5
| | | | | | | | Documentation change for: http://reviews.llvm.org/D17169 Differential Revision: http://reviews.llvm.org/D17175 llvm-svn: 260630
* Remove decision logic for old NetBSD development versions, the 7.0Joerg Sonnenberger2016-02-112-2/+2
| | | | | | release made this obsolete. llvm-svn: 260617
* Now that Sparc/Sparc64 backend is mostly usable, provide the sameJoerg Sonnenberger2016-02-114-28/+137
| | | | | | | linking defaults as other NetBSD targets, i.e. compiler_rt-in-libc and libc++ as STL. llvm-svn: 260616
* Remove bogus check that larger floating point types have smaller minimumRichard Smith2016-02-111-8/+0
| | | | | | normalized exponents. That's not true for double versus double double. llvm-svn: 260610
* [analyzer] Improve pattern matching in ObjCDealloc checker.Devin Coughlin2016-02-113-8/+86
| | | | | | | | 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. llvm-svn: 260608
* Relax recently added clang version checks.Tim Northover2016-02-111-11/+11
| | | | | | | 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). llvm-svn: 260596
* XFAIL this test for PPC64 for now. It looks like the *_MIN_EXP macros are in ↵Richard Smith2016-02-111-0/+2
| | | | | | fact defined incorrectly for that target. llvm-svn: 260583
* Add parse+sema and regression test for OpenMP firstprivate clause of target ↵Carlo Bertolli2016-02-112-0/+197
| | | | | | directive llvm-svn: 260581
* In C11, provide macros FLT_DECIMAL_DIG, DBL_DECIMAL_DIG, and ↵Richard Smith2016-02-112-0/+217
| | | | | | | | LDBL_DECIMAL_DIG in <float.h>. Patch by Jorge Teixeira! llvm-svn: 260577
* [PR26550] Use a different TBAA root for C++ vs C.Manman Ren2016-02-114-5/+9
| | | | | | | | | | | | | | | | | | | 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. llvm-svn: 260567
* [Modules] Early-exit if ReadOptionsBlock fails to avoid crashingBen Langmuir2016-02-112-3/+10
| | | | | | | | | | | | | | | 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 llvm-svn: 260563
* [Driver] Add support for Qualcomm's Kryo CPU.Chad Rosier2016-02-114-1/+17
| | | | | | http://reviews.llvm.org/D17124 llvm-svn: 260555
* Remove unused includesDavid Majnemer2016-02-111-2/+0
| | | | llvm-svn: 260552
* Revert "Revert r260388 "[MS ABI] Never reference dllimport'd vtables""David Majnemer2016-02-118-17/+51
| | | | | | | | | | | | | 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. llvm-svn: 260548
* [Modules] Don't infinite recurse on implicit import of circular modules in ↵Ben Langmuir2016-02-118-1/+34
| | | | | | | | | | | | | | 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 llvm-svn: 260543
* Use new --match-full-lines FileCheck feature for Preprocessor/init.c.James Y Knight2016-02-111-1008/+1008
| | | | | | | | | 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. llvm-svn: 260542
* Revert r260266 (and r260276), "clang-cl: Enable plugins on Windows"NAKAMURA Takumi2016-02-112-2/+1
| | | | | | It doesn't work, at least, i686-win32. llvm-svn: 260537
* Revert r260265, "clang-cl: Support loading plugins on Windows"NAKAMURA Takumi2016-02-113-13/+2
| | | | | | It causes memory exhaust on mingw-w64(x64). Investigating. llvm-svn: 260536
* [ARM] Add command-line options for ARMv8.2-AOliver Stannard2016-02-114-8/+55
| | | | | | | | | | | | | | | | | 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 llvm-svn: 260533
* Revert "Bail on compilation as soon as a job fails."Rafael Espindola2016-02-111-8/+30
| | | | | | | | This reverts commit r260448. It was causing Driver/output-file-cleanup.c to fail. llvm-svn: 260522
* Partial revert of rL260506.Andrey Bokhanko2016-02-111-0/+3
| | | | | | | | 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. llvm-svn: 260519
* clang-format: [JS] Support for (.. of ..) loops.Daniel Jasper2016-02-113-1/+6
| | | | | | | | | | Before: for (var i of[2, 3]) {} After: for (var i of [2, 3]) {} llvm-svn: 260518
* clang-format: Make indentation after "<<" more consistent.Daniel Jasper2016-02-112-3/+16
| | | | | | | | | | | | | | | | | | | | | | Before: Diag(aaaaaaaaaaaaaaaaaaaa, aaaaaaaa) << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa); Diag(aaaaaaaaaaaaaaaaaaaa, aaaaaaaa) << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) << aaa; After: Diag(aaaaaaaaaaaaaaaaaaaa, aaaaaaaa) << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa); Diag(aaaaaaaaaaaaaaaaaaaa, aaaaaaaa) << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) << aaa; llvm-svn: 260517
OpenPOWER on IntegriCloud