summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* [OPENMP] Do not cast captured by value variables with pointer types inAlexey Bataev2018-04-232-5/+15
| | | | | | | | | | | NVPTX target. When generating the wrapper function for the offloading region, we need to call the outlined function and cast the arguments correctly to follow the ABI. Usually, variables captured by value are casted to `uintptr_t` type. But this should not performed for the variables with pointer type. llvm-svn: 330620
* Quick fix for rC330605: specify a target arch for testAleksei Sidorin2018-04-231-1/+1
| | | | llvm-svn: 330613
* [analyzer] Don't crash on printing ConcreteInt of size >64 bitsAleksei Sidorin2018-04-232-7/+10
| | | | | | | | Printing of ConcreteInts with size >64 bits resulted in assertion failure in get[Z|S]ExtValue() because these methods are only allowed to be used with integers of 64 max bit width. This patch fixes the issue. llvm-svn: 330605
* Fix case of LLVM library names.Nico Weber2018-04-231-3/+3
| | | | llvm-svn: 330604
* Remove unused code (made unused by r161073, and later more so by r248043).Nico Weber2018-04-231-6/+0
| | | | llvm-svn: 330601
* [analyzer] Move `TaintBugVisitor` from `GenericTaintChecker.cpp` to ↵Henry Wong2018-04-233-39/+37
| | | | | | | | | | | | | | | | `BugReporterVisitors.h`. Summary: `TaintBugVisitor` is a universal visitor, and many checkers rely on it, such as `ArrayBoundCheckerV2.cpp`, `DivZeroChecker.cpp` and `VLASizeChecker.cpp`. Moving `TaintBugVisitor` to `BugReporterVisitors.h` enables other checker can also track where `tainted` value came from. Reviewers: NoQ, george.karpenkov, xazax.hun Reviewed By: george.karpenkov Subscribers: szepet, rnkovacs, a.sidorin, cfe-commits, MTC Differential Revision: https://reviews.llvm.org/D45682 llvm-svn: 330596
* [index] Fix methods that take a shared_ptr to just take a reference.Benjamin Kramer2018-04-234-33/+28
| | | | | | | There is no ownership here, passing a shared_ptr just adds confusion. No functionality change intended. llvm-svn: 330595
* [analyzer] CStringChecker.cpp - Code refactoring on bug report.Henry Wong2018-04-231-100/+96
| | | | | | | | | | Reviewers: NoQ, george.karpenkov, xazax.hun Reviewed By: george.karpenkov Differential Revision: https://reviews.llvm.org/D44557 llvm-svn: 330589
* [OpenCL] Reject virtual functions for OpenCL C++Sven van Haastregt2018-04-235-1/+60
| | | | | | Differential Revision: https://reviews.llvm.org/D45873 llvm-svn: 330579
* [CodeGen] Reland r330442: Add an option to suppress output of llvm.identMikhail Maltsev2018-04-237-3/+33
| | | | | | | The test case in the original patch was overly contrained and failed on PPC targets. llvm-svn: 330575
* [clang-format] Fix clang-tidy readability problems, NFCIKrasimir Georgiev2018-04-233-6/+6
| | | | llvm-svn: 330574
* Format closing braces when reformatting the line containing the opening brace.Manuel Klimek2018-04-2311-30/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This required a couple of yaks to be shaved: 1. MatchingOpeningBlockLineIndex was misused to also store the closing index; instead, use a second variable, as this doesn't work correctly for "} else {". 2. We needed to change the API of AffectedRangeManager to not use iterators; we always passed in begin / end for the whole container before, so there was no mismatch in generality. 3. We need an extra check to discontinue formatting at the top level, as we now sometimes change the indent of the closing brace, but want to bail out immediately afterwards, for example: void f() { if (a) { } void g(); Previously: void f() { if (a) { } void g(); Now: void f() { if (a) { } void g(); Differential Revision: https://reviews.llvm.org/D45726 llvm-svn: 330573
* [Solaris] __float128 is supported on Solaris/x86Rainer Orth2018-04-232-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When rebasing https://reviews.llvm.org/D40898 with GCC 5.4 on Solaris 11.4, I ran into a few instances of In file included from /vol/llvm/src/compiler-rt/local/test/asan/TestCases/Posix/asan-symbolize-sanity-test.cc:19: In file included from /usr/gcc/5/lib/gcc/x86_64-pc-solaris2.11/5.4.0/../../../../include/c++/5.4.0/string:40: In file included from /usr/gcc/5/lib/gcc/x86_64-pc-solaris2.11/5.4.0/../../../../include/c++/5.4.0/bits/char_traits.h:39: In file included from /usr/gcc/5/lib/gcc/x86_64-pc-solaris2.11/5.4.0/../../../../include/c++/5.4.0/bits/stl_algobase.h:64: In file included from /usr/gcc/5/lib/gcc/x86_64-pc-solaris2.11/5.4.0/../../../../include/c++/5.4.0/bits/stl_pair.h:59: In file included from /usr/gcc/5/lib/gcc/x86_64-pc-solaris2.11/5.4.0/../../../../include/c++/5.4.0/bits/move.h:57: /usr/gcc/5/lib/gcc/x86_64-pc-solaris2.11/5.4.0/../../../../include/c++/5.4.0/type_traits:311:39: error: __float128 is not supported on this target struct __is_floating_point_helper<__float128> ^ during make check-all. The line above is inside #if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_FLOAT128) template<> struct __is_floating_point_helper<__float128> : public true_type { }; #endif While the libstdc++ header indicates support for __float128, clang does not, but should. The following patch implements this and fixed those errors. Differential Revision: https://reviews.llvm.org/D41240 llvm-svn: 330572
* Use special new Clang flag 'FrontendTimesIsEnabled' instead of ↵Andrew V. Tischenko2018-04-236-11/+197
| | | | | | | | 'llvm::TimePassesIsEnabled' inside -ftime-report feature. Differential Revision: https://reviews.llvm.org/D45619 llvm-svn: 330571
* Revert "[clang-format] Improve Incomplete detection for (text) protos"Krasimir Georgiev2018-04-233-90/+9
| | | | | | | | This reverts commit r330016. The incomplete detection has too many false positives, picking up typos for hard failures and refusing to format anything in that case. llvm-svn: 330569
* [Atomics] warn about atomic accesses using libcallsTim Northover2018-04-233-6/+40
| | | | | | | | | | | | If an atomic variable is misaligned (and that suspicion is why Clang emits libcalls at all) the runtime support library will have to use a lock to safely access it, with potentially very bad performance consequences. There's a very good chance this is unintentional so it makes sense to issue a warning. Also give it a named group so people can promote it to an error, or disable it if they really don't care. llvm-svn: 330566
* [XRay] Change std::sort to llvm::sort in response to r327219Mandeep Singh Grang2018-04-231-1/+1
| | | | | | | | | | | r327219 added wrappers to std::sort which randomly shuffle the container before sorting. This will help in uncovering non-determinism caused due to undefined sorting order of objects having the same key. To make use of that infrastructure we need to invoke llvm::sort instead of std::sort. llvm-svn: 330561
* [python bindings] Fix Cursor.result_type for ObjC method declarations - Bug ↵Jonathan Coe2018-04-222-1/+18
| | | | | | | | | | | | | | | | | | | | | 36677 Summary: In cindex.py, Cursor.result_type called into the wrong libclang function, causing cursors for ObjC method declarations to return invalid result types. Fixes Bug 36677. Reviewers: jbcoe, rsmith Reviewed By: jbcoe Subscribers: cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D45671 Patch by kjteske (Kyle Teske). llvm-svn: 330557
* Add tests for llvm-bcanalyzer stream typesBrian Gesiak2018-04-222-0/+13
| | | | | | | | | | | | | | | | | | Summary: Add tests for the improved stream type detection added to `llvm-bcanalyzer` in https://reviews.llvm.org/D41979. Test Plan: `check-clang` Reviewers: pcc, aprantl, mehdi_amini, george.karpenkov Reviewed By: aprantl Subscribers: cfe-commits, a.sidorin Differential Revision: https://reviews.llvm.org/D41980 llvm-svn: 330530
* [libclang] Fix LibclangReparseTest.FileName when TMPDIR is set to a symlinkPetr Pavlu2018-04-211-2/+3
| | | | | | | | | | | | | | | | | | | | | Fix testing of clang_File_tryGetRealPathName() in LibclangReparseTest.FileName when executing in an environment which has TMPDIR set to a symbolic link that points to an actual directory. The test would fail because the name returned by clang_File_tryGetRealPathName() has the symlink resolved but the test compared it to the original filename of a temporary file. The patch addresses the problem by checking only that the value returned by clang_File_tryGetRealPathName() ends with "main.cpp". Additionally, the patch makes the previous assertion in the test that checks result of clang_getFileName() stricter. It newly verifies that the name returned by the function is exactly same as what was given to clang_parseTranslationUnit()/clang_getFile(). Differential Revision: https://reviews.llvm.org/D45807 llvm-svn: 330507
* [X86] WaitPKG intrinsicsGabor Buella2018-04-2011-0/+109
| | | | | | | | | | Reviewers: craig.topper, zvi Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D45254 llvm-svn: 330463
* Record whether a module came from a private module mapJordan Rose2018-04-205-6/+20
| | | | | | | | | | | Right now we only use this information in one place, immediately after we calculate it, but it's still nice information to have. The Swift project is going to use this to tidy up its "API notes" feature (see past discussion on cfe-dev that never quite converged). Reviewed by Bruno Cardoso Lopes. llvm-svn: 330452
* Revert r330442, CodeGen/no-ident-version.c is failing on PPCMikhail Maltsev2018-04-207-33/+3
| | | | llvm-svn: 330451
* [CUDA] Set LLVM calling convention for CUDA kernelYaxun Liu2018-04-204-0/+52
| | | | | | | | | | | | | | Some targets need special LLVM calling convention for CUDA kernel. This patch does that through a TargetCodeGenInfo hook. It only affects amdgcn target. Patch by Greg Rodgers. Revised and lit tests added by Yaxun Liu. Differential Revision: https://reviews.llvm.org/D45223 llvm-svn: 330447
* [CodeGen] Add an option to suppress output of llvm.identMikhail Maltsev2018-04-207-3/+33
| | | | | | | | | | | | | | | | | | | | | | Summary: By default Clang outputs its version (including git commit hash, in case of trunk builds) into object and assembly files. It might be useful to have an option to disable this, especially for debugging purposes. This patch implements new command line flags -Qn and -Qy (the names are chosen for compatibility with GCC). -Qn disables output of the 'llvm.ident' metadata string and the 'producer' debug info. -Qy (enabled by default) does the opposite. Reviewers: faisalv, echristo, aprantl Reviewed By: aprantl Subscribers: aprantl, cfe-commits, JDevlieghere, rogfer01 Differential Revision: https://reviews.llvm.org/D45255 llvm-svn: 330442
* Fix some tests that were failing on WindowsHans Wennborg2018-04-203-9/+9
| | | | llvm-svn: 330441
* [docs] Regenerate command line referenceJonas Hahnfeld2018-04-201-19/+77
| | | | | | | This will correctly sort some manually added entries which should generally be avoided! llvm-svn: 330430
* [OpenMP] Hide -fopenmp-cuda-modeJonas Hahnfeld2018-04-201-2/+4
| | | | | | | This is an advanced flag that should show up neither in clang --help nor in the ClangCommandLineReference. llvm-svn: 330429
* clang-cl: Accept (and ignore) /Zc:__cplusplus.Nico Weber2018-04-202-1/+11
| | | | | | | | | | | See https://blogs.msdn.microsoft.com/vcblog/2018/04/09/msvc-now-correctly-reports-__cplusplus/ clang-cl already sets __cplusplus to the correct value, so we can just ignore this flag. Also add test coverage for a few more accepted-but-ignored flags. https://reviews.llvm.org/D45877 llvm-svn: 330427
* [CUDA] Document recent changesJonas Hahnfeld2018-04-202-1/+13
| | | | | | | | | * Finding installations via ptxas binary * Relocatable device code Differential Revision: https://reviews.llvm.org/D45449 llvm-svn: 330426
* [CUDA] Register relocatable GPU binariesJonas Hahnfeld2018-04-202-64/+168
| | | | | | | | | | nvcc generates a unique registration function for each object file that contains relocatable device code. Unique names are achieved with a module id that is also reflected in the function's name. Differential Revision: https://reviews.llvm.org/D42922 llvm-svn: 330425
* [Driver] Support for -save-stats in AddGoldPlugin.Florian Hahn2018-04-208-41/+75
| | | | | | | | | | | | | | This patch updates AddGoldPlugin to pass stats-file to the Gold plugin, if -save-stats is passed. It also moves the save-stats option handling to a helper function tools::getStatsFileName. Reviewers: tejohnson, mehdi_amini, compnerd Reviewed By: tejohnson, compnerd Differential Revision: https://reviews.llvm.org/D45771 llvm-svn: 330422
* [NEON] Add a comment explaining the situation with vget_high_f16() and ↵Ivan A. Kosarev2018-04-201-0/+4
| | | | | | | | vget_low_f16() intrinsics Related differential revision: https://reviews.llvm.org/D45668 llvm-svn: 330420
* Fix -Wunused-variable warnings after r330377.Andrea Di Biagio2018-04-201-2/+2
| | | | llvm-svn: 330408
* [OpenCL] Add 'denorms-are-zero' function attributeAlexey Sotkin2018-04-202-13/+23
| | | | | | | | | | | | | | | | | | Summary: Generate attribute 'denorms-are-zero'='true' if '-cl-denorms-are-zero' compile option was specified and 'denorms-are-zero'='false' otherwise. Patch by krisb Reviewers: Anastasia, yaxunl Reviewed By: yaxunl Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D45808 llvm-svn: 330404
* [CFG] [analyzer] Add construction contexts for loop condition variables.Artem Dergachev2018-04-194-10/+105
| | | | | | | | | | | | | | | | | Loop condition variables, eg. while (shared_ptr<int> P = getIntPtr()) { ... }) weren't handled in r324794 because they don't go through the common CFGBuilder::VisitDeclStmt method. Which means that they regressed after r324800. Fix the regression by duplicating the necessary construction context scan in the loop visiting code. Differential Revision: https://reviews.llvm.org/D45706 llvm-svn: 330382
* [analyzer] When we fail to evaluate a pointer cast, escape the pointer.Artem Dergachev2018-04-195-36/+42
| | | | | | | | | | | | | | If a pointer cast fails (evaluates to an UnknownVal, i.e. not implemented in the analyzer) and such cast is in fact the last use of the pointer, the pointer symbol is no longer referenced by the program state and a leak is (mis-)diagnosed. "Escape" the pointer upon a failed cast, i.e. inform the checker that we can no longer reliably track it. Differential Revision: https://reviews.llvm.org/D45698 llvm-svn: 330380
* Implement proper support for `-falign-functions`Saleem Abdulrasool2018-04-1911-6/+91
| | | | | | | | | | | | | | | | This implements support for the previously ignored flag `-falign-functions`. This allows the frontend to request alignment on function definitions in the translation unit where they are not explicitly requested in code. This is compatible with the GCC behaviour and the ICC behaviour. The scalar value passed to `-falign-functions` aligns functions to a power-of-two boundary. If flag is used, the functions are aligned to 16-byte boundaries. If the scalar is specified, it must be an integer less than or equal to 4096. If the value is not a power-of-two, the driver will round it up to the nearest power of two. llvm-svn: 330378
* [CFG] [analyzer] Don't treat argument constructors as temporary constructors.Artem Dergachev2018-04-193-0/+85
| | | | | | | | | | | | | | Function argument constructors (that are used for passing objects into functions by value) are completely unlike temporary object constructors, but we were treating them as such because they are also wrapped into a CXXBindTemporaryExpr. This patch adds a partial construction context layer for call argument values, but doesn't proceed to transform it into an actual construction context yet. This is tells the clients that we aren't supporting these constructors yet. Differential Revision: https://reviews.llvm.org/D45650 llvm-svn: 330377
* [analyzer] RetainCount: Accept more "safe" CFRetain wrappers.Artem Dergachev2018-04-192-4/+26
| | | | | | | | | | | | | | | | | | | | | | | | r315736 added support for the misplaced CF_RETURNS_RETAINED annotation on CFRetain() wrappers. It works by trusting the function's name (seeing if it confirms to the CoreFoundation naming convention) rather than the annotation. There are more false positives caused by users using a different naming convention, namely starting the function name with "retain" or "release" rather than suffixing it with "retain" or "release" respectively. Because this isn't according to the naming convention, these functions are usually inlined and the annotation is therefore ignored, which is correct. But sometimes we run out of inlining stack depth and the function is evaluated conservatively and then the annotation is trusted. Add support for the "alternative" naming convention and test the situation when we're running out of inlining stack depth. rdar://problem/18270122 Differential Revision: https://reviews.llvm.org/D45117 llvm-svn: 330375
* [UnitTests] NFC/build-perf: Break up nontrivial compile jobsDavid Zarzycki2018-04-1921-602/+856
| | | | | | | | | RecursiveASTVisitorTest.cpp is one of the longest compile jobs and a build bottleneck on many-core machines. This patch breaks that file and some peer files up into smaller files to increase build concurrency and overall rebuild performance. llvm-svn: 330353
* [CXX] Templates specialization visibility can be wrongSteven Wu2018-04-192-3/+35
| | | | | | | | | | | | | | | | | | | | | Summary: Under some conditions, LinkageComputer can get the visibility for ClassTemplateSpecializationDecl wrong because it failed to find the Decl that has the explicit visibility. This fixes: llvm.org/bugs/pr36810 rdar://problem/38080953 Reviewers: rsmith, arphaman, doug.gregor Reviewed By: doug.gregor Subscribers: doug.gregor, cfe-commits Differential Revision: https://reviews.llvm.org/D44670 llvm-svn: 330338
* [NEON] Define vfma_n_f32() and vfmaq_n_f32() intrinsics in AArch32 modeIvan A. Kosarev2018-04-192-1/+26
| | | | | | Differential Revision: https://reviews.llvm.org/D45670 llvm-svn: 330336
* Fix __attribute__((force_align_arg_pointer)) misalignment bugErich Keane2018-04-192-22/+7
| | | | | | | | | | | | | | | | The force_align_arg_pointer attribute was using a hardcoded 16-byte alignment value which in combination with -mstack-alignment=32 (or larger) would produce a misaligned stack which could result in crashes when accessing stack buffers using aligned AVX load/store instructions. Fix the issue by using the "stackrealign" function attribute instead of using a hardcoded 16-byte alignment. Patch By: Gramner Differential Revision: https://reviews.llvm.org/D45812 llvm-svn: 330331
* [clang-format] Don't remove empty lines before namespace endingsKrasimir Georgiev2018-04-195-12/+47
| | | | | | | | | | | | | | Summary: This implements an alternative to r327861, namely preserving empty lines before namespace endings. Reviewers: djasper Reviewed By: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D45373 llvm-svn: 330324
* Lowering x86 adds/addus/subs/subus intrinsics (clang)Alexander Ivchenko2018-04-195-90/+656
| | | | | | | | | | | This is the patch that lowers x86 intrinsics to native IR in order to enable optimizations. Patch by tkrupa Differential Revision: https://reviews.llvm.org/D44786 llvm-svn: 330323
* OpenBSD add C++ runtime in a driver's standpointDean Michael Berris2018-04-192-0/+10
| | | | | | | | | | | | | | Summary: - Since 6.2 release, on supporters platforms clang is shipped with both libcxx and libcxxabi. Reviewers: dberris, alekseyshl, EricWF Reviewed By: dberris Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D45662 llvm-svn: 330310
* [CodeGen] Do not push a destructor cleanup for a struct that doesn'tAkira Hatanaka2018-04-182-2/+33
| | | | | | | | | | | | | | | have a non-trivial destructor. This fixes a bug introduced in r328731 where CodeGen emits calls to synthesized destructors for non-trivial C structs in C++ mode when the struct passed to EmitCallArg doesn't have a non-trivial destructor. Under Microsoft's ABI, ASTContext::isParamDestroyedInCallee currently always returns true, so it's necessary to check whether the struct has a non-trivial destructor before pushing a cleanup in EmitCallArg. This fixes PR37146. llvm-svn: 330304
* [MS] Fix unprototyped thunk emission for incomplete return typesReid Kleckner2018-04-182-5/+26
| | | | | | Fixes PR37161 llvm-svn: 330303
* [NVPTX, CUDA] Added support for m8n32k16 and m32n8k16 variants of wmma ↵Artem Belevich2018-04-184-133/+588
| | | | | | | | | | instructions. The new instructions were added added for sm_70+ GPUs in CUDA-9.1. Differential Revision: https://reviews.llvm.org/D45068 llvm-svn: 330296
OpenPOWER on IntegriCloud