summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* [Headers] Replace stray indentation with tabs with spaces. NFC.Martin Storsjo2016-09-281-9/+9
| | | | | | This matches the rest of the surrounding file. llvm-svn: 282569
* Revert r282556. This change made several bots unhappy.Richard Smith2016-09-285-58/+20
| | | | llvm-svn: 282564
* P0145R3 (C++17 evaluation order tweaks): evaluate the right-hand side ofRichard Smith2016-09-275-20/+58
| | | | | | | | | | | | | assignment and compound-assignment operators before the left-hand side. (Even if it's an overloaded operator.) This completes the implementation of P0145R3 + P0400R0 for all targets except Windows, where the evaluation order guarantees for <<, >>, and ->* are unimplementable as the ABI requires the function arguments are evaluated from right to left (because parameter destructors are run from left to right in the callee). llvm-svn: 282556
* Revert r282547 and add test to show correct behavior.Richard Trieu2016-09-271-2/+6
| | | | llvm-svn: 282555
* [Coverage] The coverage region for switch covers the code after the switch.Alex Lorenz2016-09-271-1/+5
| | | | | | | | | | | | | | This patch fixes a regression introduced in r262697 that changed the way the coverage regions for switches are constructed. The PGO instrumentation counter for a switch statement refers to the counter at the exit of the switch. Therefore, the coverage region for the switch statement should cover the code that comes after the switch, and not the switch statement itself. rdar://28480997 Differential Revision: https://reviews.llvm.org/D24981 llvm-svn: 282554
* Fix defaulted member functions for templated classes.Richard Trieu2016-09-271-6/+2
| | | | | | | | | | In some cases, non-special member functions were being marked as being defaulted in templated classes. This can cause interactions with later code that expects the default function to be one of the specific member functions. Fix the check so that templated class members are checked the same way as non-templated class members are. llvm-svn: 282547
* Shorten DiagnosticInfoOptimizationRemark* to OptimizationRemark*. NFCAdam Nemet2016-09-271-21/+15
| | | | | | | With the new streaming interface in LLVM, these class names need to be typed a lot and it's way too looong. llvm-svn: 282545
* Adapt to LLVM optimization remark interface change. NFCAdam Nemet2016-09-271-1/+1
| | | | llvm-svn: 282540
* Adapt to LLVM EnableStatistics() change.Matthias Braun2016-09-272-2/+2
| | | | llvm-svn: 282533
* Revert "Adapt to LLVM optimization remark interface change. NFC"Adam Nemet2016-09-271-1/+1
| | | | | | This reverts commit r282500. llvm-svn: 282504
* Adapt to LLVM optimization remark interface change. NFCAdam Nemet2016-09-271-1/+1
| | | | llvm-svn: 282500
* Update to commit r282488, fix the buildboot failure.Ayman Musa2016-09-271-2/+2
| | | | llvm-svn: 282492
* [avx512] Add aliases to some missing avx512 intrinsics.Ayman Musa2016-09-271-2/+134
| | | | | | Differential Revision:https: //reviews.llvm.org/D24961 llvm-svn: 282488
* [Power9] Builtins for ELF v.2 ABI conformance - front end portionNemanja Ivanovic2016-09-273-9/+629
| | | | | | | | | | This patch corresponds to review: https://reviews.llvm.org/D24397 It adds the __POWER9_VECTOR__ macro and the -mpower9-vector option along with a number of altivec.h functions (refer to the code review for a list). llvm-svn: 282481
* Remove default argument from lambda to appease old MSVC.Richard Smith2016-09-271-1/+1
| | | | llvm-svn: 282464
* P0145R3 (C++17 evaluation order tweaks): evaluate the base expression beforeRichard Smith2016-09-261-3/+3
| | | | | | the pointer-to-member expression in calls through .* and ->* expressions. llvm-svn: 282457
* P0145R3 (C++17 evaluation order tweaks): consistently emit the LHS of arrayRichard Smith2016-09-261-15/+35
| | | | | | | subscripting before the RHS, regardless of which is the base and which is the index. llvm-svn: 282453
* [clang-format] Don't allow newline after uppercase Obj-C block return typesDaniel Jasper2016-09-261-6/+11
| | | | | | | | | | | | | | Fixes the following: BOOL (^aaa)(void) = ^BOOL { }; The first BOOL's token was getting set to TT_FunctionAnnotationRParen incorrectly, which was causing an unexpected newline after (^aaa). This was introduced in r245846. Patch by Kent Sutherland, thank you! llvm-svn: 282448
* headers: add missing Windows ARM Interlocked intrinsicsSaleem Abdulrasool2016-09-261-0/+474
| | | | | | | | | | | | | | On ARM, there are multiple versions of each of the intrinsics, with acquire/relaxed/release barrier semantics. The newly added ones are provided as inline functions here instead of builtins, since they should only be available on certain archs (arm/aarch64). This is necessary in order to compile C++ code for ARM in MSVC mode. Patch by Martin Storsjö! llvm-svn: 282447
* [Modules TS] Diagnose 'export' declaration within 'export' declaration.Richard Smith2016-09-262-2/+21
| | | | llvm-svn: 282443
* CC1: Add -save-stats optionMatthias Braun2016-09-264-5/+50
| | | | | | | | | This option behaves in a similar spirit as -save-temps and writes internal llvm statistics in json format to a file. Differential Revision: https://reviews.llvm.org/D24820 llvm-svn: 282426
* Complete support for the cxxCtorInitializer() AST matcher so that it can be ↵Aaron Ballman2016-09-261-0/+38
| | | | | | used as a top-level matcher. llvm-svn: 282417
* [analyzer] Improve CastToStruct checker so it can also detect widening casts ↵Daniel Marjamaki2016-09-261-22/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | of struct data Example: struct AB { int A; int B; }; struct ABC { int A; int B; int C; }; void f() { struct AB Data; struct ABC *P = (struct ABC *)&Data; } Differential Revision: https://reviews.llvm.org/D23508 llvm-svn: 282411
* clang-format: Only special-case top-level */& in multivar-declstmts.Daniel Jasper2016-09-261-1/+1
| | | | | | | | | | Before (even with PointerAlignment: Left): vector<int *> a, b; After: vector<int*> a, b; llvm-svn: 282410
* Driver: avoid failing in the backendSaleem Abdulrasool2016-09-261-3/+8
| | | | | | | | Avoid failing in the backend when the rewrite map does not exist. Rather check that the map exists in the frontend before handing it off to the backend. Add the missing rewrite maps that the tests were referencing. llvm-svn: 282379
* [AMDGPU] Expose flat work group size, register and wave control attributesKonstantin Zhuravlyov2016-09-262-26/+126
| | | | | | | | | __attribute__((amdgpu_flat_work_group_size(<min>, <max>))) - request minimum and maximum flat work group size __attribute__((amdgpu_waves_per_eu(<min>[, <max>]))) - request minimum and/or maximum waves per execution unit Differential Revision: https://reviews.llvm.org/D24513 llvm-svn: 282371
* Remove excessive padding from RedeclarableResultAlexander Shaposhnikov2016-09-241-7/+8
| | | | | | | | | | | This diff reorders the fields of the class RedeclarableResult to remove excessive padding. Test plan: make -j8 check-clang Differential revision: https://reviews.llvm.org/D24754 llvm-svn: 282322
* Remove excessive padding from ObjCCategoriesVisitorAlexander Shaposhnikov2016-09-241-8/+8
| | | | | | | | | | | This diff reorders the fields of ObjCCategoriesVisitor to remove excessive padding. Test plan: make -j8 check-clang Differential revision: https://reviews.llvm.org/D24753 llvm-svn: 282318
* Use llvm::to_string instead of std::to_string to fix botTeresa Johnson2016-09-231-2/+3
| | | | | | | This should fix the android build in this bot: http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-buildserver/builds/11143 llvm-svn: 282308
* Update clang for r282299.Peter Collingbourne2016-09-231-17/+3
| | | | llvm-svn: 282301
* [analyzer] Fix crash in RetainCountChecker::checkEndFunctionAlexander Shaposhnikov2016-09-232-3/+7
| | | | | | | | | | | | | | | | | The class BodyFarm creates bodies for OSAtomicCompareAndSwap*, objc_atomicCompareAndSwap*, dispatch_sync*, dispatch_once* and for them the flag isBodyAutosynthesized is set to true. This diff 1. makes AnalysisConsumer::HandleCode skip the autosynthesized code 2. replaces assert(LCtx->getParent()) in RetainCountChecker::checkEndFunction by assert(!LCtx->inTopFrame()) (minor cleanup) Test plan: make -j8 check-clang-analysis Differential revision: https://reviews.llvm.org/D24792 llvm-svn: 282293
* [LTO] Add -flto-jobs=N to control backend parallelismTeresa Johnson2016-09-231-4/+26
| | | | | | | | | | | | | | | | | | | | Summary: Currently, a linker option must be used to control the backend parallelism of ThinLTO. The linker option varies depending on the linker (e.g. gold vs ld64). Add a new clang option -flto-jobs=N to control this. I've added in the wiring to pass this to the gold plugin. I also added in the logic to pass this down in the form I understand that ld64 uses on MacOS, for the darwin target. Reviewers: mehdi_amini, dexonsmith Subscribers: mehdi_amini, cfe-commits Differential Revision: https://reviews.llvm.org/D24826 llvm-svn: 282291
* Revert "set the underlying value of “#pragma STDC FP_CONTRACT” on by ↵Renato Golin2016-09-231-6/+0
| | | | | | | | default" This reverts commit r282259, as it broke the AArch64 test-suite bots. llvm-svn: 282289
* set the underlying value of “#pragma STDC FP_CONTRACT” on by defaultSebastian Pop2016-09-231-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clang has the default FP contraction setting of “-ffp-contract=on”, which doesn't really mean “on” in the conventional sense of the word, but rather really means “according to the per-statement effective value of the relevant pragma”. Before this patch, Clang has that pragma defaulting to “off”. Since the “-ffp-contract=on” mode is really an AND of two booleans and the second of them defaults to “off”, the whole thing effectively defaults to “off”. This patch changes the default value of the pragma to “on”, thus making the default pair of booleans (on, on) rather than (on, off). This makes FP optimization slightly more aggressive than before when not using either “-Ofast”, “-ffast-math”, or “-ffp-contract=fast”. Even with this patch the compiler still respects “-ffp-contract=off”. As per a suggestion by Steve Canon, the added code does _not_ require “-O3” or higher. This is so as to try our best to preserve identical floating-point results for unchanged source code compiling for an unchanged target when only changing from any optimization level in the set (“-O0”, “-O1”, “-O2”, “-O3”) to any other optimization level in that set. “-Os” and “-Oz” seem to be behaving identically, i.e. should probably be considered a part of the aforementioned set, but I have not reviewed this rigorously. “-Ofast” is explicitly _not_ a member of that set. Patch authored by Abe Skolnik [a.skolnik@samsung.com] and Stephen Canon [scanon@apple.com]. Differential Revision: https://reviews.llvm.org/D24481 llvm-svn: 282259
* Revert of r282255 because of "Fell off the end of a string-switch" buildbotSjoerd Meijer2016-09-231-7/+0
| | | | | | failures. llvm-svn: 282257
* Fix for r280064 that added options for fp denormals and exceptions.Sjoerd Meijer2016-09-231-0/+7
| | | | | | These options were forgotten to be copied in setCommandLineOpts. llvm-svn: 282255
* [clang-format] support header deletion in cleanupAroundReplacemnts.Eric Liu2016-09-231-2/+29
| | | | | | | | | | | | | | | | | | Summary: - If a replacement has offset UINT_MAX, length 0, and a replacement text that is an #include directive, this will insert the #include into the correct block in the \p Code. - If a replacement has offset UINT_MAX, length 1, and a replacement text that is the name of the header to be removed, the header will be removed from \p Code if it exists. Reviewers: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D24829 llvm-svn: 282253
* [OpenCL] Augment pipe built-ins with pipe packet size and alignment.Alexey Bader2016-09-233-13/+59
| | | | | | | | | | Reviewers: Anastasia, vpykhtin Subscribers: dmitry, cfe-commits Differential Revision: https://reviews.llvm.org/D23992 llvm-svn: 282252
* [asan] Fix incorrect SEH symbol mangling on win64.Etienne Bergeron2016-09-231-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The ASAN unittests are failing (check-asan-dynamic) due to an incorrect symbol name: ``` LINK : error LNK2001: unresolved external symbol ___asan_seh_interceptor ``` On win64, the linker is not adding an extra underscore. This was correctly fixed in the same file for other uses. After that patch, most of the unittests are passing, but some related to SEH needs to be fixed. ``` Failing Tests (4): AddressSanitizer-x86_64-windows-dynamic :: TestCases/Windows/dll_intercept_memchr.cc AddressSanitizer-x86_64-windows-dynamic :: TestCases/Windows/dll_intercept_memcpy_indirect.cc AddressSanitizer-x86_64-windows-dynamic :: TestCases/Windows/dll_seh.cc AddressSanitizer-x86_64-windows-dynamic :: TestCases/Windows/seh.cc Expected Passes : 339 Passes With Retry : 3 Expected Failures : 16 Unsupported Tests : 152 Unexpected Failures: 4 ``` Reviewers: rnk, kcc, majnemer Subscribers: majnemer, chrisha, cfe-commits Differential Revision: https://reviews.llvm.org/D24841 llvm-svn: 282251
* Minor tweak. Avoid hardcoding.Daniel Marjamaki2016-09-231-1/+1
| | | | llvm-svn: 282242
* [AVX-512] Add initial support for checking rounding mode arguments of builtins.Craig Topper2016-09-231-0/+100
| | | | | | | | The backend can't encode all possible values of the argument and will fail isel. Checking in the frontend presents a friendlier experience to the user. I started with builtins that can only take _MM_CUR_DIRECTION or _MM_NO_EXC. More builtins coming in the future. llvm-svn: 282228
* [X86] Split up the single switch statement in ↵Craig Topper2016-09-231-15/+27
| | | | | | | | Sema::CheckX86BuiltinFunctionCall into different switches or ifs for each type of check. This in preparation for a new check that will check some of the builtins that already had the immediate range check. llvm-svn: 282227
* [OpenBSD] Add type sign information for OpenBSDRenato Golin2016-09-221-1/+5
| | | | | | | | | | | | | | Like NetBSD, OpenBSD prefers having a consistent set of typedefs across the architectures it supports over strictly following the ARM ABIs. The diff below makes sure that clang's view of those types matches OpenBSD's system header files. It also adds a test that checks the relevant types on all OpenBSD platforms that clang works on. Hopefully we can add mips64 and powerpc to that list in the future. Patch by Mark Kettenis <mark.kettenis@xs4all.nl> llvm-svn: 282184
* Fix Wbitfield-constant-conversion false positivesDaniel Marjamaki2016-09-221-4/+3
| | | | | | | | | Summary: The diagnostic did not handle ~ well. An expression such as ~0 is often used when 'all ones' is needed. Differential Revision: https://reviews.llvm.org/D24232 llvm-svn: 282156
* clang-format: [JS] reserved words in method names.Martin Probst2016-09-221-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Before: class X { delete () { ... } } After: class X { delete() { ... } } Reviewers: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D24804 llvm-svn: 282138
* [Sema] Fix PR30481: crash on checking printf args.George Burgess IV2016-09-221-2/+2
| | | | | | | We were falling through from one case to another in a switch statement. Oops. llvm-svn: 282124
* PR30401: Fix substitutions for functions with abi_tagDmitry Polukhin2016-09-211-2/+18
| | | | llvm-svn: 282059
* clang-format: [JS] do not wrapp @returns tags.Martin Probst2016-09-211-1/+2
| | | | | | | | | | | | Summary: @returns is incorrect code, the standard is @return. However wrapping it can still confuse users. Reviewers: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D24767 llvm-svn: 282056
* [analyzer] Add a checker that detects blocks in critical sectionsAnna Zaks2016-09-202-0/+110
| | | | | | | | | | | | | | | | | | | | | | | | | This checker should find the calls to blocking functions (for example: sleep, getc, fgets,read,recv etc.) inside a critical section. When sleep(x) is called while a mutex is held, other threads cannot lock the same mutex. This might take some time, leading to bad performance or even deadlock. Example: mutex_t m; void f() { sleep(1000); // Error: sleep() while m is locked! [f() is called from foobar() while m is locked] // do some work } void foobar() { lock(m); f(); unlock(m); } A patch by zdtorok (Zoltán Dániel Török)! Differential Revision: https://reviews.llvm.org/D21506 llvm-svn: 282011
* Remove some boilerplate comments that don't explain anything.Eric Christopher2016-09-201-4/+0
| | | | llvm-svn: 282007
OpenPOWER on IntegriCloud