summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove warning on future change in ivar lookup ruleFariborz Jahanian2011-02-211-14/+0
| | | | | | | when doing the property default synthesis. // rdar://9027673. llvm-svn: 126128
* Implement the C++0x deduced 'auto' feature.Richard Smith2011-02-201-26/+20
| | | | | | This fixes PR 8738, 9060 and 9132. llvm-svn: 126069
* Warn about code that uses variables and functions with internal linkageJohn McCall2011-02-191-7/+19
| | | | | | | | | | | | | | without defining them. This should be an error, but I'm paranoid about "uses" that end up not actually requiring a definition. I'll revisit later. Also, teach IR generation to not set internal linkage on variable declarations, just for safety's sake. Doing so produces an invalid module if the variable is not ultimately defined. Also, fix several places in the test suite where we were using internal functions without definitions. llvm-svn: 126016
* Initial steps to improve diagnostics when there is a NULL andChandler Carruth2011-02-181-0/+46
| | | | | | | | a non-pointer on the two sides of a conditional expression. Patch by Stephen Hines and Mihai Rusu. llvm-svn: 125995
* Selector::getIdentifierInfoForSlot() can return NULL values, a factDouglas Gregor2011-02-181-4/+2
| | | | | | | | | | | | that was ignored in a few places (most notably, code completion). Introduce Selector::getNameForSlot() for the common case where we only care about the name. Audit all uses of getIdentifierInfoForSlot(), switching many over to getNameForSlot(), fixing a few crashers. Fixed <rdar://problem/8939352>, a code-completion crasher. llvm-svn: 125977
* Introduce ASTContext::getLogicalOperationType() to return bool or int, ↵Argyrios Kyrtzidis2011-02-181-3/+3
| | | | | | | | depending on language. No functionality change. llvm-svn: 125957
* When building a qualified reference to a member of an anonymous structDouglas Gregor2011-02-181-6/+7
| | | | | | | | | or union, place the qualifier on the outermost member reference expression, which actually contains the entity name. Fixes PR9188/<rdar://problem/8990184>. llvm-svn: 125822
* Switch labels over to using normal name lookup, instead of their Chris Lattner2011-02-181-22/+7
| | | | | | | own weird little DenseMap. Hey look, we now emit unused label warnings deterministically, amazing. llvm-svn: 125813
* make block bodies handle undefined labels just like functions.Chris Lattner2011-02-171-7/+4
| | | | llvm-svn: 125799
* Step #2/N of __label__ support: keep pushing LabelDecl forward,Chris Lattner2011-02-171-0/+4
| | | | | | | | | | making them be template instantiated in a more normal way and make them handle attributes like other decls. This fixes the used/unused label handling stuff, making it use the same infrastructure as other decls. llvm-svn: 125771
* Change the representation of GNU ?: expressions to use a different expressionJohn McCall2011-02-171-21/+37
| | | | | | | | | | | | | | | | | | | | | | class and to bind the shared value using OpaqueValueExpr. This fixes an unnoticed problem with deserialization of these expressions where the deserialized form would lose the vital pointer-equality trait; or rather, it fixes it because this patch also does the right thing for deserializing OVEs. Change OVEs to not be a "temporary object" in the sense that copy elision is permitted. This new representation is not totally unawkward to work with, but I think that's really part and parcel with the semantics we're modelling here. In particular, it's much easier to fix things like the copy elision bug and to make the CFG look right. I've tried to update the analyzer to deal with this in at least some obvious cases, and I think we get a much better CFG out, but the printing of OpaqueValueExprs probably needs some work. llvm-svn: 125744
* Implement -Wenum-compare, which warns when comparing two enums ofChandler Carruth2011-02-171-2/+18
| | | | | | | | | | | different types. We omit the warning when the enum types are anonymous. Unlike GCC, this warning does not distinguish between C++ and C/ObjC for controling whether it is on by default, it is always on by default. Original patch contributed by Richard Trieu (@ Google), I fixed some style issues, and cleaned it up for submission. llvm-svn: 125739
* Step #1/N of implementing support for __label__: split labels intoChris Lattner2011-02-171-26/+8
| | | | | | | | | | | | | | | | | | | LabelDecl and LabelStmt. There is a 1-1 correspondence between the two, but this simplifies a bunch of code by itself. This is because labels are the only place where we previously had references to random other statements, causing grief for AST serialization and other stuff. This does cause one regression (attr(unused) doesn't silence unused label warnings) which I'll address next. This does fix some minor bugs: 1. "The only valid attribute " diagnostic was capitalized. 2. Various diagnostics printed as ''labelname'' instead of 'labelname' 3. This reduces duplication of label checking between functions and blocks. Review appreciated, particularly for the cindex and template bits. llvm-svn: 125733
* Fix PR9025 and add a diagnostic (and sometimes a fixit) for an overloadedMatt Beaumont-Gay2011-02-171-6/+57
| | | | | | | function name used as the base of a member expression. Early feedback from Chandler Carruth, and code review from Nick Lewycky. llvm-svn: 125714
* Add trivial buffer overflow checking in Sema.Ted Kremenek2011-02-161-0/+8
| | | | llvm-svn: 125640
* Fix think-o I committed without testing, shameful.Daniel Dunbar2011-02-101-1/+1
| | | | llvm-svn: 125299
* Fix a gcc Wuninitialized false positive.Daniel Dunbar2011-02-101-1/+1
| | | | llvm-svn: 125298
* AST, Sema, Serialization: add CUDAKernelCallExpr and related semantic actionsPeter Collingbourne2011-02-091-13/+48
| | | | llvm-svn: 125217
* NonTypeTemplateParmDecl is just a DeclaratorDecl, not a VarDecl.John McCall2011-02-091-62/+126
| | | | | | | Also, reorganize and make very explicit the logic for determining the value kind and type of a referenced declaration. llvm-svn: 125150
* A few more tweaks to the blocks AST representation: John McCall2011-02-071-73/+137
| | | | | | | | | | | | | | | | | - BlockDeclRefExprs always store VarDecls - BDREs no longer store copy expressions - BlockDecls now store a list of captured variables, information about how they're captured, and a copy expression if necessary With that in hand, change IR generation to use the captures data in blocks instead of walking the block independently. Additionally, optimize block layout by emitting fields in descending alignment order, with a heuristic for filling in words when alignment of the end of the block header is insufficient for the most aligned field. llvm-svn: 125005
* pre/post ++/-- for AltiVec vectors. (with builtins-ppc-altivec.c failure fixed)Anton Yartsev2011-02-071-0/+2
| | | | llvm-svn: 125000
* Improve our handling of the current instantiation for qualifiedDouglas Gregor2011-02-041-25/+11
| | | | | | | | | | | | | | id-expression, e.g., CurrentClass<T>::member Previously, if CurrentClass<T> was dependent and not complete, we would treat it as a dependent-scoped declaration reference expression, even if CurrentClass<T> referred to the current instantiation. Fixes PR8966 and improves type checking of templates. llvm-svn: 124867
* When calling a bound pointer to member function, check theDouglas Gregor2011-02-041-0/+20
| | | | | | | cv-qualifiers on the object against the cv-qualifiers on the member function. Fixes PR8315. llvm-svn: 124865
* More capturing of 'this': implicit member expressions. Getting thatJohn McCall2011-02-031-110/+128
| | | | | | | | | | | right for anonymous struct/union members led to me discovering some seemingly broken code in that area of Sema, which I fixed, partly by changing the representation of member pointer constants so that IndirectFieldDecls aren't expanded. This led to assorted cleanups with member pointers in CodeGen, and while I was doing that I saw some random other things to clean up. llvm-svn: 124785
* An insomniac stab at making block declarations list the variables they closeJohn McCall2011-02-021-102/+152
| | | | | | | on, as well as more reliably limiting invalid references to locals from nested scopes. llvm-svn: 124721
* Remove redundant check to not warn for warn_equality_with_extra_parens if we ↵Ted Kremenek2011-02-021-11/+6
| | | | | | are in a macro. This is checked twice. llvm-svn: 124714
* When diagnosing address-space changes, apply array-to-pointer decay first.John McCall2011-02-011-0/+3
| | | | llvm-svn: 124702
* Don't warn about extraneous '()' around a comparison if it occurs within a ↵Ted Kremenek2011-02-011-9/+12
| | | | | | | | | macro. Macros frequently contain extra '()' to make instantiation less error prone. This warning was flagging a ton of times on postgresql because of its use of macros. llvm-svn: 124695
* Don't warn for "if ((a == b))" if the parens came from a macro. Thanks to ↵Argyrios Kyrtzidis2011-02-011-0/+5
| | | | | | Fariborz for the hint! llvm-svn: 124689
* For "if ((a == b))" only warn if 'a' is a modifiable l-value. Caught by John!Argyrios Kyrtzidis2011-02-011-1/+3
| | | | llvm-svn: 124675
* Warn for "if ((a == b))" where the equality expression is needlessly wrapped ↵Argyrios Kyrtzidis2011-02-011-0/+22
| | | | | | | | | | inside parentheses. It's highly likely that the user intended an assignment used as condition. Addresses rdar://8848646. llvm-svn: 124668
* Perform the bad-address-space conversions check as part of John McCall2011-02-011-18/+38
| | | | | | CheckPointerTypesForAssignment. llvm-svn: 124632
* Make Check*PointerTypesForAssignment private and tell them that they'reJohn McCall2011-01-311-73/+63
| | | | | | working on canonical types already. llvm-svn: 124618
* Slightly reorganize CheckAssignmentConstraints and remove some redundantJohn McCall2011-01-311-65/+87
| | | | | | logic. llvm-svn: 124615
* Error for use of field from anonymous struct or union should say "invalid ↵Argyrios Kyrtzidis2011-01-311-1/+1
| | | | | | | | use of nonstatic data member" not "call to non-static member function without an object argument". llvm-svn: 124576
* Amazing that there are still issues with the fields of anonymous struct/unions..Argyrios Kyrtzidis2011-01-311-9/+21
| | | | | | Allow taking the address of such a field for a pointer-to-member constant. Fixes rdar://8818236. llvm-svn: 124575
* Give OpaqueValueExpr a source location, because its source locationDouglas Gregor2011-01-281-3/+4
| | | | | | | | might be queried in places where we absolutely require a valid location (e.g., for template instantiation). Fixes some major brokenness in the use of __is_convertible_to. llvm-svn: 124465
* Tweak the rule for deciding if a provisional ivar is neededFariborz Jahanian2011-01-261-1/+2
| | | | | | in default ivar synthesis. Fixes // rdar://8913053. llvm-svn: 124258
* Fix infinite loop during error diagnostics. Fixes rdar://8875304.Argyrios Kyrtzidis2011-01-251-1/+1
| | | | llvm-svn: 124243
* Revert r124146 for now. It appears to be failing on a few platforms.Eric Christopher2011-01-241-2/+0
| | | | llvm-svn: 124153
* pre/post increase/decrease for AltiVec vectorsAnton Yartsev2011-01-241-0/+2
| | | | llvm-svn: 124146
* Warn about the use of unparenthesized |= in conditionals (which may beDouglas Gregor2011-01-191-5/+15
| | | | | | a typo for !=). Fixes PR9001, from Hans Wennborg! llvm-svn: 123836
* Change QualType::getTypePtr() to return a const pointer, then change aJohn McCall2011-01-191-1/+1
| | | | | | thousand other things which were (generally inadvertantly) relying on that. llvm-svn: 123814
* lib/Sema/SemaExpr.cpp: __null should be LongLongTy on LLP64 Win64.NAKAMURA Takumi2011-01-191-2/+9
| | | | llvm-svn: 123791
* Properly do a float -> _Complex double conversion, fixes rdar://8875946.Argyrios Kyrtzidis2011-01-181-1/+2
| | | | llvm-svn: 123759
* Add support for explicit constructor calls in Microsoft mode.Francois Pichet2011-01-181-0/+6
| | | | | | | | | | | | | | | | | | | For example: class A{ public: A& operator=(const A& that) { if (this != &that) { this->A::~A(); this->A::A(that); // <=== explicit constructor call. } return *this; } }; More work will be needed to support an explicit call to a template constructor. llvm-svn: 123735
* Fix warnings found by gcc-4.6, from -Wunused-but-set-variable andJeffrey Yasskin2011-01-181-1/+1
| | | | | | -Wint-to-pointer-cast. llvm-svn: 123719
* Add a comment for r123231.Francois Pichet2011-01-111-0/+2
| | | | llvm-svn: 123291
* In Microsoft mode, force 64 bit hex integer constants to signed type if the ↵Francois Pichet2011-01-111-1/+2
| | | | | | | | | | | | | | | | | LL or i64 suffix is used. This MSVC behavior. For example: void f(long long){ printf("long long"); } void f(unsigned long long) { printf("unsigned long long"); } int main() { f(0xffffffffffffffffLL); } Will print "long long" using MSVC. This patch also fixes 16 compile errors related to overloading issues when parsing the MSVC 2008 C++ standard lib. llvm-svn: 123231
* Use the proper enum as parameter, instead of unsigned. No functionality change.Argyrios Kyrtzidis2011-01-051-8/+5
| | | | llvm-svn: 122900
OpenPOWER on IntegriCloud