summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Implicitly assume that a ObjC category to an unavailable interface is also ↵Argyrios Kyrtzidis2011-10-061-2/+1
| | | | | | | | unavailable; only give an 'unavailable' error on the @implementation of the category. rdar://10234078 llvm-svn: 141335
* When using an unavailable/deprecated interface Foo inside Foo's ↵Argyrios Kyrtzidis2011-10-061-1/+2
| | | | | | | | interface/implementation don't emit unavailable errors. llvm-svn: 141334
* Support for C1x _Atomic specifier (see testcase). This is primarily being ↵Eli Friedman2011-10-061-1/+11
| | | | | | | | committed at the moment to help support C++0x <atomic>, but it should be a solid base for implementing the full specification of C1x _Atomic. Thanks to Jeffrey Yasskin for the thorough review! llvm-svn: 141330
* Refactor the analysis of C++ cast expressions so that evenJohn McCall2011-10-051-24/+26
| | | | | | | | C-style and functional casts are built in SemaCXXCast.cpp. Introduce a helper class to encapsulate most of the random state being passed around, at least one level down. llvm-svn: 141170
* c: assignment/init of a function pointer whose function(s)Fariborz Jahanian2011-10-051-0/+3
| | | | | | | | return to one which does not return (has noreturn attribute) should warn as it is an unsafe assignment. // rdar://10095762 c++ already handles this. This is the c version. llvm-svn: 141141
* objc++: Accessing explicit property of reference type need Fariborz Jahanian2011-10-031-1/+7
| | | | | | not bind to a temporary. Fixes //rdar://10188258 llvm-svn: 141009
* Allow getting all source locations of selector identifiers in a ObjCMethodDecl.Argyrios Kyrtzidis2011-10-031-2/+2
| | | | | | | | | | | | | Instead of always storing all source locations for the selector identifiers we check whether all the identifiers are in a "standard" position; "standard" position is -Immediately before the arguments: -(id)first:(int)x second:(int)y; -With a space between the arguments: -(id)first: (int)x second: (int)y; -For nullary selectors, immediately before ';': -(void)release; In such cases we infer the locations instead of storing them. llvm-svn: 140989
* Allow getting all source locations of selector identifiers in a ObjCMessageExpr.Argyrios Kyrtzidis2011-10-031-1/+1
| | | | | | | | | | | | | Instead of always storing all source locations for the selector identifiers we check whether all the identifiers are in a "standard" position; "standard" position is -Immediately before the arguments: [foo first:1 second:2] -With a space between the arguments: [foo first: 1 second: 2] -For nullary selectors, immediately before ']': [foo release] In such cases we infer the locations instead of storing them. llvm-svn: 140987
* CUDA: diagnose invalid calls across targetsPeter Collingbourne2011-10-021-0/+14
| | | | llvm-svn: 140978
* CUDA: add separate diagnostics for too few/many exec config argsPeter Collingbourne2011-10-021-10/+16
| | | | llvm-svn: 140977
* Add ConvertArgumentsForCall diagnostics for at least/at most n argsPeter Collingbourne2011-10-021-4/+9
| | | | llvm-svn: 140976
* CUDA: diagnose unconfigured calls to global functionsPeter Collingbourne2011-10-021-0/+5
| | | | llvm-svn: 140975
* Hey, maybe we shouldn't silently ignore decl attributesJohn McCall2011-10-011-0/+2
| | | | | | on declarators written as types. llvm-svn: 140931
* Minor refactoring. Enumerators may inherit the deprecated/unavailable Fariborz Jahanian2011-09-291-35/+42
| | | | | | | attributes from the enumeration type. // rdar://10201690 llvm-svn: 140818
* c - Enumerators may inherit the deprecated/unavailable Fariborz Jahanian2011-09-291-5/+15
| | | | | | | attributes from the enumeration type. // rdar://10201690 llvm-svn: 140800
* PR11002: Make sure we emit sentinel warnings with a valid source location. ↵Eli Friedman2011-09-271-4/+7
| | | | | | (Ideally, we want to use the location returned by getLocForEndOfToken, but that is not always successful.) llvm-svn: 140658
* Get rid of useless helper Sema::CastCategory.Eli Friedman2011-09-271-1/+1
| | | | llvm-svn: 140642
* Revert r139989 and r140031, which implemented the Objective-C typeDouglas Gregor2011-09-271-24/+2
| | | | | | | | | system change in <rdar://problem/10109725> that allows conversion from 'self' in class methods to the root of the class's hierarchy. This conversion rule is a hack that has non-trivial repurcussions (particularly with overload resolution). llvm-svn: 140605
* Fix regression of -Warray-bounds involving varargs functions [PR 11007].Ted Kremenek2011-09-261-0/+4
| | | | llvm-svn: 140584
* Rename Diagnostic to DiagnosticsEngine as per issue 5397David Blaikie2011-09-251-1/+1
| | | | llvm-svn: 140478
* Give InitListChecker a verification-only mode, where it neither emits ↵Sebastian Redl2011-09-241-6/+18
| | | | | | | | | | | diagnostics nor builds a semantic (structured) initializer list, just reports on whether it can match the given list to the target type. Use this mode for doing init list checking in the initial step of initialization, which will eventually allow us to do overload resolution based on the outcome. llvm-svn: 140457
* [microsoft] In Microsoft mode, if we are inside a template class member ↵Francois Pichet2011-09-241-0/+10
| | | | | | | | | function and we can't resolve an identifier then assume the identifier is type dependent. The goal is to postpone name lookup to instantiation time to be able to search into type dependent base classes. This fixes a few errors when parsing MFC code with clang. BTW clang trunk is now about 5 patches away to be able the parse the default wizard-generated MFC project. llvm-svn: 140452
* objc - fixes a crash when undefined typed propertyFariborz Jahanian2011-09-231-1/+4
| | | | | | | | followed by it implementation crashes when attempt is made to access the synthesized ivar. // rdar://10177744 llvm-svn: 140432
* Removing a bunch of dead returns/breaks after llvm_unreachables.David Blaikie2011-09-231-1/+0
| | | | llvm-svn: 140407
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-231-8/+8
| | | | llvm-svn: 140367
* In OpenCL, conversions between different vector types are disallowedTobias Grosser2011-09-221-1/+5
| | | | | | | | | | | | | | OpenCL 6.2.1 says: "Implicit conversions between built-in vector data types are disallowed." OpenCL 6.2.2 says: "Explicit casts between vector types are not legal." For example: uint4 u = (uint4)(1); int4 i = u; // invalid implicit conversion int4 e = (int4)u; // invalid explicit conversion Fixes PR10967. Submitted by: Anton Lokhmotov <Anton.lokhmotov@gmail.com> llvm-svn: 140300
* In the OpenCL mode, the AltiVec mode must be off and checks must be strictTobias Grosser2011-09-211-1/+2
| | | | | | | | | | OpenCL is different from AltiVec in the way it supports vector literals. OpenCL is strict with regards to semantic checks. For example, implicit conversions and explicit casts between vectors of different types are disallowed. Fixes PR10975. Submitted by: Anton Lokhmotov <Anton.lokhmotov@gmail.com> llvm-svn: 140270
* ArrayRef-ifying Function/BlockDecl's setParamsDavid Blaikie2011-09-211-1/+1
| | | | llvm-svn: 140268
* Change:Richard Trieu2011-09-211-1/+1
| | | | | | | | | | | | assert(!"error message"); To: assert(0 && "error message"); which is more consistant across the code base. llvm-svn: 140232
* Rename SourceLocation::getFileLocWithOffset -> getLocWithOffset.Argyrios Kyrtzidis2011-09-191-2/+2
| | | | | | It already works (and is useful with) macro locs as well. llvm-svn: 140057
* objc - some refactoring of my last 'self' patch.Fariborz Jahanian2011-09-191-8/+11
| | | | llvm-svn: 140031
* objc - Treat type of 'self' in class methods as root ofFariborz Jahanian2011-09-171-1/+20
| | | | | | class of this method. // rdar://10109725 llvm-svn: 139989
* Rename LangOptions::Microsoft to LangOptions::MicrosoftExt to make it clear ↵Francois Pichet2011-09-171-2/+2
| | | | | | | | that this flag must be used only for Microsoft extensions and not emulation; to avoid confusion with the new LangOptions::MicrosoftMode flag. Many of the code now under LangOptions::MicrosoftExt will eventually be moved under the LangOptions::MicrosoftMode flag. llvm-svn: 139987
* Moves calls of checkArithmeticNull() from CreateBuiltinBinOp() into the ↵Richard Trieu2011-09-161-49/+53
| | | | | | individual Check*Operands() functions. llvm-svn: 139895
* Remove no longer needed LHSType and RHSType from checkArithmeticNull()Richard Trieu2011-09-151-3/+1
| | | | llvm-svn: 139879
* Change checkArithmeticNull() to use a NonNullType, instead of checking both theRichard Trieu2011-09-151-14/+6
| | | | | | LHSType and RHSType for everything. llvm-svn: 139878
* reverse patch in r139818 to focus on 'self'Fariborz Jahanian2011-09-151-30/+1
| | | | | | instead of 'Class'. llvm-svn: 139834
* Objective-c: Conversion from type Class to any root class type is allowed Fariborz Jahanian2011-09-151-2/+30
| | | | | | in class methods with no warning. //rdar://10109725 llvm-svn: 139818
* Refactor CheckAdditionOperands() to use early return for pointer addition.Richard Trieu2011-09-121-21/+22
| | | | llvm-svn: 139520
* Fix two comments from warn to emit error to match the actual diagnostic used.Richard Trieu2011-09-121-2/+2
| | | | llvm-svn: 139510
* Silence ?: precendence warning when parenthesis are present.Hans Wennborg2011-09-121-2/+3
| | | | | | | Fixes PR10898. The warning should be silent when there are parenthesis around the condition expression. llvm-svn: 139492
* Rename the ARC cast kinds to start with "ARC".John McCall2011-09-101-2/+2
| | | | llvm-svn: 139466
* When converting a block pointer to an Objective-C pointer type, extendJohn McCall2011-09-101-1/+33
| | | | | | | | | | | the lifetime of the block by copying it to the heap, or else we'll get a dangling reference because the code working with the non-block-typed object will not know it needs to copy. There is some danger here, e.g. with assigning a block literal to an unsafe variable, but, well, it's an unsafe variable. llvm-svn: 139451
* Clean up the sentinel-attribute checking code a lot. DocumentJohn McCall2011-09-091-76/+62
| | | | | | | | | | | | what 'nullPos' is supposed to mean, at least at this one site. Use closed forms for the arithmetic. Rip out some clever but ultimately pointless code that was trying to use 0 or 0L depending the size of a pointer vs. the size of int; first, it didn't work on LLP64 systems, and second, the sentinel checking code requires a pointer-typed value anyway, so this fixit would not have actually removed the warning. llvm-svn: 139361
* Give conversions of block pointers to ObjC pointers a different cast kindJohn McCall2011-09-091-37/+59
| | | | | | | | than conversions of C pointers to ObjC pointers. In order to ensure that we've caught every case, add asserts to CastExpr that strictly determine which cast kind is used for which kind of bit cast. llvm-svn: 139352
* Clean up the RebuildUnknownAnyExpr visitor in SemaExpr.cpp. Mainly swapped ↵Richard Trieu2011-09-091-155/+155
| | | | | | around variable names so that this visitor be more like other visitors in clang. llvm-svn: 139351
* Capitialize paramater names in SemaExpr.cpp and resolve any parameter name ↵Richard Trieu2011-09-091-345/+345
| | | | | | conflicts between declarations and definitions from this and previous refactorings. llvm-svn: 139346
* Change diagnoseAddressOfInvalidType() to use an enum to determine what error ↵Richard Trieu2011-09-071-9/+19
| | | | | | message to display. Also, move the function call into on location instead of having it spread among many places in the if/else statements. llvm-svn: 139260
* Rename variables in SemaExpr.cpp to give a more consistant naming scheme.Richard Trieu2011-09-071-26/+28
| | | | | | | | | | | | | | ExprResult LHS, RHS, Expr *LHSExpr, *RHSExpr QualType LHSType, RHSType Functions changed: DiagnoseLogicalAndInLogicalOrLHS() DiagnoseBinOpPrecedence() ActOnBinOp() BuildBinOp() llvm-svn: 139219
* Rename variables in SemaExpr.cpp to give a more consistant naming scheme.Richard Trieu2011-09-071-73/+75
| | | | | | | | | | | | ExprResult LHS, RHS, Expr *LHSExpr, *RHSExpr QualType LHSType, RHSType Functions changed: CreateBuiltinBinOp() DiagnoseBitwisePrecedence() llvm-svn: 139218
OpenPOWER on IntegriCloud