summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* Document why the consumed attributes (consumable, callable_when, et al) are ↵Aaron Ballman2018-02-251-0/+24
| | | | | | not exposed with a C2x spelling. NFC. llvm-svn: 326054
* Add a C2x spelling for the external_source_symbol and internal_linkage ↵Aaron Ballman2018-02-253-4/+22
| | | | | | | | attributes in the clang vendor namespace. Both of these attributes have existing meaning in C code, so there was no reason to exclude them from using the new spelling. llvm-svn: 326053
* Add a C++11 and C2x spelling for the type safety attribute ↵Aaron Ballman2018-02-255-23/+60
| | | | | | | | (argument_with_type_tag, pointer_with_type_tag, and type_tag_for_datatype) in the clang vendor namespace. The TypeTagForDatatype attribute had custom parsing rules that previously prevented it from being supported with square bracket notation. The ArgumentWithTypeTag attribute previously had unnecessary custom parsing that could be handled declaratively. llvm-svn: 326052
* [RISCV] Enable __int128_t and __uint128_t through clang flagMandeep Singh Grang2018-02-259-2/+49
| | | | | | | | | | | | | | | | Summary: If the flag -fforce-enable-int128 is passed, it will enable support for __int128_t and __uint128_t types. This flag can then be used to build compiler-rt for RISCV32. Reviewers: asb, kito-cheng, apazos, efriedma Reviewed By: asb, efriedma Subscribers: shiva0217, efriedma, jfb, dschuff, sdardis, sbc100, jgravelle-google, aheejin, rbar, johnrusso, simoncook, jordy.potman.lists, sabuasal, niosHD, cfe-commits Differential Revision: https://reviews.llvm.org/D43105 llvm-svn: 326045
* [X86] Remove some masked cvt builtins that can be replaced with legacy ↵Craig Topper2018-02-243-110/+110
| | | | | | sse/avx buiiltins and a select. llvm-svn: 326039
* Add a C++11 and C2x spelling for the objc_bridge_related attribute in the ↵Aaron Ballman2018-02-243-3/+12
| | | | | | | | clang vendor namespace. This attribute has custom parsing rules that previously prevented it from being supported with square bracket notation. llvm-svn: 326038
* Add a C++11 and C2x spelling for the availability attribute in the clang ↵Aaron Ballman2018-02-243-8/+37
| | | | | | | | vendor namespace. This attribute has custom parsing rules that previously prevented it from being supported with square bracket notation. Rework the clang attribute argument parsing to be more easily extended for other custom-parsed attributes. llvm-svn: 326036
* Remove unused variable. We should be warning-free.Daniel Jasper2018-02-241-1/+1
| | | | llvm-svn: 326024
* Make module use diagnostics refer to the top-level moduleDaniel Jasper2018-02-242-3/+3
| | | | | | | | | | All use declarations need to be directly placed in the top-level module anyway, knowing the submodule doesn't really help. The header that has the offending #include can easily be seen in the diagnostics source location. Review: https://reviews.llvm.org/D43673 llvm-svn: 326023
* [X86] Remove __builtin_ia32_permvarsf256_mask and ↵Craig Topper2018-02-243-46/+28
| | | | | | __builtin_ia32_permvarsi256_mask and use the avx2 unmasked versions and a select instead. llvm-svn: 326022
* [CFG] Keep speculatively working around an MSVC compiler crash.Artem Dergachev2018-02-241-9/+31
| | | | | | | | | | | | | Replace if() with a switch(). Because random changes in the code seem to suppress the crash. Story so far: r325966 - Crash introduced. r325969 - Speculative fix had no effect. r325978 - Tried to bisect the offending function, crash suddenly disappeared. r326016 - After another random change in the code, bug appeared again. llvm-svn: 326021
* [CFG] Provide construction contexts for temporaries in conditional operators.Artem Dergachev2018-02-243-14/+30
| | | | | | | | | | | | | When a lifetime-extended temporary is on a branch of a conditional operator, materialization of such temporary occurs after the condition is resolved. This change allows us to understand, by including the MaterializeTemporaryExpr in the construction context, the target for temporary materialization in such cases. Differential Revision: https://reviews.llvm.org/D43483 llvm-svn: 326019
* [CFG] Provide construction contexts for temporaries bound to const references.Artem Dergachev2018-02-244-26/+29
| | | | | | | | | | In order to bind a temporary to a const lvalue reference, a no-op cast is added to make the temporary itself const, and only then the reference is taken (materialized). Skip the no-op cast when looking for the construction context. Differential Revision: https://reviews.llvm.org/D43481 llvm-svn: 326016
* [CFG] Provide construction contexts for functional cast-like constructors.Artem Dergachev2018-02-242-8/+32
| | | | | | | | | | When a constructor of a temporary with a single argument is treated as a functional cast expression, skip the functional cast expression and provide the correct construction context for the temporary. Differential Revision: https://reviews.llvm.org/D43480 llvm-svn: 326015
* [CFG] Provide construction contexts for lifetime-extended temporaries.Artem Dergachev2018-02-244-11/+53
| | | | | | | | | | | | | | When constructing a temporary that is going to be lifetime-extended through a MaterializeTemporaryExpr later, CFG elements for the respective constructor can now be queried to obtain the reference to that MaterializeTemporaryExpr and therefore gain information about lifetime extension. This may produce multi-layered construction contexts when information about both temporary destruction and lifetime extension is available. Differential Revision: https://reviews.llvm.org/D43477 llvm-svn: 326014
* Add another test for PR36157.Richard Smith2018-02-241-0/+8
| | | | llvm-svn: 325998
* [ExprConstant] Fix crash when initialize an indirect field with another field.Volodymyr Sapsai2018-02-232-4/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | When indirect field is initialized with another field, you have MemberExpr with CXXThisExpr that corresponds to the field's immediate anonymous parent. But 'this' was referring to the non-anonymous parent. So when we were building LValue Designator, it was incorrect as it had wrong starting point. Usage of such designator would cause unexpected APValue changes and crashes. The fix is in adjusting 'this' for indirect fields from non-anonymous parent to the field's immediate parent. Discovered by OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4985 rdar://problem/36359187 Reviewers: rsmith, efriedma Reviewed By: rsmith Subscribers: cfe-commits, jkorous-apple Differential Revision: https://reviews.llvm.org/D42498 llvm-svn: 325997
* bpf: Hook target feature "alu32" with LLVMYonghong Song2018-02-231-1/+8
| | | | | | | | | | | | | | LLVM has supported a new target feature "alu32" which could be enabled or disabled by "-mattr=[+|-]alu32" when using llc. This patch link Clang with it, so it could be also done by passing related options to Clang, for example: -Xclang -target-feature -Xclang +alu32 Signed-off-by: Jiong Wang <jiong.wang@netronome.com> Reviewed-by: Yonghong Song <yhs@fb.com> llvm-svn: 325996
* [Sema][ObjC] Process category attributes before checking protocol usesAlex Lorenz2018-02-232-4/+25
| | | | | | | | | This ensures that any availability attributes are attached to the category before the availability for the referenced protocols is checked. rdar://37829755 llvm-svn: 325994
* [CFG] Try to narrow down MSVC compiler crash via binary search.Artem Dergachev2018-02-231-11/+17
| | | | | | | | | | Split the presumably offending function in two to see which part of it causes the crash to occur. The crash was introduced in r325966. r325969 did not help. llvm-svn: 325978
* [analyzer] Relax the assert used when traversing the node graph.George Karpenkov2018-02-232-1/+22
| | | | | | | | | | | | | | The assertion gets exposed when changing the exploration order. This is a quick hacky fix, but the intention is that if the nodes do merge, it should not matter which predecessor should be traverse. A proper fix would be not to traverse predecessors at all, as all information relevant for any decision should be avilable locally. rdar://37540480 Differential Revision: https://reviews.llvm.org/D42773 llvm-svn: 325977
* [analyzer] mark returns of functions where the region passed as parameter ↵George Karpenkov2018-02-236-5/+772
| | | | | | | | | | | | | | | | | | was not initialized In the wild, many cases of null pointer dereference, or uninitialized value read occur because the value was meant to be initialized by the inlined function, but did not, most often due to error condition in the inlined function. This change highlights the return branch taken by the inlined function, in order to help user understand the error report and see why the value was uninitialized. rdar://36287652 Differential Revision: https://reviews.llvm.org/D41848 llvm-svn: 325976
* [analyzer] Consider switch- and goto- labels when constructing the set of ↵George Karpenkov2018-02-234-6/+77
| | | | | | | | | | | | executed lines When viewing the report in the collapsed mode the label signifying where did the execution go is often necessary for properly understanding the context. Differential Revision: https://reviews.llvm.org/D43145 llvm-svn: 325975
* [CFG] NFC: Speculative attempt to fix MSVC internal compiler error on buildbot.Artem Dergachev2018-02-231-3/+6
| | | | | | Don't use fancy initialization and member access in a DenseMap. llvm-svn: 325969
* [CFG] [analyzer] NFC: Allow more complicated construction contexts.Artem Dergachev2018-02-232-33/+97
| | | | | | | | | | | | | | ConstructionContexts introduced in D42672 are an additional piece of information included with CFGConstructor elements that help the client of the CFG (such as the Static Analyzer) understand where the newly constructed object is stored. The patch refactors the ConstructionContext class to prepare for including multi-layered contexts that are being constructed gradually, layer-by-layer, as the AST is traversed. Differential Revision: https://reviews.llvm.org/D43428 llvm-svn: 325966
* Set Module Metadata "RtLibUseGOT" when fno-plt is used.Sriraman Tallam2018-02-232-1/+5
| | | | | | Differential Revision: https://reviews.llvm.org/D42217 llvm-svn: 325961
* [Driver] Make -fno-common default for FuchsiaPetr Hosek2018-02-232-0/+3
| | | | | | | | We never want to generate common symbols on Fuchsia. Differential Revision: https://reviews.llvm.org/D43545 llvm-svn: 325945
* Really fix test on windows.Rafael Espindola2018-02-231-3/+3
| | | | | | Sorry for the noise. llvm-svn: 325943
* Fix one last test on a windows host.Rafael Espindola2018-02-231-1/+1
| | | | llvm-svn: 325942
* Bring r325915 back.Rafael Espindola2018-02-23198-1970/+2020
| | | | | | | | | | | | | | | The tests that failed on a windows host have been fixed. Original message: Start setting dso_local for COFF. With this there are still some GVs where we don't set dso_local because setGVProperties is never called. I intend to fix that in followup commits. This is just the bare minimum to teach shouldAssumeDSOLocal what it should do for COFF. llvm-svn: 325940
* Convert test to FileCheck. NFC.Rafael Espindola2018-02-231-7/+7
| | | | llvm-svn: 325930
* Revert "Start setting dso_local for COFF."Rafael Espindola2018-02-23147-1838/+1788
| | | | | | | | This reverts commit r325915. It will take some time to fix the failures on a windows host. llvm-svn: 325929
* Revert "[Darwin] Add a test to check clang produces accelerator tables."Paul Robinson2018-02-231-16/+0
| | | | | | | This reverts commit 7e24e5f8bff77b7e78da3bfcc68abf42457a66c9. aka r325850. Clang should not have end-to-end tests. llvm-svn: 325920
* Start setting dso_local for COFF.Rafael Espindola2018-02-23147-1788/+1838
| | | | | | | | | With this there are still some GVs where we don't set dso_local because setGVProperties is never called. I intend to fix that in followup commits. This is just the bare minimum to teach shouldAssumeDSOLocal what it should do for COFF. llvm-svn: 325915
* Support for the mno-stack-arg-probe flagHans Wennborg2018-02-238-10/+39
| | | | | | | | | | | | Adds support for this flag. There is also another piece for llvm (separate review). More info: https://bugs.llvm.org/show_bug.cgi?id=36221 By Ruslan Nikolaev! Differential Revision: https://reviews.llvm.org/D43108 llvm-svn: 325901
* [mips] Revert r325872Stefan Maksimovic2018-02-232-46/+0
| | | | | | | There are still outstanding issues with byVal arguments that prevent this from being committed. Revert for now. llvm-svn: 325899
* [mips] Reland r310704Stefan Maksimovic2018-02-232-0/+46
| | | | | | | | Recommit this change which was previously reverted for the 5.0.0 release since the failures identified were dealt with in r325782. llvm-svn: 325872
* Add a test to ensure we don't permit mutable access on temporaries outside ↵Richard Smith2018-02-231-2/+3
| | | | | | the evaluation in which they were created. llvm-svn: 325854
* [Darwin] Add a test to check clang produces accelerator tables.Davide Italiano2018-02-231-0/+16
| | | | | | | | This test was previously in lldb, and was only checking that clang was emitting the correct section. So, it belongs here and not in the debugger. llvm-svn: 325850
* Simplify setting dso_local. NFC.Rafael Espindola2018-02-233-12/+12
| | | | | | | | | | | The value of dso_local can be computed from just IR properties and global information (object file type, command line options, etc). With this patch we no longer pass in the Decl. It was almost unused and making it fully unused guarantees that dso_local is consistent with the rest of the IR. llvm-svn: 325846
* [Sema] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko2018-02-227-255/+341
| | | | | | other minor fixes (NFC). llvm-svn: 325834
* [OpenMP] Limit reduction support for pragma 'distribute' when combined with ↵Carlo Bertolli2018-02-222-19/+107
| | | | | | | | | | | pragma 'simd' Differential Revision: https://reviews.llvm.org/D43513 This is a bug fix that removes the emission of reduction support for pragma 'distribute' when found alone or in combinations without simd. Pragma 'distribute' does not have a reduction clause, but when combined with pragma 'simd' we need to emit the support for simd's reduction clause as part of code generation for distribute. This guard is similar to the one used for reduction support earlier in the same code gen function. llvm-svn: 325822
* [CUDA] Added missing functions.Artem Belevich2018-02-221-0/+22
| | | | | | | | | Initial commit missed sincos(float), llabs() and few atomics that we used to pull in from device_functions.hpp, which we no longer include. Differential Revision: https://reviews.llvm.org/D43602 llvm-svn: 325814
* [OPENMP] Require valid SourceLocation in function call, NFC.Alexey Bataev2018-02-222-8/+7
| | | | | | | Removed default empty SourceLocation argument from `emitCall` function and require valid location. llvm-svn: 325812
* [docs] Regenerate command line referenceJonas Hahnfeld2018-02-221-16/+30
| | | | llvm-svn: 325807
* [docs] Improve help for OpenMP options, NFC.Jonas Hahnfeld2018-02-221-12/+15
| | | | | | | | | | | | * Add HelpText for -fopenmp so that it appears in clang --help. * Hide -fno-openmp-simd, only list the positive option. * Hide -fopenmp-relocatable-target and -fopenmp-use-tls from clang --help and from ClangCommandLineReference. * Improve MetaVarName for -Xopenmp-target=<...>. Differential Revision: https://reviews.llvm.org/D42841 llvm-svn: 325806
* [docs] Fix duplicate arguments for JoinedAndSeparateJonas Hahnfeld2018-02-221-7/+15
| | | | | | | | | We can't see how many arguments are in the meta var name, so just assume that it is the right number. Differential Revision: https://reviews.llvm.org/D42840 llvm-svn: 325805
* [OpenCL] Add '-cl-uniform-work-group-size' compile optionAlexey Sotkin2018-02-229-3/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: OpenCL 2.0 specification defines '-cl-uniform-work-group-size' option, which requires that the global work-size be a multiple of the work-group size specified to clEnqueueNDRangeKernel and allows optimizations that are made possible by this restriction. The patch introduces the support of this option. To keep information about whether an OpenCL kernel has uniform work group size or not, clang generates 'uniform-work-group-size' function attribute for every kernel: - "uniform-work-group-size"="true" for OpenCL 1.2 and lower, - "uniform-work-group-size"="true" for OpenCL 2.0 and higher if '-cl-uniform-work-group-size' option was specified, - "uniform-work-group-size"="false" for OpenCL 2.0 and higher if no '-cl-uniform-work-group-size' options was specified. If the function is not an OpenCL kernel, 'uniform-work-group-size' attribute isn't generated. Patch by: krisb Reviewers: yaxunl, Anastasia, b-sumner Reviewed By: yaxunl, Anastasia Subscribers: nhaehnle, yaxunl, Anastasia, cfe-commits Differential Revision: https://reviews.llvm.org/D43570 llvm-svn: 325771
* [NFC] fix trivial typos in commentsHiroshi Inoue2018-02-222-2/+2
| | | | | | "a a"->"a" llvm-svn: 325753
* Revert part of D43378 in this fileKamil Rytarowski2018-02-221-1/+1
| | | | | | It causes failure on clang-x86_64-debian-fast. llvm-svn: 325749
OpenPOWER on IntegriCloud