summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* recommit: [ASTImporter] Friend class decl should not be visible in its contextGabor Marton2019-12-182-41/+91
| | | | | | | | | | | | | | | | | | | Summary: In the past we had to use DeclContext::makeDeclVisibleInContext to make friend declarations available for subsequent lookup calls and this way we could chain (redecl) the structurally equivalent decls. By doing this we created an AST that improperly made declarations visible in some contexts, so the AST was malformed. Since we use the importer specific lookup this is no longer necessary, because with that we can find every previous nodes. Reviewers: balazske, a_sidorin, a.sidorin, shafik Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, teemperor, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71020
* [OpenCL] Add builtin function extension handlingSven van Haastregt2019-12-184-24/+106
| | | | | | | | | | Provide a mechanism to attach OpenCL extension information to builtin functions, so that their use can be restricted according to the extension(s) the builtin is part of. Patch by Pierre Gondois and Sven van Haastregt. Differential Revision: https://reviews.llvm.org/D71476
* [CFG] Add an option to expand CXXDefaultInitExpr into aggregate initializationGabor Horvath2019-12-176-4/+68
| | | | | | | | | | This is useful for clients that are relying on linearized CFGs for evaluating subexpressions and want the default initializer to be evaluated properly. The upcoming lifetime analysis is using this but it might also be useful for the static analyzer at some point. Differential Revision: https://reviews.llvm.org/D71642
* [analysis] Discard type qualifiers when casting values retrieved from the Store.Artem Dergachev2019-12-172-4/+66
| | | | | | | | | This canonicalizes the representation of unknown pointer symbols, which reduces the overall confusion in pointer cast representation. Patch by Vince Bridgers! Differential Revision: https://reviews.llvm.org/D70836
* [driver][darwin] Use explicit -mlinker-version in the -platform_version testsAlex Lorenz2019-12-174-8/+8
| | | | | | The driver actually adds a default -mlinker-version, based on HOST_LINK_VERSION cmake variable. The tests should be explicit about which version they're using to trigger the right behavior.
* [Driver] Avoid copies in range-based for loopsMark de Wever2019-12-172-2/+2
| | | | | | This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall. Differential Revision: https://reviews.llvm.org/D71527
* [Sema] Fixes -Wrange-loop-analysis warningsMark de Wever2019-12-172-2/+2
| | | | | | This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall. Differential Revision: https://reviews.llvm.org/D71529
* [Frontend] Fixes -Wrange-loop-analysis warningsMark de Wever2019-12-171-3/+3
| | | | | | This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall. Differential Revision: https://reviews.llvm.org/D71530
* [perf-training] Change profile file pattern string to use %4m instead of %pXin-Xin Wang2019-12-171-1/+1
| | | | | | | | | | | | | | Summary: With %p, each test file that we're using to generate profile data will make its own profraw file which is around 60 MB in size. If we have a lot of test files, that quickly uses a lot of space. Use %4m instead to share the profraw files used to store the profile data. We use 4 here based on the default value in https://reviews.llvm.org/source/llvm-github/browse/master/llvm/CMakeLists.txt$604 Reviewers: beanz, phosek, xiaobai, smeenai, vsk Reviewed By: vsk Subscribers: vsk, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71585
* [FPEnv] Remove unnecessary rounding mode argument for constrained intrinsicsUlrich Weigand2019-12-171-18/+18
| | | | | | | | | | | | | | | | | | | The following intrinsics currently carry a rounding mode metadata argument: llvm.experimental.constrained.minnum llvm.experimental.constrained.maxnum llvm.experimental.constrained.ceil llvm.experimental.constrained.floor llvm.experimental.constrained.round llvm.experimental.constrained.trunc This is not useful since the semantics of those intrinsics do not in any way depend on the rounding mode. In similar cases, other constrained intrinsics do not have the rounding mode argument. Remove it here as well. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D71218
* [OPENMP50]Add parsing/sema analysis for nontemporal clause.Alexey Bataev2019-12-1742-66/+1587
| | | | | Add basic support for parsing/sema analysis of the nontemporal clause in simd-based directives.
* [Clang FE, SystemZ] Recognize -mpacked-stack CL optionJonas Paulsson2019-12-176-0/+25
| | | | | | | | | | | Recognize -mpacked-stack from the command line and add a function attribute "mpacked-stack" when passed. This is needed for building the Linux kernel. If this option is passed for any other target than SystemZ, an error is generated. Review: Ulrich Weigand https://reviews.llvm.org/D71441
* [objc_direct] fix uniquing when re-declaring a readwrite-direct propertyPierre Habouzit2019-12-172-1/+17
| | | | | | | | | | | | | ObjCMethodDecl::getCanonicalDecl() for re-declared readwrite properties, only looks in the ObjCInterface for the declaration of the setter method, which it won't find. When the method is a property accessor, we must look in extensions for a possible redeclaration. Radar-Id: rdar://problem/57991337 Differential Revision: https://reviews.llvm.org/D71588
* Revert "[ASTImporter] Friend class decl should not be visible in its context"Nico Weber2019-12-172-88/+41
| | | | | This reverts commit 4becf68c6f17fe143539ceac954b21175914e1c1. Breaks building on Windows, see comments on D71020
* [driver][darwin] Pass -platform_version flag to the linker instead of the ↵Alex Lorenz2019-12-1712-44/+134
| | | | | | | | | | | -<platform>_version_min flag In Xcode 11, ld added a new flag called -platform_version that can be used instead of the old -<platform>_version_min flags. The new flag allows Clang to pass the SDK version from the driver to the linker. This patch adopts the new -platform_version flag in Clang, and starts using it by default, unless a linker version < 520 is passed to the driver. Differential Revision: https://reviews.llvm.org/D71579
* Reland [NFC-I] Remove hack for fp-classification builtinsErich Keane2019-12-175-43/+134
| | | | | | | | | | | | | | | | | | The FP-classification builtins (__builtin_isfinite, etc) use variadic packs in the definition file to mean an overload set. Because of that, floats were converted to doubles, which is incorrect. There WAS a patch to remove the cast after the fact. THis patch switches these builtins to just be custom type checking, calls the implicit conversions for the integer members, and makes sure the correct L->R casts are put into place, then does type checking like normal. A future direction (that wouldn't be NFC) would consider making conversions for the floating point parameter legal. Note: The initial patch for this missed that certain systems need to still convert half to float, since they dont' support that type.
* [ASTImporter] Friend class decl should not be visible in its contextGabor Marton2019-12-172-41/+88
| | | | | | | | | | | | | | | | | | | Summary: In the past we had to use DeclContext::makeDeclVisibleInContext to make friend declarations available for subsequent lookup calls and this way we could chain (redecl) the structurally equivalent decls. By doing this we created an AST that improperly made declarations visible in some contexts, so the AST was malformed. Since we use the importer specific lookup this is no longer necessary, because with that we can find every previous nodes. Reviewers: balazske, a_sidorin, a.sidorin, shafik Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, teemperor, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71020
* [OpenCL] Add ExtVectorElementExpr constant evaluation (PR42387)Sven van Haastregt2019-12-172-0/+53
| | | | | | | | Add constexpr evaluation for ExtVectorElementExpr nodes by evaluating the underlying vector expression. Add basic folding for the case that Evaluate does not return an LValue. Differential Revision: https://reviews.llvm.org/D71133
* [lit] Remove lit's REQUIRES-ANY directiveThomas Preud'homme2019-12-175-8/+8
| | | | | | | | | | | | | | | | | Summary: Remove REQUIRES-ANY alias lit directive since it is hardly used and can be easily implemented using an OR expression using REQUIRES. Fixup remaining testcases still using REQUIRES-ANY. Reviewers: probinson, jdenny, gparker42 Reviewed By: gparker42 Subscribers: eugenis, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, delcypher, jrtc27, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, lenary, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, cfe-commits, #sanitizers, llvm-commits Tags: #llvm, #clang, #sanitizers Differential Revision: https://reviews.llvm.org/D71408
* [ObjC][DWARF] Emit DW_AT_APPLE_objc_direct for methods marked as ↵Raphael Isemann2019-12-172-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | __attribute__((objc_direct)) Summary: With DWARF5 it is no longer possible to distinguish normal methods and methods with `__attribute__((objc_direct))` by just looking at the debug information as they are both now children of the of the DW_TAG_structure_type that defines them (before only the `__attribute__((objc_direct))` methods were children). This means that in LLDB we are no longer able to create a correct Clang AST of a module by just looking at the debug information. Instead we would need to call the Objective-C runtime to see which of the methods have a `__attribute__((objc_direct))` and then add the attribute to our own Clang AST depending on what the runtime returns. This would mean that we either let the module AST be dependent on the Objective-C runtime (which doesn't seem right) or we retroactively add the missing attribute to the imported AST in our expressions. A third option is to annotate methods with `__attribute__((objc_direct))` as `DW_AT_APPLE_objc_direct` which is what this patch implements. This way LLDB doesn't have to call the runtime for any `__attribute__((objc_direct))` method and the AST in our module will already be correct when we create it. Reviewers: aprantl, SouraVX Reviewed By: aprantl Subscribers: hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm, #debug-info Differential Revision: https://reviews.llvm.org/D71201
* [MinGW] Implicitly add .exe suffix if not providedMartin Storsjö2019-12-173-1/+36
| | | | | | | | | | | | | | | | | GCC implicitly adds an .exe suffix if it is given an output file name, but the file name doesn't contain a suffix, and there are certain users of GCC that rely on this behaviour (and run into issues when trying to use Clang instead of GCC). And MSVC's cl.exe also does the same (but not link.exe). However, GCC only does this when actually running on windows, not when operating as a cross compiler. As GCC doesn't have this behaviour when cross compiling, we definitely shouldn't introduce the behaviour in such cases (as it would break at least as many cases as this fixes). Differential Revision: https://reviews.llvm.org/D71400
* Check whether the destination is a complete type in a static_cast (orRichard Smith2019-12-164-19/+14
| | | | | | | | | C-style cast) to an enumeration type. We previously forgot to check this, and happened to get away with it (with bad diagnostics) only because we misclassified incomplete enumeration types as not being unscoped enumeration types. This also fixes the misclassification.
* [c++20] P1959R0: Remove support for std::*_equality.Richard Smith2019-12-1617-796/+180
|
* If constant evaluation fails due to an unspecified pointer comparison,Richard Smith2019-12-165-30/+34
| | | | | produce a note saying that rather than the default "evaluation failed" note.
* [c++20] Add deprecation warnings for the expression forms deprecated by P1120R0.Richard Smith2019-12-1615-278/+462
| | | | | | | | | | | | | | | | | | | This covers: * usual arithmetic conversions (comparisons, arithmetic, conditionals) between different enumeration types * usual arithmetic conversions between enums and floating-point types * comparisons between two operands of array type The deprecation warnings are on-by-default (in C++20 compilations); it seems likely that these forms will become ill-formed in C++23, so warning on them now by default seems wise. For the first two bullets, off-by-default warnings were also added for all the cases where we didn't already have warnings (covering language modes prior to C++20). These warnings are in subgroups of the existing -Wenum-conversion (except that the first case is not warned on if either enumeration type is anonymous, consistent with our existing -Wenum-conversion warnings).
* [WebAssembly] Setting export_name implies llvm.usedSam Clegg2019-12-162-2/+4
| | | | | | | This change updates the clang front end to add symbols to llvm.used when they have explicit export_name attribute. Differential Revision: https://reviews.llvm.org/D71493
* [coroutines][PR41909] Generalize fix from D62550Brian Gesiak2019-12-162-14/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: In https://reviews.llvm.org/D62550 @rsmith pointed out that there are many situations in which a coroutine body statement may be transformed/rebuilt as part of a template instantiation, and my naive check whether the coroutine was a generic lambda was insufficient. This is indeed true, as I've learned by reading more of the TreeTransform code. Most transformations are written in a way that doesn't assume the resulting types are not dependent types. So the assertion in 'TransformCoroutineBodyStmt', that the promise type must no longer be dependent, is out of place. This patch removes the assertion, spruces up some code comments, and adds a test that would have failed with my naive check from https://reviews.llvm.org/D62550. Reviewers: GorNishanov, rsmith, lewissbaker Reviewed By: rsmith Subscribers: junparser, EricWF, rsmith, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70579
* Revert "[NFC-I] Remove hack for fp-classification builtins"Erich Keane2019-12-164-117/+42
| | | | | | | | | | | This reverts commit b1e542f302c1ed796ad9f703d4d36e010afcb914. The original 'hack' didn't chop out fp-16 to double conversions, so systems that use FP16ConversionIntrinsics end up in IR-CodeGen with an i16 type isntead of a float type (like PPC64-BE). The bots noticed this. Reverting until I figure out how to fix this
* Fix a bug in the property-based serialization ofJohn McCall2019-12-163-1/+19
| | | | | | | | | dependent template names. Apparently we didn't test this in the test suite because we have a lot of redundant ways of representing this situation that kick in in the more common situations. For example, DependentTST stores a qualifier + identifier pair rather than a TemplateName.
* [NFC-I] Remove hack for fp-classification builtinsErich Keane2019-12-164-42/+117
| | | | | | | | | | | | | | | The FP-classification builtins (__builtin_isfinite, etc) use variadic packs in the definition file to mean an overload set. Because of that, floats were converted to doubles, which is incorrect. There WAS a patch to remove the cast after the fact. THis patch switches these builtins to just be custom type checking, calls the implicit conversions for the integer members, and makes sure the correct L->R casts are put into place, then does type checking like normal. A future direction (that wouldn't be NFC) would consider making conversions for the floating point parameter legal.
* [WebAssembly] Replace SIMD int min/max builtins with patternsThomas Lively2019-12-163-142/+1
| | | | | | | | | | | | | | | | | | Summary: The instructions were originally implemented via builtins and intrinsics so users would have to explicitly opt-in to using them. This was useful while were validating whether these instructions should have been merged into the spec proposal. Now that they have been, we can use normal codegen patterns, so the intrinsics and builtins are no longer useful. Reviewers: aheejin Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D71500
* [OPENMP][DOCS]Claim simd nontemporal clause, NFC.Alexey Bataev2019-12-161-1/+1
|
* Forward {read,write}SomeEnumType to {read,write}Enum instead ofJohn McCall2019-12-163-3/+27
| | | | | | directly to {read,write}UInt32. This will be useful for textual formats. NFC.
* Use property-based serialization for TemplateArgument.John McCall2019-12-164-90/+101
|
* Use property-based serialization for TemplateName.John McCall2019-12-164-115/+109
|
* Add the ability for properties to be conditional on other properties.John McCall2019-12-164-19/+75
| | | | This will be required by TemplateName.
* Add the ability to declare helper variables when readingJohn McCall2019-12-163-7/+66
| | | | | | | properties from a value. This is useful when the properties of a case are actually read out of a specific structure, as with TemplateName.
* Use property-based serialization for DeclarationName.John McCall2019-12-163-80/+61
|
* Add the ability to use property-based serialization for "cased" types.John McCall2019-12-1612-89/+450
| | | | | | This patch doesn't actually use this serialization for anything, but follow-ups will move the current handling of various standard types over to this.
* Replace tabs with spaces.John McCall2019-12-162-130/+130
|
* Move Basic{Reader,Writer} emission into ASTPropsEmitter; NFC.John McCall2019-12-161-41/+53
| | | | I'm going to introduce some uses of the property read/write methods.
* Always -I clang/include when tblgen'ing in Clang.John McCall2019-12-163-8/+4
|
* [OPENMP][DOCS]Mark if clause on simd done, NFC.Alexey Bataev2019-12-161-1/+1
|
* [OPENMP50]Add if clause in target teams idistribute simd directive.Alexey Bataev2019-12-164-114/+204
| | | | | | According to OpenMP 5.0, if clause can be used in for simd directive. If condition in the if clause if false, the non-vectorized version of the loop must be executed.
* [TLI] Support for per-Function TLI that overrides available libfuncsTeresa Johnson2019-12-161-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Follow-on to D66428 and D71193, to build the TLI per-function so that -fno-builtin* handling can be migrated to use function attributes. See discussion on D61634 for background. This is an enabler for fixing handling of these options for LTO, for example. With D71193, the -fno-builtin* flags are converted to function attributes, so we can now set this information per-function on the TLI. In this patch, the TLI constructor is changed to take a Function, which can be used to override the available builtins. The TLI is augmented with an array that can be used to specify which builtins are not available for the corresponding function. The available function checks are changed to consult this override before checking the underlying module level baseline TLII. New code is added to set this override array based on the attributes. I also removed the code that sets availability in the TLII in clang from the options, which is no longer needed. I removed a per-Triple caching of TLII objects in the analysis object, as it is based on the Module's Triple which is the same for all functions in any case. Is there a case where we would be compiling multiple Modules with different Triples in one compilation? Finally, I have changed the legacy analysis wrapper to create and use the new PM analysis class (TargetLibraryAnalysis) in getTLI. This is consistent with the behavior of getTTI for the legacy TargetTransformInfo analysis. This change means that getTLI now creates a new TLI on each call (although that should be very cheap as we cache the module level TLII, and computing the per-function attribute based availability should also be reasonably efficient). I measured the compile time for a large C++ file with tens of thousands of functions and as expected there was no increase. Reviewers: chandlerc, hfinkel, gchatelet Subscribers: mehdi_amini, dexonsmith, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67923
* Fixing a -Wcovered-switch diagnostic and changing tabs to spaces; NFC.Aaron Ballman2019-12-161-7/+7
|
* [OPENMP50]Add if clause in target teams distribute parallel for simd directive.Alexey Bataev2019-12-163-12/+38
| | | | | | According to OpenMP 5.0, if clause can be used in for simd directive. If condition in the if clause if false, the non-vectorized version of the loop must be executed.
* Fix floating point builtins to not promote float->doubleErich Keane2019-12-163-7/+78
| | | | | | | | | | | As brought up in D71467, a group of floating point builtins automatically promoted floats to doubles because they used the variadic builtin tag to support an overload set. The result is that the parameters were treated as a variadic pack, which always promots float->double. This resulted in the wrong answer being given in cases with certain values of NaN.
* [clang][SystemZ] Add support for -march=nativeUlrich Weigand2019-12-163-5/+18
| | | | | | Handle -march=native in systemz::getSystemZTargetCPU, similar to how this is done on other platforms. Also change the return type to std::string instead of const char *.
* Silence an MSVC "not all control paths" diagnostic; NFC.Aaron Ballman2019-12-161-0/+1
|
OpenPOWER on IntegriCloud