summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* [analyzer] Fix crash in RetainCountChecker::checkEndFunctionAlexander Shaposhnikov2016-09-233-5/+13
| | | | | | | | | | | | | | | | | 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-233-4/+42
| | | | | | | | | | | | | | | | | | | | 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-236-226/+13
| | | | | | | | 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-236-13/+226
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-233-6/+93
| | | | | | | | | | | | | | | | | | 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-235-33/+79
| | | | | | | | | | 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
* Fix indentationDaniel Marjamaki2016-09-231-1/+1
| | | | llvm-svn: 282233
* [AVX-512] Add initial support for checking rounding mode arguments of builtins.Craig Topper2016-09-234-0/+107
| | | | | | | | 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-222-1/+28
| | | | | | | | | | | | | | 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
* [docs] Touch up the coverage docs some moreVedant Kumar2016-09-221-22/+20
| | | | llvm-svn: 282169
* Fix Wbitfield-constant-conversion false positivesDaniel Marjamaki2016-09-222-6/+11
| | | | | | | | | 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
* Third attempt to fix Sphinx botTeresa Johnson2016-09-221-1/+1
| | | | | | | Bot now complaining about -flto=thin reference, used similar workaround for that failure. llvm-svn: 282154
* Second attempt to fix Sphinx botTeresa Johnson2016-09-221-1/+1
| | | | | | | | | | | | | | | The fix in r282148 was not enough to fix the following error: /home/llvmbb/llvm-build-dir/clang-sphinx-docs/llvm/src/tools/clang/docs/CommandGuide/clang.rst:338: WARNING: unknown option: -flto=full on the sphinx bot: http://lab.llvm.org:8011/builders/clang-sphinx-docs/builds/16313 (not reproducible locally). This time, simply remove the option reference. llvm-svn: 282151
* Fixing sphinx build due to diagnostic:Aaron Ballman2016-09-221-1/+1
| | | | | | /opt/llvm/build.attributes.src/tools/clang/docs/CommandGuide/clang.rst:338: WARNING: unknown option: -flto=full llvm-svn: 282148
* clang-format: [JS] reserved words in method names.Martin Probst2016-09-222-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* [X86] Fix some illegal rounding modes in some builtin test cases to ones ↵Craig Topper2016-09-224-46/+46
| | | | | | that would properly compile to valid assembly. llvm-svn: 282137
* clang-format: Add an option to git-clang-format to diff between to commitsStephen Hines2016-09-221-50/+97
| | | | | | | | | | | | | | | | | | | | | Summary: When building pre-upload hooks using git-clang-format, it is useful to limit the scope to a diff of two commits (instead of from a commit against the working tree) to allow for less false positives in dependent commits. This change adds the option of specifying two git commits to git-clang-format when using the `--diff` flag, which uses a different strategy to diff (using `git-diff-tree` instead of `git-diff-index`), and runs clang-format against the second commit instead of the working directory. There is a slight backwards-incompatibility introduced with this change: if a filename matches a branch name or other commit-ish, then `git clang-format <commit> <file>` will no longer work as expected; use `git clang-format <commit> -- <file>` instead. Patch by Luis Hector Chavez! Reviewers: djasper, lodato Subscribers: lodato, cfe-commits, srhines Projects: #clang-c Differential Revision: https://reviews.llvm.org/D24319 llvm-svn: 282136
* [CMake] More robust handling for bootstrap variablesChris Bieneman2016-09-221-1/+5
| | | | | | Checking defined isn't good enough we also need to handle defined to empty string. llvm-svn: 282125
* [Sema] Fix PR30481: crash on checking printf args.George Burgess IV2016-09-222-2/+7
| | | | | | | We were falling through from one case to another in a switch statement. Oops. llvm-svn: 282124
* [CMake] Check if passthrough variables are definedChris Bieneman2016-09-211-1/+1
| | | | | | Checking if they evaluate to true cases prevents passing values that evaluate to false cases. Instead we should check if the variables are defined. llvm-svn: 282122
* [CMake] Pass CLANG_VERSION_* variables into later stagesChris Bieneman2016-09-211-0/+3
| | | | | | When supporting overriding clang versions we also need to pass those through to the next stage so they remain overridden. llvm-svn: 282109
* Add -Wignored-pragma-intrinsic flagAlbert Gutowski2016-09-213-2/+15
| | | | | | | | | | | | Summary: People might want to receive warnings about pragmas but not about intrinsics that are implemented in intrin.h. Reviewers: thakis, hans Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D24775 llvm-svn: 282108
* [docs] Add ThinLTO user documentationTeresa Johnson2016-09-213-1/+165
| | | | | | | | | | | | Summary: Add some user facing documentation on ThinLTO and how to use it. Reviewers: mehdi_amini Subscribers: mehdi_amini, cfe-commits Differential Revision: https://reviews.llvm.org/D24806 llvm-svn: 282089
* [AVX512] Fix return types on __builtin_ia32_gather3XivXdi builtinsCameron McInally2016-09-211-4/+4
| | | | | | | | | | | | The return types on the AVX512 __builtin_ia32_gather3XivXdi builtins are incorrect. The return type should match the type of the pass through vector. Differential Revision: https://reviews.llvm.org/D24785 -This line, and those below, will be ignored-- M include/clang/Basic/BuiltinsX86.def llvm-svn: 282082
* PR30401: Fix substitutions for functions with abi_tagDmitry Polukhin2016-09-212-2/+34
| | | | 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-204-0/+164
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix a regex error breaking tests.Zachary Turner2016-09-201-1/+1
| | | | llvm-svn: 282004
* [CMake] Support overriding CLANG_VERSION_*Chris Bieneman2016-09-201-4/+10
| | | | | | | As with how we handle LLVM_VERSION_* variables we should support overriding clang version variables. llvm-svn: 282003
* Add some entropy to the folder name in Driver/warning-options.cpp.Zachary Turner2016-09-201-2/+2
| | | | | | | | | | It was trying to check that things behave correctly when a non-existant folder was specified for -isysroot. Incidentally, I have a folder named FOO in the root of my drive, so this test was failing. Make this impossible by using %T to refer to a definitely non-existant folder.: llvm-svn: 281998
* CodeGen: further merge cstring literal constructionSaleem Abdulrasool2016-09-202-14/+20
| | | | | | | | Use the new CreateCStringLiteral in an additional site. Now all the C string literals are created in one function. Furthermore, mark the additional literal as an `unnamed_addr constant`. llvm-svn: 281997
* Fix typo in documentation.Nick Lewycky2016-09-201-2/+2
| | | | | | Since this is a header it will break links to this section. llvm-svn: 281996
* [cleanup] Remove excessive padding from TextTokenRetokenizer::PositionAlexander Shaposhnikov2016-09-201-1/+1
| | | | | | | | | Reorder the fields of the struct TextTokenRetokenizer::Position to remove excessive padding. Test plan: make -j8 check-clang Differential revision: https://reviews.llvm.org/D24751 llvm-svn: 281995
* [docs] Extend the code coverage docs some moreVedant Kumar2016-09-201-3/+35
| | | | | | | | Flesh out the section on interpreting coverage reports, mention the coverage export feature, and add notes on how to build llvm with coverage turned on. llvm-svn: 281988
* Replace 'isProvablyNonNull' with existing utility llvm::IsKnownNonNull which ↵Nick Lewycky2016-09-201-6/+3
| | | | | | | | handles more cases. Noticed by inspection. Because of how the IR generation works, this isn't expected to cause an observable difference. llvm-svn: 281979
* [mips] MSA intrinsics header fileSimon Dardis2016-09-203-708/+1285
| | | | | | | | | | | This patch adds the msa.h header file containing the shorter names for the MSA instrinsics, e.g. msa_sll_b for builtin_msa_sll_b. Reviewers: vkalintiris, zoran.jovanovic Differential Review: https://reviews.llvm.org/D24674 llvm-svn: 281975
* [analyzer] Calculate extent size for memory regions allocated by new expression.Gabor Horvath2016-09-193-12/+207
| | | | | | | | | | | ArrayBoundChecker did not detect out of bounds memory access errors in case an array was allocated by the new expression. This patch resolves this issue. Patch by Daniel Krupp! Differential Revision: https://reviews.llvm.org/D24307 llvm-svn: 281934
* Reorder initializers in CallStackFrame so that we don't get a warning.Samuel Antao2016-09-191-2/+2
| | | | llvm-svn: 281923
* [OpenCL] Allow half type kernel argument when cl_khr_fp16 is enabledYaxun Liu2016-09-193-6/+22
| | | | llvm-svn: 281915
* Remove InstructionCombining and its related pass from sample pgo passes as ↵Dehao Chen2016-09-192-16/+0
| | | | | | | | | | | | | | we can handle "invoke" correctly. Summary: We previously relies on InstructionCombining pass to remove invoke instructions. Now that we can inline invoke instructions correctly, we do not need these passes any more. Reviewers: dnovillo Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D24730 llvm-svn: 281910
* Remove excessive padding from the struct CallStackFrameAlexander Shaposhnikov2016-09-191-6/+6
| | | | | | | | | | | The struct CallStackFrame is in lib/AST/ExprConstant.cpp inside anonymous namespace. This diff reorders the fields and removes excessive padding. Test plan: make -j8 check-clang Differential revision: https://reviews.llvm.org/D23901 llvm-svn: 281907
* [OpenCL] Diagnose assignment to dereference of half type pointerYaxun Liu2016-09-193-3/+18
| | | | | | Differential Revision: https://reviews.llvm.org/D24626 llvm-svn: 281904
* Reverting r281714 due to causing an assert when calling builtins that expect ↵Neil Hickey2016-09-194-44/+5
| | | | | | a double, from CL llvm-svn: 281899
* Recommit r281457 "Supports adding insertion around non-insertion replacements".Eric Liu2016-09-193-24/+128
| | | | | | | | | | | | | | Summary: Diff to r281457: - added a test case `CalculateRangesOfInsertionAroundReplacement`. Reviewers: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D24606 llvm-svn: 281891
OpenPOWER on IntegriCloud