summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/address_spaces.c
Commit message (Collapse)AuthorAgeFilesLines
* Recommit r359859 "[Attribute/Diagnostics] Print macro if definition is an ↵Leonard Chan2019-05-071-1/+1
| | | | | | | | attribute declaration" Updated with fix for read of uninitialized memory. llvm-svn: 360109
* Revert "[Attribute/Diagnostics] Print macro if definition is an attribute ↵Leonard Chan2019-05-031-1/+1
| | | | | | | | declaration" This reverts commit fc40cbd9d8c63e65eed3590ba925321afe782e1d. llvm-svn: 359859
* [Attribute/Diagnostics] Print macro if definition is an attribute declarationLeonard Chan2019-05-021-1/+1
| | | | | | | | | | | | | If an address_space attribute is defined in a macro, print the macro instead when diagnosing a warning or error for incompatible pointers with different address_spaces. We allow this for all attributes (not just address_space), and for multiple attributes declared in the same macro. Differential Revision: https://reviews.llvm.org/D51329 llvm-svn: 359826
* Forbid address spaces on compound literals in local scope.John McCall2018-09-051-0/+14
| | | | | | Patch by Bevin Hansson! llvm-svn: 341491
* [Sema] Fix for crash on conditional operation with address_space pointerLeonard Chan2018-08-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | Compiling the following causes clang to crash ``` char *cmp(__attribute__((address_space(1))) char *x, __attribute__((address_space(2))) char *y) { return x < y ? x : y; } ``` with the message: "wrong cast for pointers in different address spaces(must be an address space cast)!" This is because during IR emission, the source and dest type for a bitcast should not have differing address spaces. This fix prints an error since the code shouldn't compile in the first place. Differential Revision: https://reviews.llvm.org/D50278 llvm-svn: 339167
* [Sema] Allow creating types with multiple of the same addrspace.Alexey Bader2018-06-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The comment with the OpenCL clause about this clearly says: "No type shall be qualified by qualifiers for two or more different address spaces." This must mean that two or more qualifiers for the _same_ address space is allowed. However, it is likely unintended by the programmer, so emit a warning. For dependent address space types, reject them like before since we cannot know what the address space will be. Patch by Bevin Hansson (ebevhan). Reviewers: Anastasia Reviewed By: Anastasia Subscribers: bader, cfe-commits Differential Revision: https://reviews.llvm.org/D47630 llvm-svn: 335103
* [OpenCL] Map default address space to alloca address spaceYaxun Liu2017-04-111-1/+1
| | | | | | | | | | | | | | For OpenCL, the private address space qualifier is 0 in AST. Before this change, 0 address space qualifier is always mapped to target address space 0. As now target private address space is specified by alloca address space in data layout, address space qualifier 0 needs to be mapped to alloca addr space specified by the data layout. This change has no impact on targets whose alloca addr space is 0. With contributions from Matt Arsenault, Tony Tye and Wen-Heng (Jack) Chung Differential Revision: https://reviews.llvm.org/D31404 llvm-svn: 299965
* [MSVC] Implementation of __unaligned as a proper type qualifierAndrey Bokhanko2016-05-111-2/+2
| | | | | | | | | | | This patch implements __unaligned (MS extension) as a proper type qualifier (before that, it was implemented as an ignored attribute). It also fixes PR27367 and PR27666. Differential Revision: http://reviews.llvm.org/D20103 llvm-svn: 269220
* Revert r268727, it caused PR27666.Nico Weber2016-05-061-2/+2
| | | | llvm-svn: 268736
* [MSVC] Implementation of __unaligned as a proper type qualifierAndrey Bokhanko2016-05-061-2/+2
| | | | | | | | | | | This patch implements __unaligned (MS extension) as a proper type qualifier (before that, it was implemented as an ignored attribute). It also fixes PR27367. Differential Revision: http://reviews.llvm.org/D19654 llvm-svn: 268727
* Revert r266415, it broke parsing SDK headers (PR27367).Nico Weber2016-04-151-2/+2
| | | | llvm-svn: 266431
* [MSVC Compat] Implementation of __unaligned (MS extension) as a type qualifierAndrey Bokhanko2016-04-151-2/+2
| | | | | | | | | | | This patch implements __unaligned as a type qualifier; before that, it was modeled as an attribute. Proper mangling of __unaligned is implemented as well. Some OpenCL code/tests are tangenially affected, as they relied on existing number and sizes of type qualifiers. Differential Revision: http://reviews.llvm.org/D18596 llvm-svn: 266415
* [OpenCL] Add missing OpenCL LangOpts in address space compatibility checksAnastasia Stulova2015-09-301-0/+5
| | | | | | | | | and test checking broken (due to CL specific diagnostics) C functionality M test/Sema/address_spaces.c M lib/Sema/SemaExpr.cpp llvm-svn: 248902
* Replacing err_attribute_argument_not_int with err_attribute_not_type_attrAaron Ballman2013-07-301-1/+1
| | | | llvm-svn: 187419
* Removed a redundant diagnostic and replaced it with a more standard one. ↵Aaron Ballman2013-07-231-0/+1
| | | | | | Added a test case for the diagnostic. llvm-svn: 186942
* Add test for PR4997. This has been fixed for a while.Richard Smith2013-07-041-0/+1
| | | | llvm-svn: 185614
* Fix assertion failure when a field is given an address space.Matt Arsenault2013-02-261-1/+18
| | | | llvm-svn: 176122
* Forbid address-space-qualified function types, per TR 18037Peter Collingbourne2011-07-271-0/+4
| | | | llvm-svn: 136257
* When diagnosing address-space changes, apply array-to-pointer decay first.John McCall2011-02-011-0/+5
| | | | llvm-svn: 124702
* Perform the bad-address-space conversions check as part of John McCall2011-02-011-2/+1
| | | | | | CheckPointerTypesForAssignment. llvm-svn: 124632
* make clang print types as "const int *" instead of "int const*",Chris Lattner2010-09-051-1/+1
| | | | | | | which is should have done from the beginning. As usual, the most fun with this sort of change is updating all the testcases. llvm-svn: 113090
* Refer to implicit "conversions" rather than implicit "casts", whichDouglas Gregor2010-07-091-1/+1
| | | | | | don't technically exist in the language. <rdar://problem/8085982> llvm-svn: 107995
* Improve diagnostics when we fail to convert from a source type to aDouglas Gregor2010-04-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | destination type for initialization, assignment, parameter-passing, etc. The main issue fixed here is that we used rather confusing wording for diagnostics such as t.c:2:9: warning: initializing 'char const [2]' discards qualifiers, expected 'char *' [-pedantic] char *name = __func__; ^ ~~~~~~~~ We're not initializing a 'char const [2]', we're initializing a 'char *' with an expression of type 'char const [2]'. Similar problems existed for other diagnostics in this area, so I've normalized them all with more precise descriptive text to say what we're initializing/converting/assigning/etc. from and to. The warning for the code above is now: t.c:2:9: warning: initializing 'char *' from an expression of type 'char const [2]' discards qualifiers [-pedantic] char *name = __func__; ^ ~~~~~~~~ Fixes <rdar://problem/7447179>. llvm-svn: 100832
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-151-1/+1
| | | | | | | | | - This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target). llvm-svn: 91446
* Add an error for function parameters that have a qualified address space ↵Tanya Lattner2009-09-301-2/+6
| | | | | | since this is not allowed by the embedded c extension spec. llvm-svn: 83165
* Refactor the representation of qualifiers to bring ExtQualType out of theJohn McCall2009-09-241-1/+1
| | | | | | | | Type hierarchy. Demote 'volatile' to extended-qualifier status. Audit our use of qualifiers and fix a few places that weren't dealing with qualifiers quite right; many more remain. llvm-svn: 82705
* Bounds checking for address spaces.John McCall2009-07-281-0/+6
| | | | llvm-svn: 77303
* fix rdar://6774906, a crash handling implicit conversions between pointersChris Lattner2009-04-131-0/+8
| | | | | | in different address spaces. llvm-svn: 68941
* Rename clang to clang-cc.Daniel Dunbar2009-03-241-1/+1
| | | | | | Tests and drivers updated, still need to shuffle dirs. llvm-svn: 67602
* upgrade various 'implicit int' warnings from an ext-warn to warning when notChris Lattner2009-02-271-1/+1
| | | | | | | | in C89 mode. This makes it enabled by default instead of only enabled with -pedantic. Clang defaults to c99 mode, so people will see this more often than with GCC, but they can always use -std=c89 if they really want c89. llvm-svn: 65647
* testcase that works now with r62061Chris Lattner2009-01-121-0/+5
| | | | llvm-svn: 62062
* Extend QualType::getAddressSpace to do the right thing for array types, and inNate Begeman2008-03-251-1/+2
| | | | | | the future, RecordTypes. llvm-svn: 48784
* Correctly error on arrays with automatic storage full of objects with Nate Begeman2008-03-141-2/+3
| | | | | | | non-default address space, and fix comment. Add a test for this. llvm-svn: 48366
* ISO/IEC TR 18037 Nate Begeman2008-03-141-0/+2
| | | | | | | | An address space name cannot be used to qualify an object that has automatic storage duration. Still not catching ASQual'd allocas of array type, just scalars at the moment. llvm-svn: 48350
* add some semantic checks for address spaces.Chris Lattner2008-02-211-0/+15
llvm-svn: 47423
OpenPOWER on IntegriCloud