Commit Graph

7397 Commits

Author SHA1 Message Date
Daniel Dunbar 62efa23518 Fix some validation errors.
llvm-svn: 59272
2008-11-13 23:01:34 +00:00
Daniel Dunbar ed40bc19c9 Start a "hacking" page with some simple notes on getting started
developing clang.

llvm-svn: 59270
2008-11-13 22:49:41 +00:00
Steve Naroff c9337928c1 Add file to VC++ project.
llvm-svn: 59261
2008-11-13 21:16:53 +00:00
Douglas Gregor 58e008d2a6 Some cleanup for the implementation of built-in operator
candidates. Thanks to Chris for the review!

llvm-svn: 59260
2008-11-13 20:12:29 +00:00
Steve Naroff f8cfd1647e Fix an obscure rewriter bug when rewriting implementations that don't have a corresponding interface (found while doing random testing on another bug).
llvm-svn: 59259
2008-11-13 20:07:04 +00:00
Chris Lattner 0046de17e5 Fix a couple of suboptimalities in error recovery.
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
2008-11-13 18:52:53 +00:00
Chris Lattner f3e388d1bf don't highlight field name, just put a caret on it.
llvm-svn: 59255
2008-11-13 18:49:38 +00:00
Chris Lattner 7464fc784e disable these two tests, they crash and take a long time to run crashreporter etc.
llvm-svn: 59254
2008-11-13 18:45:47 +00:00
Chris Lattner 9226b92563 implement a fixme :), switch to -verify mode.
llvm-svn: 59253
2008-11-13 18:42:17 +00:00
Steve Naroff 832d89012f Fix <rdar://problem/6343942> clang ObjC rewriter: crash rewriting blocks
and <rdar://problem/6344601> clang ObjC rewriter: crash passing Block parameter?

llvm-svn: 59251
2008-11-13 17:40:07 +00:00
Ted Kremenek a0d2a1661a Using llvm::OwningPtr<> for CurLexer and CurTokenLexer. This makes both the ownership semantics of these objects explicit within the Preprocessor and also tightens up the code (explicit deletes not needed).
llvm-svn: 59249
2008-11-13 17:11:24 +00:00
Ted Kremenek 7c1e61d78b Use PushIncludeMacroStack/PopMacroStack instead of manually pushing/popping from IncludeMacroStack. This is both cleaner and makes the include stack transparently extensible.
llvm-svn: 59248
2008-11-13 16:51:03 +00:00
Ted Kremenek 9df654fa95 Update Xcode project.
llvm-svn: 59247
2008-11-13 16:36:43 +00:00
Ted Kremenek 7d5389e4b3 - Revert r59229 and r59232: AllocRegion should be immutable.
- Temporarily disabled test Analysis/array-struct.c for region store.

llvm-svn: 59245
2008-11-13 15:42:31 +00:00
Zhongxing Xu d4e72fca45 Process array base expression of any type.
llvm-svn: 59240
2008-11-13 09:48:44 +00:00
Zhongxing Xu e9857ddcc0 Add test for unsigned array index.
llvm-svn: 59239
2008-11-13 09:20:05 +00:00
Zhongxing Xu 189a30796a Array index might be unsigned. We have to generate a temporary signed value for
it to be evaluated by APSInt::operators.

llvm-svn: 59238
2008-11-13 09:15:14 +00:00
Zhongxing Xu b9ec8f555f Add test for incomplete struct pointer.
llvm-svn: 59236
2008-11-13 08:44:52 +00:00
Zhongxing Xu 29188c2948 Incomplete struct pointer can be used as a function argument.
llvm-svn: 59235
2008-11-13 08:41:36 +00:00
Zhongxing Xu 06a04bd1ae Add a test case for alloca().
llvm-svn: 59233
2008-11-13 07:59:15 +00:00
Zhongxing Xu 0dbeeaa886 Lift the pointer to alloca'ed region to the pointer to its first element.
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
2008-11-13 07:58:20 +00:00
Zhongxing Xu a70987eb82 Change AllocaRegion to subclass TypedRegion. We need to know ElementRegion's
type when assigning to it.

llvm-svn: 59229
2008-11-13 07:30:58 +00:00
Ted Kremenek 9f164c96bf Hook up "BodyBlock", not "Block".
llvm-svn: 59227
2008-11-13 07:01:10 +00:00
Ted Kremenek 1516dc075a Correctly connect 'continue' and 'break' statements in Objective-C fast enumeration for blocks to the appropriate basic blocks.
llvm-svn: 59226
2008-11-13 06:36:45 +00:00
Ted Kremenek 16866d6fd8 GRExprEngine/CFRefCount/GRSimpleVals: We don't do any special handling (yet) of vector types. Add explicit checks that when we process integers that they really are scalars.
llvm-svn: 59225
2008-11-13 06:10:40 +00:00
Eli Friedman 5a332ea01f Fix for crash issues with comma operators with a void first operand, and
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
2008-11-13 06:09:17 +00:00
Daniel Dunbar 4b27eb4d26 Obey the FIXMES!
- Resume running the always inliner pass always now that LLVM has
   been improved and functions with debug info can be inlined.
 - Remove unused header.

llvm-svn: 59223
2008-11-13 05:29:02 +00:00
Ted Kremenek 75db6d7529 Fix uninitialized variable.
llvm-svn: 59222
2008-11-13 05:26:15 +00:00
Daniel Dunbar f3502dbc14 [LLVM up] Update for raw_fd_ostream change. This fixes a FIXME that
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
2008-11-13 05:09:21 +00:00
Ted Kremenek 45698bf05f GRExprEngine::VisitInitListExpr:
- Don't crash on vector types.
- Handle typedefs.

llvm-svn: 59220
2008-11-13 05:05:34 +00:00
Daniel Dunbar f7fb75044f Easy IRgen improvement for bitfields, don't emit x >> 0.
- Logic such as this quite possibly should be optional builder
   behavior.

llvm-svn: 59213
2008-11-13 02:20:34 +00:00
Eli Friedman 8553a98b8e Backout of r59196, plus a new ICE test. Sorry if this is a
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
2008-11-13 02:13:11 +00:00
Daniel Dunbar df21c6e203 Supply finished flag to EmitBlock for common statements which use
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
2008-11-13 01:54:24 +00:00
Daniel Dunbar a612e79be4 Normalize many BasicBlock names.
- 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
2008-11-13 01:38:36 +00:00
Ted Kremenek 83844100fb Revert to older checker build.
llvm-svn: 59209
2008-11-13 01:30:19 +00:00
Daniel Dunbar fcac22eac1 Add IsFinished arg to EmitBlock.
- 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
2008-11-13 01:24:05 +00:00
Ted Kremenek d0e32791d5 Update checker build.
llvm-svn: 59206
2008-11-13 01:23:50 +00:00
Daniel Dunbar f75c823e5c For if blocks with no else, name the join block ifend instead of the
more confusing ifelse.

Use dotted names for if blocks (if.then vs ifthen).

llvm-svn: 59201
2008-11-13 00:47:57 +00:00
Ted Kremenek ce9082ad5c Fix bug where the body block of an ObjCForCollectionStmt would not properly get expanded as a series of basic blocks.
llvm-svn: 59197
2008-11-13 00:06:59 +00:00
Daniel Dunbar c7ec5fcf24 Fix bug in constant evaluation exposed by 176.gcc.
- 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
2008-11-13 00:03:19 +00:00
Ted Kremenek e9c16a6a79 Updated checker build.
llvm-svn: 59195
2008-11-12 23:26:57 +00:00
Douglas Gregor b6acda0f36 Don't build identifiers for C++ constructors, destructors, or
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
2008-11-12 23:21:09 +00:00
Douglas Gregor c208f4617c Fix compilation on 64-bit targets
llvm-svn: 59192
2008-11-12 23:17:06 +00:00
Ted Kremenek 66312a3ff4 Move some diagnostic handling to PreprocessorLexer.
llvm-svn: 59191
2008-11-12 23:13:54 +00:00
Ted Kremenek 3060634fba Add virtual dtor to PreprocessorLexer.
llvm-svn: 59188
2008-11-12 22:48:57 +00:00
Ted Kremenek 9d39e377df Add LexIncludeFilename.
llvm-svn: 59187
2008-11-12 22:46:33 +00:00
Ted Kremenek 2f4f2dea82 Remove Lexer::LexIncludeFilename.
llvm-svn: 59186
2008-11-12 22:44:15 +00:00
Ted Kremenek 6c90efb923 Move LexIncludeFilename from Lexer to PreprocessorLexer.
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
2008-11-12 22:43:05 +00:00
Daniel Dunbar f32443cdcd Quick fix for crash in IRgen when we can tryEvaluate a condition to
something that is not an int.

 - Ignore these cases for now, added FIXME that we should also boolize
   them.

llvm-svn: 59184
2008-11-12 22:37:10 +00:00
Ted Kremenek 50b4f48225 Use PushIncludeMacroStack() instead of manually manipulating the include stack.
llvm-svn: 59181
2008-11-12 22:21:57 +00:00