summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* fix PR3048. I'm going to do some more work before closing it off andChris Lattner2008-11-121-0/+1
| | | | | | adding a testcase. llvm-svn: 59156
* Add (preliminary) transfer function support for ObjCForCollectionStmt. ↵Ted Kremenek2008-11-122-8/+123
| | | | | | | | Still need to flesh out some logic. When processing DeclStmt, use the new interface to StateManager::BindDecl. Conjuring of symbols is now done in VisitDeclStmt. llvm-svn: 59155
* Conjured symbols now bind to Stmt* instead of Expr*.Ted Kremenek2008-11-121-1/+1
| | | | llvm-svn: 59154
* Update method names involving GRStateRef. No functionality change.Ted Kremenek2008-11-121-9/+9
| | | | llvm-svn: 59153
* GRStateRef:Ted Kremenek2008-11-122-26/+25
| | | | | | | | | | | | - Rename SetSVal to BindLoc - Add BindDecl - Add BindExpr GRState: - Environment now binds to Stmt* instead of Expr*. This is needed for processing ObjCForCollectionStmt (essentially the declaration of the the 'element' variable can have an SVal attached to it). - BindDecl no longer accepts Expr* for the initialization value; use SVal* instead. llvm-svn: 59152
* StoreManager::BindDecl now takes an SVal* for the initialization value ↵Ted Kremenek2008-11-122-42/+23
| | | | | | instead of an Expr* (which can be null). Lazy symbolication of conjured symbols is now the sole responsibility of GRExprEngine. llvm-svn: 59151
* Implement support for operator overloading using candidate operatorDouglas Gregor2008-11-129-69/+726
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | functions for built-in operators, e.g., the builtin bool operator==(int const*, int const*) can be used for the expression "x1 == x2" given: struct X { operator int const*(); } x1, x2; The scheme for handling these built-in operators is relatively simple: for each candidate required by the standard, create a special kind of candidate function for the built-in. If overload resolution picks the built-in operator, we perform the appropriate conversions on the arguments and then let the normal built-in operator take care of it. There may be some optimization opportunity left: if we can reduce the number of built-in operator overloads we generate, overload resolution for these cases will go faster. However, one must be careful when doing this: GCC generates too few operator overloads in our little test program, and fails to compile it because none of the overloads it generates match. Note that we only support operator overload for non-member binary operators at the moment. The other operators will follow. As part of this change, ImplicitCastExpr can now be an lvalue. llvm-svn: 59148
* Start a README.txt of possible optimizations to do in IRgen.Daniel Dunbar2008-11-121-0/+24
| | | | llvm-svn: 59130
* Handle ?: in EmitBranchOnBoolExpr.Daniel Dunbar2008-11-121-0/+17
| | | | llvm-svn: 59129
* Rename ?: operator blocks to cond.true and cond.false (I don't knowDaniel Dunbar2008-11-121-2/+2
| | | | | | what "cond.?" means, and this avoids quoting). llvm-svn: 59128
* Comment/indentation fix.Daniel Dunbar2008-11-121-2/+2
| | | | llvm-svn: 59127
* Some additions to tryEvaluate I've had sitting around for a while.Eli Friedman2008-11-121-25/+202
| | | | | | | | | | | | | | This pushes it a lot closer to being able to deal with most of the stuff CodeGen's constant expression evaluator knows how to deal with. This also fixes PR3003. The test could possibly use some improvement, but this'll work for now. Test 6 is inspired by PR3003; the other tests are mostly just designed to exercise the new code. The reason for the funny structure of the tests is that type fixing for arrays inside of structs is the only place in Sema that calls tryEvaluate, at least for the moment. llvm-svn: 59125
* Lower ?: into select when the selected values are cheap and side-effect-free.Chris Lattner2008-11-121-0/+37
| | | | | | This cuts another 200 lines off expr.ll, forming 23 selects. llvm-svn: 59124
* emit better codegen for ||/&&, shrinking expr.ll by another 240 lines.Chris Lattner2008-11-121-19/+31
| | | | | | | | This happens for stuff like this: x = cond1 || cond2 || cond3 || cond4; llvm-svn: 59123
* use ConstantFoldsToSimpleInteger instead of code emission to doChris Lattner2008-11-121-24/+22
| | | | | | constant folding. llvm-svn: 59121
* IRgen improvements on unreachable code:Daniel Dunbar2008-11-122-38/+76
| | | | | | | | | | | | | | | | | | | | | | | - Split out "simple" statements which can easily handle IR generation when there is no insert point. These are generally statements which start by emitting a new block or are only containers for other statements. - This fixes a regression in emitting dummy blocks, notably for case statements. - This also fixes spurious emission of a number of debug stoppoint intrinsic instructions. Remove unneeded sw.body block, just clear the insertion point. Lift out CodeGenFunction::EmitStopPoint which calls into the CGDebugInfo class when generating debug info. Normalize definitions of Emit{Break,Continue}Stmt and usage of ErrorUnsupported. llvm-svn: 59118
* Handle Unary ! in EmitBranchOnBoolExpr, so that we can efficientlyChris Lattner2008-11-121-1/+6
| | | | | | codegen stuff like "if (!(X && Y))" llvm-svn: 59115
* Use EmitBranchOnBoolExpr in VisitConditionalOperator. ThisChris Lattner2008-11-121-8/+17
| | | | | | shrinks code yet again by a bit. llvm-svn: 59114
OpenPOWER on IntegriCloud