summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Second attempt at implementation transfer function support for ↵Ted Kremenek2008-11-141-35/+52
| | | | | | ObjCForCollectionStmt. We now assume that the 'element' expression can be any lvalue. llvm-svn: 59313
* Flow-sensitive uninitialized values analysis: properly handle the 'element' ↵Ted Kremenek2008-11-141-3/+10
| | | | | | expression of ObjCForCollectionStmt (can be anything). llvm-svn: 59312
* Add a new expression node, CXXOperatorCallExpr, which expresses aDouglas Gregor2008-11-149-16/+139
| | | | | | | | | | | | | | | | | | | function call created in response to the use of operator syntax that resolves to an overloaded operator in C++, e.g., "str1 + str2" that resolves to std::operator+(str1, str2)". We now build a CXXOperatorCallExpr in C++ when we pick an overloaded operator. (But only for binary operators, where we actually implement overloading) I decided *not* to refactor the current CallExpr to make it abstract (with FunctionCallExpr and CXXOperatorCallExpr as derived classes). Doing so would allow us to make CXXOperatorCallExpr a little bit smaller, at the cost of making the argument and callee accessors virtual. We won't know if this is going to be a win until we can parse lots of C++ code to determine how much memory we'll save by making this change vs. the performance penalty due to the extra virtual calls. llvm-svn: 59306
* Don't require us to manually number the statements and expressions in ↵Douglas Gregor2008-11-142-4/+4
| | | | | | StmtNodes.def. We don't need stable numbers yet, renumbering is a pain, and LAST_STMT had the wrong value anyway. llvm-svn: 59300
* Improve comments.Zhongxing Xu2008-11-141-1/+1
| | | | llvm-svn: 59294
* Handle the case where 'element' in ObjCforCollectionstmt is not a DeclStmt ↵Ted Kremenek2008-11-141-5/+8
| | | | | | or DeclRefExpr. llvm-svn: 59290
* Fix CFG construction for ObjCForCollectionStmt: 'element' expression can be ↵Ted Kremenek2008-11-141-20/+44
| | | | | | anything that evaluates to an lvalue llvm-svn: 59289
* Rename header file.Ted Kremenek2008-11-142-4/+4
| | | | | | Update include files. llvm-svn: 59284
* Some cleanup for the implementation of built-in operatorDouglas Gregor2008-11-133-27/+59
| | | | | | candidates. Thanks to Chris for the review! llvm-svn: 59260
* Fix a couple of suboptimalities in error recovery.Chris Lattner2008-11-131-8/+11
| | | | | | | | | | | | | | | | | | | 1. In the top level of ParseStatementOrDeclaration, don't eat a } if we just parsed a statement if it list there. Also, don't even bother emitting an error about a missing semicolon if the statement had a bug (an rbrace is fine). 2. In do/while parsing, don't require a 'while' to be present if the do body didn't parse. This allows us to generate a clean diagnostic for this code: t.c:1:22: error: expected expression void foo (void) { do . while (0); } ^ Thanks to Neil for pointing this out. llvm-svn: 59256
* don't highlight field name, just put a caret on it.Chris Lattner2008-11-131-2/+2
| | | | llvm-svn: 59255
* Using llvm::OwningPtr<> for CurLexer and CurTokenLexer. This makes both the ↵Ted Kremenek2008-11-132-18/+13
| | | | | | ownership semantics of these objects explicit within the Preprocessor and also tightens up the code (explicit deletes not needed). llvm-svn: 59249
* Use PushIncludeMacroStack/PopMacroStack instead of manually pushing/popping ↵Ted Kremenek2008-11-131-14/+6
| | | | | | from IncludeMacroStack. This is both cleaner and makes the include stack transparently extensible. llvm-svn: 59248
* - Revert r59229 and r59232: AllocRegion should be immutable.Ted Kremenek2008-11-131-20/+0
| | | | | | - Temporarily disabled test Analysis/array-struct.c for region store. llvm-svn: 59245
* Process array base expression of any type.Zhongxing Xu2008-11-131-0/+8
| | | | llvm-svn: 59240
* Array index might be unsigned. We have to generate a temporary signed value forZhongxing Xu2008-11-131-0/+12
| | | | | | it to be evaluated by APSInt::operators. llvm-svn: 59238
* Incomplete struct pointer can be used as a function argument.Zhongxing Xu2008-11-131-1/+7
| | | | llvm-svn: 59235
* Lift the pointer to alloca'ed region to the pointer to its first element.Zhongxing Xu2008-11-131-1/+21
| | | | | | | This is required by some operations, e.g., *p = 1; p[0] = 1;. Also set the AllocaRegion's type during the cast. llvm-svn: 59232
* Change AllocaRegion to subclass TypedRegion. We need to know ElementRegion'sZhongxing Xu2008-11-131-2/+12
| | | | | | type when assigning to it. llvm-svn: 59229
* Hook up "BodyBlock", not "Block".Ted Kremenek2008-11-131-1/+1
| | | | llvm-svn: 59227
* Correctly connect 'continue' and 'break' statements in Objective-C fast ↵Ted Kremenek2008-11-131-0/+7
| | | | | | enumeration for blocks to the appropriate basic blocks. llvm-svn: 59226
* GRExprEngine/CFRefCount/GRSimpleVals: We don't do any special handling (yet) ↵Ted Kremenek2008-11-133-15/+21
| | | | | | of vector types. Add explicit checks that when we process integers that they really are scalars. llvm-svn: 59225
* Fix for crash issues with comma operators with a void first operand, and Eli Friedman2008-11-132-50/+73
| | | | | | | | | | some more bullet-proofing/enhancements for tryEvaluate. This shouldn't cause any behavior changes except for handling cases where we were crashing before and being able to evaluate a few more cases in tryEvaluate. This should settle the minor mess surrounding r59196. llvm-svn: 59224
* Fix uninitialized variable.Ted Kremenek2008-11-131-1/+1
| | | | llvm-svn: 59222
* [LLVM up] Update for raw_fd_ostream change. This fixes a FIXME thatDaniel Dunbar2008-11-132-2/+2
| | | | | | | | the Backend output should be done in binary mode. - I'd appreciate it if someone who has a Windows build could verify this. llvm-svn: 59221
* GRExprEngine::VisitInitListExpr:Ted Kremenek2008-11-131-2/+2
| | | | | | | - Don't crash on vector types. - Handle typedefs. llvm-svn: 59220
* Easy IRgen improvement for bitfields, don't emit x >> 0.Daniel Dunbar2008-11-131-2/+3
| | | | | | | - Logic such as this quite possibly should be optional builder behavior. llvm-svn: 59213
* Backout of r59196, plus a new ICE test. Sorry if this is a Eli Friedman2008-11-132-50/+32
| | | | | | | | | | | | | | | | | | little rude; I figure it's cleaner to just back this out now so it doesn't get forgotten or mixed up with other checkins. The modification to isICE is simply wrong; I've added a test that the change to isICE breaks. I'm pretty sure the modification to tryEvaluate is also wrong. At the very least, there's some serious miscommunication going on here, as this is going in exactly the opposite direction of r59105. My understanding is that tryEvaluate is not supposed to care about side effects. That said, a lot of the clients to tryEvaluate are expecting it to enforce a no-side-effects policy, so we probably need another method that provides that guarantee. llvm-svn: 59212
* Supply finished flag to EmitBlock for common statements which useDaniel Dunbar2008-11-131-9/+6
| | | | | | | | | | landing pads. - Primarily a cleanliness issue instead of a performance issue (this eliminates all blocks w/o predecessors on 176.gcc/expr.c), but this also allows subsequent code to recognize it is unreachable and potentially avoid IRgen. llvm-svn: 59211
* Normalize many BasicBlock names.Daniel Dunbar2008-11-136-24/+24
| | | | | | | | | | - Use dotted notation for blocks related to a particular statement type. - Use .end for landing pads. No functionality change in NDEBUG mode. :) llvm-svn: 59210
* Add IsFinished arg to EmitBlock.Daniel Dunbar2008-11-132-2/+13
| | | | | | | | | | - Indicates that caller is done with the block and it can be dropped if it has no predecessors. Useful for callers who need to make landing pads but which may not be reached. No functionality change. llvm-svn: 59207
* For if blocks with no else, name the join block ifend instead of theDaniel Dunbar2008-11-131-6/+5
| | | | | | | | more confusing ifelse. Use dotted names for if blocks (if.then vs ifthen). llvm-svn: 59201
* Fix bug where the body block of an ObjCForCollectionStmt would not properly ↵Ted Kremenek2008-11-131-1/+1
| | | | | | get expanded as a series of basic blocks. llvm-svn: 59197
* Fix bug in constant evaluation exposed by 176.gcc.Daniel Dunbar2008-11-132-32/+50
| | | | | | | | | | | | - Evaluation of , operator used bogus assumption that LHS could be evaluated as an integral expression even though its type is unspecified. This change is making isICE very permissive of the LHS in non-evaluated contexts because it is not clear what predicate we would use to reject code here. The standard didn't offer me any guidance; opinions? llvm-svn: 59196
* Don't build identifiers for C++ constructors, destructors, orDouglas Gregor2008-11-126-30/+82
| | | | | | | | | | | | | | conversion functions. Instead, we just use a placeholder identifier for these (e.g., "<constructor>") and override NamedDecl::getName() to provide a human-readable name. This is one potential solution to the problem; another solution would be to replace the use of IdentifierInfo* in NamedDecl with a different class that deals with identifiers better. I'm also prototyping that to see how it compares, but this commit is better than what we had previously. llvm-svn: 59193
* Move some diagnostic handling to PreprocessorLexer.Ted Kremenek2008-11-123-14/+17
| | | | llvm-svn: 59191
* Add virtual dtor to PreprocessorLexer.Ted Kremenek2008-11-121-0/+2
| | | | llvm-svn: 59188
* Remove Lexer::LexIncludeFilename.Ted Kremenek2008-11-121-21/+0
| | | | llvm-svn: 59186
* Move LexIncludeFilename from Lexer to PreprocessorLexer.Ted Kremenek2008-11-121-0/+40
| | | | | | PreprocessorLexer now has a virtual method "IndirectLex" which allows it to call the lex method of its subclasses. This is not for performance intensive operations. llvm-svn: 59185
* Quick fix for crash in IRgen when we can tryEvaluate a condition toDaniel Dunbar2008-11-121-2/+5
| | | | | | | | | something that is not an int. - Ignore these cases for now, added FIXME that we should also boolize them. llvm-svn: 59184
* Use PushIncludeMacroStack() instead of manually manipulating the include stack.Ted Kremenek2008-11-121-4/+1
| | | | llvm-svn: 59181
* Update CFGStmtVisitor to recognize that ObjCForCollectionStmts are special ↵Ted Kremenek2008-11-122-4/+7
| | | | | | block-level "expressions". llvm-svn: 59176
* Disable some debug prints.Daniel Dunbar2008-11-121-0/+2
| | | | llvm-svn: 59174
* Add skeleton for PTH lexer.Ted Kremenek2008-11-121-0/+79
| | | | llvm-svn: 59169
* Fix a FIXME by improving a diagnostic, add a testcase for PR3048Chris Lattner2008-11-121-2/+1
| | | | llvm-svn: 59167
* make TryFixInvalidVariablyModifiedType a static function.Chris Lattner2008-11-122-7/+6
| | | | llvm-svn: 59163
* Shore up transfer function for ObjCForCollectionStmt.Ted Kremenek2008-11-121-9/+17
| | | | llvm-svn: 59162
* Use Stmt* instead of Expr* for block-level expression.Ted Kremenek2008-11-121-1/+1
| | | | llvm-svn: 59161
* ObjCForCollectionStmts are block-level expressions.Ted Kremenek2008-11-121-5/+8
| | | | llvm-svn: 59160
* Restructure code to encourage fallthrough, no functionality change.Chris Lattner2008-11-121-10/+13
| | | | llvm-svn: 59157
OpenPOWER on IntegriCloud