summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Attempt to fix 'logical operation on address of string constant'Kristof Umann2018-11-021-2/+4
| | | | | | | Caused a lot of warnings for Windows: http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/21178/steps/build/logs/warnings%20%2867%29 llvm-svn: 346033
* [analyzer] Fixup of the module build after https://reviews.llvm.org/D53277George Karpenkov2018-11-021-0/+1
| | | | | | Adds AnalyzerOptions.def to the list of textual headers. llvm-svn: 346028
* [COFF, ARM64] Change setjmp for AArch64 Windows to use Intrinsic.sponentryMandeep Singh Grang2018-11-022-4/+7
| | | | | | | | | | | | | | | | Summary: ARM64 setjmp expects sp on entry instead of framepointer. Patch by: Yin Ma (yinma@codeaurora.org) Reviewers: mgrang, eli.friedman, ssijaric, mstorsjo, rnk, compnerd Reviewed By: mgrang Subscribers: efriedma, javed.absar, kristof.beyls, chrib, cfe-commits Differential Revision: https://reviews.llvm.org/D53998 llvm-svn: 346024
* [CodeGen] Fix a crash when updating a designated initializerErik Pilkington2018-11-022-9/+21
| | | | | | | | | | We need to handle the ConstantAggregateZero case here too. rdar://45691981 Differential revision: https://reviews.llvm.org/D54010 llvm-svn: 346004
* Change -fsanitize-address-poison-class-member-array-new-cookie to ↵Filipe Cabecinhas2018-11-0210-19/+48
| | | | | | | | | | | | | | -fsanitize-address-poison-custom-array-cookie Handle it in the driver and propagate it to cc1 Reviewers: rjmccall, kcc, rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52615 llvm-svn: 346001
* Remove the duplicated definition of size_tKristof Umann2018-11-021-1/+0
| | | | | | So hopefully windows won't complain. llvm-svn: 345997
* Didn't -> didnt, because #errors complains about untermianted 'Kristof Umann2018-11-021-2/+2
| | | | llvm-svn: 345993
* [analyzer] Fix diagnostics/explicit-suppression.cppFangrui Song2018-11-021-1/+1
| | | | | | *OI++ = *II++ is on line 670, not 668 llvm-svn: 345992
* [OPENMP][NVPTX]Use __kmpc_data_sharing_coalesced_push_stack function.Alexey Bataev2018-11-023-19/+20
| | | | | | | | Coalesced memory access requires use of the new function `__kmpc_data_sharing_coalesced_push_stack` instead of the `__kmpc_data_sharing_push_stack`. llvm-svn: 345991
* [analyzer] Put llvm.Conventions back in alphaKristof Umann2018-11-028-42/+303
| | | | | | | | | | | | Interestingly, this many year old (when I last looked I remember 2010ish) checker was committed without any tests, so I thought I'd implement them, but I was shocked to see how I barely managed to get it working. The code is severely outdated, I'm not even sure it has ever been used, so I'd propose to move it back into alpha, and possibly even remove it. Differential Revision: https://reviews.llvm.org/D53856 llvm-svn: 345990
* [analyzer] New flag to print all -analyzer-config optionsKristof Umann2018-11-027-0/+119
| | | | | | | | A new -cc1 flag is avaible for the said purpose: -analyzer-config-help Differential Revision: https://reviews.llvm.org/D53296 llvm-svn: 345989
* [analyzer][NFC] Collect all -analyzer-config options in a .def fileKristof Umann2018-11-024-790/+601
| | | | | | | | | | | | | I'm in the process of refactoring AnalyzerOptions. The main motivation behind here is to emit warnings if an invalid -analyzer-config option is given from the command line, and be able to list them all. In this patch, I'm moving all analyzer options to a def file, and move 2 enums to global namespace. Differential Revision: https://reviews.llvm.org/D53277 llvm-svn: 345986
* [analyzer][NFC] Fix some incorrect uses of -analyzer-config optionsKristof Umann2018-11-0214-79/+61
| | | | | | | | | | | | | | | | | | | | | | | | I'm in the process of refactoring AnalyzerOptions. The main motivation behind here is to emit warnings if an invalid -analyzer-config option is given from the command line, and be able to list them all. In this patch, I found some flags that should've been used as checker options, or have absolutely no mention of in AnalyzerOptions, or are nonexistent. - NonLocalizedStringChecker now uses its "AggressiveReport" flag as a checker option - lib/StaticAnalyzer/Frontend/ModelInjector.cpp now accesses the "model-path" option through a getter in AnalyzerOptions - -analyzer-config path-diagnostics-alternate=false is not a thing, I removed it, - lib/StaticAnalyzer/Checkers/AllocationDiagnostics.cpp and lib/StaticAnalyzer/Checkers/AllocationDiagnostics.h are weird, they actually only contain an option getter. I deleted them, and fixed RetainCountChecker to get it's "leak-diagnostics-reference-allocation" option as a checker option, - "region-store-small-struct-limit" has a proper getter now. Differential Revision: https://reviews.llvm.org/D53276 llvm-svn: 345985
* [OPENMP]Change the mapping type for lambda captures.Alexey Bataev2018-11-022-7/+7
| | | | | | The previously used combination `PTR_AND_OBJ | PRIVATE` could be used for mapping of some data in Fortran. Changed it to `PTR_AND_OBJ | LITERAL`. llvm-svn: 345982
* [OPENMP][NVPTX]Improve emission of the globalized variables forAlexey Bataev2018-11-0213-22/+390
| | | | | | | | | | | | | | | | | | | target/teams/distribute regions. Target/teams/distribute regions exist for all the time the kernel is executed. Thus, if the variable is declared in their context and then escape it, we can allocate global memory statically instead of allocating it dynamically. Patch captures all the globalized variables in target/teams/distribute contexts, merges them into the records, one per each target region. Those records are then joined into the union, one per compilation unit (to save the global memory). Those units are organized into 2 x dimensional arrays, where the first dimension is the number of blocks per SM and the second one is the number of SMs. Runtime functions manage this global memory space between the executing teams. llvm-svn: 345978
* Reapply Logging: make os_log buffer size an integer constant expression.Tim Northover2018-11-0213-24/+27
| | | | | | | | | | | | The size of an os_log buffer is known at any stage of compilation, so making it a constant expression means that the common idiom of declaring a buffer for it won't result in a VLA. That allows the compiler to skip saving and restoring the stack pointer around such buffers. This also moves the OSLog and other FormatString helpers from libclangAnalysis to libclangAST to avoid a circular dependency. llvm-svn: 345971
* Add support for 'atomic_default_mem_order' clause on 'requires' directive. ↵Patrick Lyster2018-11-0220-7/+253
| | | | | | Also renamed test files relating to 'requires'. Differntial review: https://reviews.llvm.org/D53513 llvm-svn: 345967
* [analyzer][CTU] Correctly signal in the function index generation tool if ↵Gabor Horvath2018-11-022-21/+11
| | | | | | | | there was an error Differential Revision: https://reviews.llvm.org/D53979 llvm-svn: 345965
* Revert "Fix regression in behavior of clang -x c++-header -fmodule-name=XXX"Ilya Biryukov2018-11-025-36/+9
| | | | | | | | | | This reverts commit r345803 and r345915 (a follow-up fix to r345803). Reason: r345803 blocks our internal integrate because of the new warnings showing up in too many places. The fix is actually correct, we will reland it after figuring out how to integrate properly. llvm-svn: 345963
* Fix -Wimplicit-fallthrough warning in LLVM_ENABLE_ASSERTIONS=Off buildsFangrui Song2018-11-021-1/+1
| | | | llvm-svn: 345950
* When building a header module, treat inputs as headers rather thanRichard Smith2018-11-022-6/+4
| | | | | | | | | source files. This suppresses certain warnings (eg, '#include_next in main source file'). llvm-svn: 345915
* [CodeGen] Fix assertion on referencing constexpr Obj-C object with ARC.Volodymyr Sapsai2018-11-012-14/+66
| | | | | | | | | | | | | | | | | | | | | | | | | Failed assertion is > Assertion failed: ((ND->isUsed(false) || !isa<VarDecl>(ND) || !E->getLocation().isValid()) && "Should not use decl without marking it used!"), function EmitDeclRefLValue, file llvm-project/clang/lib/CodeGen/CGExpr.cpp, line 2437. `EmitDeclRefLValue` mentions > // A DeclRefExpr for a reference initialized by a constant expression can > // appear without being odr-used. Directly emit the constant initializer. The fix is to use the similar approach for non-references as for references. It is achieved by trying to emit a constant before we attempt to load non-odr-used variable as LValue. rdar://problem/40650504 Reviewers: ahatanak, rjmccall Reviewed By: rjmccall Subscribers: dexonsmith, erik.pilkington, cfe-commits Differential Revision: https://reviews.llvm.org/D53674 llvm-svn: 345903
* [CodeGen] Move `emitConstant` from ScalarExprEmitter to CodeGenFunction. NFC.Volodymyr Sapsai2018-11-013-11/+13
| | | | | | | | | | | | | | | The goal is to use `emitConstant` in more places. Didn't move `ComplexExprEmitter::emitConstant` because it returns a different type. Reviewers: rjmccall, ahatanak Reviewed By: rjmccall Subscribers: dexonsmith, erik.pilkington, cfe-commits Differential Revision: https://reviews.llvm.org/D53725 llvm-svn: 345897
* [CMake][Fuchsia] Don't restrict Linux runtimes to UNIXPetr Hosek2018-11-011-32/+32
| | | | | | | | | This allows building Linux runtimes on any platform if the correct sysroot is provided via CMake option. Differential Revision: https://reviews.llvm.org/D53970 llvm-svn: 345889
* Fix clang -Wimplicit-fallthrough warnings across llvm, NFCReid Kleckner2018-11-0134-45/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch should not introduce any behavior changes. It consists of mostly one of two changes: 1. Replacing fall through comments with the LLVM_FALLTHROUGH macro 2. Inserting 'break' before falling through into a case block consisting of only 'break'. We were already using this warning with GCC, but its warning behaves slightly differently. In this patch, the following differences are relevant: 1. GCC recognizes comments that say "fall through" as annotations, clang doesn't 2. GCC doesn't warn on "case N: foo(); default: break;", clang does 3. GCC doesn't warn when the case contains a switch, but falls through the outer case. I will enable the warning separately in a follow-up patch so that it can be cleanly reverted if necessary. Reviewers: alexfh, rsmith, lattner, rtrieu, EricWF, bollu Differential Revision: https://reviews.llvm.org/D53950 llvm-svn: 345882
* Output "rule" information in SARIF exports.Aaron Ballman2018-11-016-2/+386
| | | | | | SARIF allows you to export descriptions about rules that are present in the SARIF log. Expose the help text table generated into Checkers.inc as the rule's "full description" and export all of the rules present in the analysis output. This information is useful for analysis result viewers like CodeSonar. llvm-svn: 345874
* Add LLVM_FALLTHROUGH annotation after switchReid Kleckner2018-11-011-0/+1
| | | | | | | | | | | This silences a -Wimplicit-fallthrough warning from clang. GCC does not appear to warn when the case body ends in a switch. This is a somewhat surprising but intended fallthrough that I pulled out from my mechanical patch. The code intends to handle 'Yi' and related constraints as the 'x' constraint. llvm-svn: 345873
* Revert "[COFF, ARM64] Change setjmp for AArch64 Windows to use ↵Mandeep Singh Grang2018-11-012-7/+4
| | | | | | | | Intrinsic.sponentry" This reverts commit 619111f5ccf349b635e4987ec02d15777c571495. llvm-svn: 345872
* Revert "Reapply Logging: make os_log buffer size an integer constant ↵Tim Northover2018-11-018-19/+16
| | | | | | | | expression." Still more dependency hell. llvm-svn: 345871
* Reapply Logging: make os_log buffer size an integer constant expression.Tim Northover2018-11-018-16/+19
| | | | | | | | | | | | The size of an os_log buffer is known at any stage of compilation, so making it a constant expression means that the common idiom of declaring a buffer for it won't result in a VLA. That allows the compiler to skip saving and restoring the stack pointer around such buffers. This also moves the OSLog helpers from libclangAnalysis to libclangAST to avoid a circular dependency. llvm-svn: 345866
* Replace two fallthrough annotations after covered switch with unreachableReid Kleckner2018-11-011-4/+2
| | | | | | | | | | | | | Both preceding switches handle all possible enumerators, so the fallthrough is actually unreachable. This strengthens that to an assertion. The first instance had a comment from 2010 indicating that fallthrough was possible, but that was back when we had a unary operator for offsetof. Now it is its own expression kind, so the annotation was stale. llvm-svn: 345862
* [Diagnostics] Implement -Wsizeof-pointer-div David Bolvansky2018-11-013-2/+62
| | | | | | | | | | | | | | | | | | | Summary: void test(int *arr) { int arr_len = sizeof(arr) / sizeof(*arr); // warn, incorrect way to compute number of array elements } Enabled under -Wall (same behaviour as GCC) Reviewers: rsmith, MTC, aaron.ballman Reviewed By: aaron.ballman Subscribers: MTC, thakis, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D52949 llvm-svn: 345847
* Revert "Logging: make os_log buffer size an integer constant expression.Tim Northover2018-11-014-16/+12
| | | | | | | | This also reverts a couple of follow-up commits trying to fix the dependency issues. Latest revision added a cyclic dependency that can't just be patched up in 5 minutes. llvm-svn: 345846
* [clang] Improve ctor initializer completions.Kadir Cetinkaya2018-11-014-95/+165
| | | | | | | | | | | | | | | | Summary: Instead of providing generic "args" for member and base class initializers, tries to fetch relevant constructors and show their signatures. Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: ZaMaZaN4iK, eraman, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D53654 llvm-svn: 345844
* Multiversioning- Ensure all MV functions are emitted.Erich Keane2018-11-014-50/+60
| | | | | | | | Multiverson function versions are always used (by the resolver), so ensure that they are always emitted. Change-Id: I5d2e0841fddf0d18918b3fb92ae76814add7ee96 llvm-svn: 345839
* CPU-Dispatch- Fix type of a member function, prevent deferralsErich Keane2018-11-012-2/+31
| | | | | | | | | | The member type creation for a cpu-dispatch function was not correctly including the 'this' parameter, so ensure that the type is properly determined. Also, disable defer in the cases of emitting the functoins, as it can end up resulting in the wrong version being emitted. Change-Id: I0b8fc5e0b0d1ae1a9d98fd54f35f27f6e5d5d083 llvm-svn: 345838
* Logging: put link against libclangAnalysis rather than libLLVMAnalysis for ↵Tim Northover2018-11-011-1/+1
| | | | | | os_log llvm-svn: 345835
* Logging: add CMake dependency so libAST can use OSLog analysis.Tim Northover2018-11-011-0/+1
| | | | | | | Should fix bots on platforms with slightly different symbol resolution semantics. llvm-svn: 345833
* Logging: make os_log buffer size an integer constant expression.Tim Northover2018-11-013-12/+15
| | | | | | | | | The size of an os_log buffer is known at any stage of compilation, so making it a constant expression means that the common idiom of declaring a buffer for it won't result in a VLA. That allows the compiler to skip saving and restoring the stack pointer around such buffers. llvm-svn: 345828
* CPU-Dispatch-- Fix conflict between 'generic' and 'pentium'Erich Keane2018-11-012-0/+34
| | | | | | | | | | | | | | | | | When a dispatch function was being emitted that had both a generic and a pentium configuration listed, we would assert. This is because neither configuration has any 'features' associated with it so they were both considered the 'default' version. 'pentium' lacks any features because we implement it in terms of __builtin_cpu_supports (instead of Intel proprietary checks), which is unable to decern between the two. The fix for this is to omit the 'generic' version from the dispatcher if both are present. This permits existing code to compile, and still will choose the 'best' version available (since 'pentium' is technically better than 'generic'). Change-Id: I4b69f3e0344e74cbdbb04497845d5895dd05fda0 llvm-svn: 345826
* Allow clk_event_t comparisonsSven van Haastregt2018-11-013-3/+29
| | | | | | | | | Also rename `invalid-clk-events-cl2.0.cl` to `clk_event_t.cl` and repurpose it to include both positive and negative clk_event_t tests. Differential Revision: https://reviews.llvm.org/D53871 llvm-svn: 345825
* Update to the 10-10 SARIF spec.Aaron Ballman2018-11-013-16/+13
| | | | | | This removes the Step property (which can be calculated by consumers trivially), and updates the schema and version numbers accordingly. llvm-svn: 345823
* [clang][CodeGen] ImplicitIntegerSignChangeSanitizer: actually ignore NOP casts.Roman Lebedev2018-11-012-4/+15
| | | | | | | | | I fully expected for that to be handled by the canonical type check, but it clearly wasn't. Sadly, somehow it hide until now. Reported by Eli Friedman. llvm-svn: 345816
* [Clang][PowerPC] Support constraint 'wi' in asmLi Jia He2018-11-011-0/+1
| | | | | | | | | | From the gcc manual, we can see that the specific limit of wi inline asm is “FP or VSX register to hold 64-bit integers for VSX insns or NO_REGS”. The link is https://gcc.gnu.org/onlinedocs/gcc-8.2.0/gcc/Machine-Constraints.html#Machine-Constraints. We should accept this constraint. Reviewed By: jsji Differential Revision: https://reviews.llvm.org/D53265 llvm-svn: 345809
* [COFF, ARM64] Implement llvm.addressofreturnaddress intrinsicMandeep Singh Grang2018-11-013-1/+7
| | | | llvm-svn: 345808
* [analyzer] SARIF: Suppress version testing in a more downstream-friendly manner.Artem Dergachev2018-11-012-2/+2
| | | | | | No functional change intended. llvm-svn: 345807
* Fix typo in comment.Richard Smith2018-11-011-1/+1
| | | | llvm-svn: 345805
* [WebAssembly] Fix type names in truncation builtinsThomas Lively2018-11-013-16/+16
| | | | | | | | | | | | Summary: Use the same convention as all the other WebAssembly builtin names. Reviewers: aheejin, dschuff Subscribers: sbc100, jgravelle-google, sunfish, kristina, cfe-commits Differential Revision: https://reviews.llvm.org/D53724 llvm-svn: 345804
* Fix regression in behavior of clang -x c++-header -fmodule-name=XXXRichard Smith2018-11-015-4/+33
| | | | | | | | | | | | -fsyntax-only. The driver accidentally stopped passing the input filenames on to -cc1 in this mode due to confusion over what action was being requested. This change also fixes a couple of crashes I encountered when passing multiple files to such a -cc1 invocation. llvm-svn: 345803
* [analyzer] pr39348: MallocChecker: Realize that sized delete isn't custom ↵Artem Dergachev2018-11-013-55/+53
| | | | | | | | | | | | | | | | | | | | | | | | | delete. MallocChecker no longer thinks that operator delete() that accepts the size of the object to delete (available since C++14 or under -fsized-deallocation) is some weird user-defined operator. Instead, it handles it like normal delete. Additionally, it exposes a regression in NewDelete-intersections.mm's testStandardPlacementNewAfterDelete() test, where the diagnostic is delayed from before the call of placement new into the code of placement new in the header. This happens because the check for pass-into-function-after-free for placement arguments is located in checkNewAllocator(), which happens after the allocator is inlined, which is too late. Move this use-after-free check into checkPreCall instead, where it works automagically because the guard that prevents it from working is useless and can be removed as well. This commit causes regressions under -analyzer-config c++-allocator-inlining=false but this option is essentially unsupported because the respective feature has been enabled by default quite a while ago. Differential Revision: https://reviews.llvm.org/D53543 llvm-svn: 345802
OpenPOWER on IntegriCloud