summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* Don't emit undefined-internal warnings for CXXDeductionGuideDecls.Richard Smith2017-08-031-0/+3
| | | | | | Patch by ~paul (cynecx on phabricator)! Some test massaging by me. llvm-svn: 309975
* [Sema] Add a comment on an identified bug on default arguments.Tim Shen2017-08-031-0/+16
| | | | | | | | | | | | | | | Summary: The mis-compile is triggered by internal code, but I haven't reduced it to a small piece of code. Add a FIXME here, since a decent fix doesn't seem to be trivial. The decent fix can be changing Decl::Init to PointerUnion<Stmt *, EvaluatedStmt *, ParamVarDecl *>, and make setUninstantiatedDefaultArg take a ParamVarDecl *, which contains the Expr * as the default argument. This way, getTemplateInstantiationArgs can take that ParamVarDecl and do the right thing. Reviewers: rsmith Subscribers: sanjoy, cfe-commits Differential Revision: https://reviews.llvm.org/D36253 llvm-svn: 309908
* Revert "Thread Safety Analysis: fix assert_capability."Josh Gao2017-08-011-5/+1
| | | | | | | | This reverts commit rL309725. Broke test/Sema/attr-capabilities.c. llvm-svn: 309731
* Thread Safety Analysis: fix assert_capability.Josh Gao2017-08-011-1/+5
| | | | | | | | | | | | | | | | Summary: Previously, the assert_capability attribute was completely ignored by thread safety analysis. Reviewers: delesley, rnk Reviewed By: delesley Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D36122 llvm-svn: 309725
* [Sema] Fix lax conversion between non ext vectorsBruno Cardoso Lopes2017-08-011-1/+1
| | | | | | | | | | r282968 introduced a regression due to the lack of proper testing. Re-add lax conversion support between non ext vectors for compound assignments and add a test for that. rdar://problem/28639467 llvm-svn: 309722
* [OpenCL] Add missing subgroup builtinsJoey Gouly2017-08-011-0/+32
| | | | | | | This adds get_kernel_max_sub_group_size_for_ndrange and get_kernel_sub_group_count_for_ndrange. llvm-svn: 309678
* Fix -Wshadow false positives with function-local classes.Alexander Kornienko2017-07-311-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Fixes http://llvm.org/PR33947. https://godbolt.org/g/54XRMT void f(int a) { struct A { void g(int a) {} A() { int a; } }; } 3 : <source>:3:16: warning: declaration shadows a local variable [-Wshadow] void g(int a) {} ^ 1 : <source>:1:12: note: previous declaration is here void f(int a) { ^ 4 : <source>:4:15: warning: declaration shadows a local variable [-Wshadow] A() { int a; } ^ 1 : <source>:1:12: note: previous declaration is here void f(int a) { ^ 2 warnings generated. The local variable `a` of the function `f` can't be accessed from a method of the function-local class A, thus no shadowing occurs and no diagnostic is needed. Reviewers: rnk, rsmith, arphaman, Quuxplusone Reviewed By: rnk, Quuxplusone Subscribers: Quuxplusone, cfe-commits Differential Revision: https://reviews.llvm.org/D35941 llvm-svn: 309569
* [OpenCL] Add extension Sema check for subgroup builtinsJoey Gouly2017-07-311-2/+23
| | | | | | Check the subgroup extension is enabled, before doing other Sema checks. llvm-svn: 309567
* -Wpragma-pack: add an additional note and fixit when warningAlex Lorenz2017-07-311-1/+15
| | | | | | | | | about unterminated push directives that are followed by a reset ('#pragma pack()') This has been suggested by Hans Wennborg. llvm-svn: 309559
* [Sema] Fix operator lookup to consider local extern declarations.Eric Fiselier2017-07-311-1/+2
| | | | | | | | | | | | | | | | | | | | | | Summary: Previously Clang was not considering operator declarations that occur at function scope. This is incorrect according to [over.match.oper]p3 > The set of non-member candidates is the result of the unqualified lookup of operator@ in the context of the expression according to the usual rules for name lookup in unqualified function calls. This patch changes operator name lookup to consider block scope declarations. This patch fixes PR27027. Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D35297 llvm-svn: 309530
* Recommit r308327 3rd time: Add a warning for missingAlex Lorenz2017-07-282-1/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '#pragma pack (pop)' and suspicious uses of '#pragma pack' in included files The second recommit (r309106) was reverted because the "non-default #pragma pack value chages the alignment of struct or union members in the included file" warning proved to be too aggressive for external projects like Chromium (https://bugs.chromium.org/p/chromium/issues/detail?id=749197). This recommit makes the problematic warning a non-default one, and gives it the -Wpragma-pack-suspicious-include warning option. The first recommit (r308441) caused a "non-default #pragma pack value might change the alignment of struct or union members in the included file" warning in LLVM itself. This recommit tweaks the added warning to avoid warnings for #includes that don't have any records that are affected by the non-default alignment. This tweak avoids the previously emitted warning in LLVM. Original message: This commit adds a new -Wpragma-pack warning. It warns in the following cases: - When a translation unit is missing terminating #pragma pack (pop) directives. - When entering an included file if the current alignment value as determined by '#pragma pack' directives is different from the default alignment value. - When leaving an included file that changed the state of the current alignment value. rdar://10184173 Differential Revision: https://reviews.llvm.org/D35484 llvm-svn: 309386
* [OPENMP] Allow all lvalues in 'depend' clause.Alexey Bataev2017-07-271-9/+12
| | | | | | | According to upcoming OpenMP 5.0 all addressable lvalue expressions are allowed in deoend clause. llvm-svn: 309309
* [OPENMP] Codegen for 'in_reduction' clause.Alexey Bataev2017-07-271-16/+74
| | | | | | | | | | | | | | | | | | Added codegen for task-based directive with in_reduction clause. ``` <body> ``` The next code is emitted: ``` void *td; ... td = call i8* @__kmpc_task_reduction_init(); ... <type> *priv = (<type> *)call i8* @__kmpc_task_reduction_get_th_data(i32 GTID, i8* td, i8* <orig>) ``` llvm-svn: 309270
* Revert r309106 "Recommit r308327 2nd time: Add a warning for missing"Hans Wennborg2017-07-262-108/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The warning fires on non-suspicious code in Chromium. Reverting until a solution is figured out. > Recommit r308327 2nd time: Add a warning for missing > '#pragma pack (pop)' and suspicious uses of '#pragma pack' in included files > > The first recommit (r308441) caused a "non-default #pragma pack value might > change the alignment of struct or union members in the included file" warning > in LLVM itself. This recommit tweaks the added warning to avoid warnings for > #includes that don't have any records that are affected by the non-default > alignment. This tweak avoids the previously emitted warning in LLVM. > > Original message: > > This commit adds a new -Wpragma-pack warning. It warns in the following cases: > > - When a translation unit is missing terminating #pragma pack (pop) directives. > - When entering an included file if the current alignment value as determined > by '#pragma pack' directives is different from the default alignment value. > - When leaving an included file that changed the state of the current alignment > value. > > rdar://10184173 > > Differential Revision: https://reviews.llvm.org/D35484 llvm-svn: 309186
* unguarded availability: add a fixit for the "annotate '...'Alex Lorenz2017-07-261-2/+66
| | | | | | | | | | with an availability attribute to silence" note rdar://33539233 Differential Revision: https://reviews.llvm.org/D35726 llvm-svn: 309116
* Recommit r308327 2nd time: Add a warning for missingAlex Lorenz2017-07-262-1/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | '#pragma pack (pop)' and suspicious uses of '#pragma pack' in included files The first recommit (r308441) caused a "non-default #pragma pack value might change the alignment of struct or union members in the included file" warning in LLVM itself. This recommit tweaks the added warning to avoid warnings for #includes that don't have any records that are affected by the non-default alignment. This tweak avoids the previously emitted warning in LLVM. Original message: This commit adds a new -Wpragma-pack warning. It warns in the following cases: - When a translation unit is missing terminating #pragma pack (pop) directives. - When entering an included file if the current alignment value as determined by '#pragma pack' directives is different from the default alignment value. - When leaving an included file that changed the state of the current alignment value. rdar://10184173 Differential Revision: https://reviews.llvm.org/D35484 llvm-svn: 309106
* Revert "This patch enables the usage of constant Enum identifiers within ↵Eric Christopher2017-07-251-16/+6
| | | | | | | | Microsoft style inline assembly statements." as it is causing msan failures. This reverts commits r308985 and r308965 llvm-svn: 309004
* [OPENMP] Codegen for 'task_reduction' clause.Alexey Bataev2017-07-251-36/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added codegen for taskgroup directive with task_reduction clause. ``` <body> ``` The next code is emitted: ``` %struct.kmp_task_red_input_t red_init[n]; void *td; call void @__kmpc_taskgroup(%ident_t id, i32 gtid) ... red_init[i].shar = &<item>; red_init[i].size = sizeof(<item>); red_init[i].init = (void*)initializer_function; red_init[i].fini = (void*)destructor_function; red_init[i].comb = (void*)combiner_function; red_init[i].flags = flags; ... td = call i8* @__kmpc_task_reduction_init(i32 gtid, i32 n, i8* (void*)red_init); call void @__kmpc_end_taskgroup(%ident_t id, i32 gtid) void initializer_function(i8* priv) { *(<type>*)priv = <red_init>; ret void; } void destructor_function(i8* priv) { (<type>*)priv->~(); ret void; } void combiner_function(i8* inout, i8* in) { *(<type>*)inout = *(<type>*)inout <red_id> *(<type>*)in; ret void; } ``` llvm-svn: 308979
* This patch enables the usage of constant Enum identifiers within Microsoft ↵Matan Haroush2017-07-251-6/+16
| | | | | | | | | | style inline assembly statements. Differential Revision: https://reviews.llvm.org/D33277 https://reviews.llvm.org/D33278 llvm-svn: 308965
* [OPENMP] Fix the restrictions for in_reduction clause.Alexey Bataev2017-07-241-38/+53
| | | | | | | This patch allows to use in_reduction clause even if the innermost directive is not taskgroup. llvm-svn: 308883
* Inline variable into assert to fix unused warning.Richard Trieu2017-07-211-4/+2
| | | | llvm-svn: 308783
* [OPENMP] Fix build problem, NFC.Alexey Bataev2017-07-211-5/+3
| | | | llvm-svn: 308773
* [OPENMP] Initial support for 'in_reduction' clause.Alexey Bataev2017-07-212-0/+249
| | | | | | | Parsing/sema analysis for 'in_reduction' clause for task-based directives. llvm-svn: 308768
* [OPENMP] Simplify analysis of data-sharing attributes.Alexey Bataev2017-07-211-83/+48
| | | | llvm-svn: 308759
* Fixed failing assert in code completion.Ilya Biryukov2017-07-211-4/+1
| | | | | | | | | | | | | | | | Summary: The code was accessing uninstantiated default argument. This resulted in failing assertion at ParmVarDecl::getDefaultArg(). Reviewers: erikjv, klimek, bkramer, krasimir Reviewed By: krasimir Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D35682 llvm-svn: 308722
* [CodeGen][mips] Support `long_call/far/near` attributesSimon Atanasyan2017-07-201-0/+8
| | | | | | | | | | | This patch adds support for the `long_call`, `far`, and `near` attributes for MIPS targets. The `long_call` and `far` attributes are synonyms. All these attributes override `-mlong-calls` / `-mno-long-calls` command line options for particular function. Differential revision: https://reviews.llvm.org/D35479 llvm-svn: 308667
* [OPENMP] Fix DSA processing for member declaration.Alexey Bataev2017-07-202-33/+35
| | | | | | | | If the member declaration is captured in the OMPCapturedExprDecl, we may loose data-sharing attribute info for this declaration. Patch fixes this bug. llvm-svn: 308629
* Improve SEMA for attribute-targetErich Keane2017-07-191-8/+29
| | | | | | | | Add more diagnosis for the non-multiversioning case. Differential Revision: https://reviews.llvm.org/D35573 llvm-svn: 308539
* [Sema] Improve diagnostic message for unavailable C++17 alignedAkira Hatanaka2017-07-191-2/+7
| | | | | | | | | | | | | | | | | | allocation functions. This changes the error message Sema prints when an unavailable C++17 aligned allocation function is selected. Original message: "... possibly unavailable on x86_64-apple-macos10.12" New message: "... only available on macOS 10.13 or newer" This is a follow-up to r306722. rdar://problem/32664169 Differential Revision: https://reviews.llvm.org/D35520 llvm-svn: 308496
* Revert r308441 "Recommit r308327: Add a warning for missing '#pragma pack ↵Hans Wennborg2017-07-192-90/+1
| | | | | | | | | | | | | | | | | | | | | (pop)' and suspicious uses of '#pragma pack' in included files" This seems to have broken the sanitizer-x86_64-linux buildbot. Reverting until it's fixed, especially since this landed just before the 5.0 branch. > This commit adds a new -Wpragma-pack warning. It warns in the following cases: > > - When a translation unit is missing terminating #pragma pack (pop) directives. > - When entering an included file if the current alignment value as determined > by '#pragma pack' directives is different from the default alignment value. > - When leaving an included file that changed the state of the current alignment > value. > > rdar://10184173 > > Differential Revision: https://reviews.llvm.org/D35484 llvm-svn: 308455
* Recommit r308327: Add a warning for missing '#pragma pack (pop)'Alex Lorenz2017-07-192-1/+90
| | | | | | | | | | | | | | | | | | and suspicious uses of '#pragma pack' in included files This commit adds a new -Wpragma-pack warning. It warns in the following cases: - When a translation unit is missing terminating #pragma pack (pop) directives. - When entering an included file if the current alignment value as determined by '#pragma pack' directives is different from the default alignment value. - When leaving an included file that changed the state of the current alignment value. rdar://10184173 Differential Revision: https://reviews.llvm.org/D35484 llvm-svn: 308441
* Fix compilation problem introduced in r308433Erik Verbruggen2017-07-191-1/+1
| | | | llvm-svn: 308438
* Add default values for function parameter chunksErik Verbruggen2017-07-191-3/+40
| | | | | | | | | | | Append optional chunks with their default values. For example: before - "int i", after - "int i = 10" Patch by Ivan Donchevskii! Differential Revision: https://reviews.llvm.org/D33644 llvm-svn: 308433
* [Sema] NFC: Move all availability checking code to SemaDeclAttr.cppErik Pilkington2017-07-182-90/+98
| | | | | | Previously, this was awkwardly split up between SemaExpr.cpp. llvm-svn: 308356
* [OPENMP] Initial support for 'task_reduction' clause.Alexey Bataev2017-07-182-18/+114
| | | | | | Parsing/sema analysis of the 'task_reduction' clause. llvm-svn: 308352
* Don't set TUScope to null when generating a module in incremental processing ↵Raphael Isemann2017-07-181-1/+2
| | | | | | | | | | | | | | | | mode. Summary: When in incremental processing mode, we should never set `TUScope` to a nullptr otherwise any future lookups fail. We already have similar checks in the rest of the code, but we never hit this one because so far we didn't try to generate a module from the AST that Cling generates. Reviewers: rsmith, v.g.vassilev Reviewed By: v.g.vassilev Subscribers: cfe-commits, v.g.vassilev Differential Revision: https://reviews.llvm.org/D35536 llvm-svn: 308333
* Revert r308327Alex Lorenz2017-07-182-90/+1
| | | | | | I forgot to test clang-tools-extra which is now failing. llvm-svn: 308328
* Add a warning for missing '#pragma pack (pop)' and suspicious usesAlex Lorenz2017-07-182-1/+90
| | | | | | | | | | | | | | | | | | of '#pragma pack' in included files This commit adds a new -Wpragma-pack warning. It warns in the following cases: - When a translation unit is missing terminating #pragma pack (pop) directives. - When entering an included file if the current alignment value as determined by '#pragma pack' directives is different from the default alignment value. - When leaving an included file that changed the state of the current alignment value. rdar://10184173 Differential Revision: https://reviews.llvm.org/D35484 llvm-svn: 308327
* [OPENMP] Generalization of sema analysis of reduction-based clauses,Alexey Bataev2017-07-181-132/+172
| | | | | | NFC. llvm-svn: 308317
* [AArch64] Add support for __builtin_ms_va_list on aarch64Martin Storsjo2017-07-172-10/+9
| | | | | | | | | | | Move builtins from the x86 specific scope into the global scope. Their use is still limited to x86_64 and aarch64 though. This allows wine on aarch64 to properly handle variadic functions. Differential Revision: https://reviews.llvm.org/D34475 llvm-svn: 308218
* [SystemZ] Add support for IBM z14 processor (2/3)Ulrich Weigand2017-07-171-2/+4
| | | | | | | | | | This patch extends the -fzvector language feature to enable the new "vector float" data type when compiling at -march=z14. This matches the updated extension definition implemented by other compilers for the platform, which is indicated to applications by pre-defining __VEC__ to 10302 (instead of 10301). llvm-svn: 308198
* [SystemZ] Add support for IBM z14 processor (1/3)Ulrich Weigand2017-07-171-0/+7
| | | | | | | | | | | This patch series adds support for the IBM z14 processor. This part includes: - Basic support for the new processor and its features. - Support for low-level builtins mapped to new LLVM intrinsics. Support for the -fzvector extension to vector float and the new high-level vector intrinsics is provided by separate patches. llvm-svn: 308197
* [NFC] Refactor the Preprocessor function that handles Macro definitions and ↵Faisal Vali2017-07-171-3/+3
| | | | | | | | | | | | | | | | | rename Arguments to Parameters in Macro Definitions. - Extracted the reading of the tokens out into a separate function. - Replace 'Argument' with 'Parameter' when referring to the identifiers of the macro definition (as opposed to the supplied arguments - MacroArgs - during the macro invocation). This is in preparation for submitting patches for review to implement __VA_OPT__ which will otherwise just keep lengthening the HandleDefineDirective function and making it less comprehensible. I will also directly update some extra clang tooling that is broken by the change from Argument to Parameter. Hopefully the bots will stay appeased. Thanks! llvm-svn: 308190
* [OPENMP] Codegen for reduction clauses in 'taskloop' directives.Alexey Bataev2017-07-171-0/+2
| | | | | | Adds codegen for taskloop-based directives. llvm-svn: 308174
* Revert changes from my previous refactoring - will need to fix dependencies ↵Faisal Vali2017-07-171-3/+3
| | | | | | | | in clang's extra tooling (such as clang-tidy etc.). Sorry about that. llvm-svn: 308158
* [NFC] Refactor the Preprocessor function that handles Macro definitions and ↵Faisal Vali2017-07-171-3/+3
| | | | | | | | | | | | | | rename Arguments to Parameters in Macro Definitions. - Extracted the reading of the tokens out into a separate function. - Replace 'Argument' with 'Parameter' when referring to the identifiers of the macro definition (as opposed to the supplied arguments - MacroArgs - during the macro invocation). This is in preparation for submitting patches for review to implement __VA_OPT__ which will otherwise just keep lengthening the HandleDefineDirective function and making it less comprehensible. Thanks! llvm-svn: 308157
* Use ARC parsing rules for ns_returns_retained in MRC so that code canJohn McCall2017-07-152-17/+37
| | | | | | | | be shared without warnings. Build AttributedTypes to leave breadcrumbs for tools like the static analyzer. Warn about attempting to use the attribute with incompatible return types. llvm-svn: 308092
* Change dyn_casts with unused variables to isa statements to avoid unused ↵Eric Christopher2017-07-141-1/+1
| | | | | | variables. llvm-svn: 307988
* Extend -Wdeprecated-implementations to warn about unavailable methodsAlex Lorenz2017-07-131-1/+11
| | | | | | rdar://22867595 llvm-svn: 307924
* NFC, Cleanup the code for -Wdeprecated-implementationsAlex Lorenz2017-07-131-22/+28
| | | | | | | | and void capitalization of the warning message rdar://22867595 llvm-svn: 307923
OpenPOWER on IntegriCloud