Commit Graph

5846 Commits

Author SHA1 Message Date
Nico Weber 6975aaf3c2 fix spello
llvm-svn: 54594
2008-08-09 22:12:22 +00:00
Argyrios Kyrtzidis dfaf82ac2d Handle BuiltinType::WChar inside CodeGenTypes::ConvertNewType().
llvm-svn: 54593
2008-08-09 22:01:55 +00:00
Chris Lattner 572100b648 Fix PR2400 by more graceful handling of invalid decls. Don't try to layout
an invalid struct decl.  Thanks to Martin Doucha for the 
isIncompleteArrayType part of this patch.

llvm-svn: 54592
2008-08-09 21:35:13 +00:00
Gordon Henriksen 04c50bd7e0 Expressive diagnostics-- worth their weight in gold?
(Fixing a spelling error.)

llvm-svn: 54591
2008-08-09 19:58:22 +00:00
Nico Weber 7094a5bfa8 do not serialize invalid asts. this fixes bug #2637
llvm-svn: 54590
2008-08-09 18:32:11 +00:00
Argyrios Kyrtzidis cbad725bf4 Change 'Wchar' to 'WChar' casing, for consistency.
No functionality change.

llvm-svn: 54588
2008-08-09 17:20:01 +00:00
Argyrios Kyrtzidis d8f2f5f1b7 Handle WChar inside BuiltinType::getName().
llvm-svn: 54587
2008-08-09 17:11:33 +00:00
Argyrios Kyrtzidis 40e9e4828f Implement support for the 'wchar_t' C++ type.
llvm-svn: 54585
2008-08-09 16:51:54 +00:00
Steve Naroff 239255d2a6 Fix Sema::MergeVarDecl() to better handle type compatibility. The previous code was trying to handle arrays specially (which didn't work for pointers to array). Removed local helper function areEquivalentArrayTypes(), replacing it's use with the more general ASTContext::typesAreCompatible() predicate.
Even though the test case this fixes is in "tentative-decls.c", this bug didn't have anything to do with our handling of tentative definitions (which is what I first expected). In any event, this is a tricky area of the spec.

llvm-svn: 54583
2008-08-09 16:04:40 +00:00
Argyrios Kyrtzidis 2f67f37daf When in C++, invoke ASTConsumer::HandleTagDeclDefinition in Sema::ActOnFinishCXXClassDef,
at which point the C++ struct/class/union is fully parsed.

llvm-svn: 54569
2008-08-09 00:58:37 +00:00
Ted Kremenek 4455a9d378 Added FIXME.
llvm-svn: 54568
2008-08-09 00:41:45 +00:00
Argyrios Kyrtzidis 5c45c9b063 Passing right brace location to ActOnFinishCXXClassDef is redundant, since it gets passed to ActOnFinishCXXMemberSpecification too.
llvm-svn: 54567
2008-08-09 00:39:29 +00:00
Ted Kremenek 8f50b64eef Updated checker build.
llvm-svn: 54566
2008-08-09 00:22:35 +00:00
Ted Kremenek 0216b83d94 Don't use Expr::isIntegerConstantExpr just to check if a pointer value is initialize to NULL.
llvm-svn: 54563
2008-08-09 00:05:14 +00:00
Ted Kremenek 1a02630b63 Updated checker build.
llvm-svn: 54562
2008-08-08 22:25:17 +00:00
Argyrios Kyrtzidis 69bc5ba67a Make RecordDecl::Destroy() public.
llvm-svn: 54561
2008-08-08 22:25:06 +00:00
Ted Kremenek 994c8e393d Have scan-build/ccc-analyzer generate preprocessed .i/.mi files for sources that clang crashes on.
llvm-svn: 54552
2008-08-08 20:46:42 +00:00
Chris Lattner c893a67fe3 update to make IRBuilder API change.
llvm-svn: 54548
2008-08-08 19:57:58 +00:00
Steve Naroff 5bb8f2264b Fix issues with C "tentative" definitions.
- Move checking from MergeVarDecl->FinializeDeclaratorGroup. Since MergeVarDecl is called before the initializer is attacted, it can't be done there (this removes a long standing FIXME).
- Add Sema::isTentativeDefinition() and Sema::CheckForFileScopedRedefinitions().
- Remove FIXME's and touch-up test case.

Still some more work to do (forthcoming)...

llvm-svn: 54533
2008-08-08 17:50:35 +00:00
Argyrios Kyrtzidis 37088116e7 Change line endings, CRLF -> LF.
llvm-svn: 54530
2008-08-08 16:58:19 +00:00
Argyrios Kyrtzidis 7fb867e5e0 Revert my previous commit where I replaced cast<> with static_cast<> in CXXFieldDecl::getMember().
llvm-svn: 54529
2008-08-08 16:48:14 +00:00
Argyrios Kyrtzidis 6bd44afc2f Destroy and delete the FieldDecl members of a RecordDecl.
llvm-svn: 54527
2008-08-08 14:08:55 +00:00
Argyrios Kyrtzidis cd5f3bde80 Add iterator access to field members for RecordDecl.
llvm-svn: 54526
2008-08-08 13:54:06 +00:00
Argyrios Kyrtzidis 28f65e9105 Use static_cast<> instead of cast<> for CXXFieldDecl::getMember().
llvm-svn: 54525
2008-08-08 13:26:45 +00:00
Ted Kremenek 6231e7e4ec Unbreak SerializationTest and the Rewriter by doing the work in HandleTranslationUnit instead of the destructor.
llvm-svn: 54513
2008-08-08 04:15:52 +00:00
Ted Kremenek dcb5e38927 ParseAST now never releases the passed ASTConsumer. This is the responsibility of the client.
The motivation is that clients may either:

(a) query the ASTConsumer object after AST parsing to collect data/etc.
(b) reuse the ASTConsumer.

llvm-svn: 54502
2008-08-08 02:46:37 +00:00
Ted Kremenek 4a35180f6d Use DeclStmt::decl_iterator instead of walking the getNextDeclarator() chain.
llvm-svn: 54501
2008-08-08 02:45:18 +00:00
Ted Kremenek 4b1327960d Added AssumeSymGT, AssumeSymGE, AssumeSymLT, AssumeSymLE to add some minor improvements to path-sensitivity. Right now we basically treat 'x > y' and 'x < y' as implying 'x != y', but this restriction will only inevitably apply to our must rudimentary value tracking component (we'll implement more advanced value reasoning later).
llvm-svn: 54493
2008-08-07 22:30:22 +00:00
Ted Kremenek 18391f432b Don't flag any dead stores for variables marked unused.
llvm-svn: 54492
2008-08-07 22:28:30 +00:00
Argyrios Kyrtzidis b3a5b4c645 Clear DeclSpec::AsmLabel in DeclSpec::clear().
llvm-svn: 54489
2008-08-07 20:58:03 +00:00
Argyrios Kyrtzidis faf0876cab Add CXXRecordType class.
llvm-svn: 54488
2008-08-07 20:55:28 +00:00
Ted Kremenek 87a7d31a9f Fix 80 col violation
llvm-svn: 54487
2008-08-07 19:48:19 +00:00
Ted Kremenek 7db4f60b26 ParseAST now conditionally deletes the passed ASTConsumer.
ModuleBuilder now performs llvmgen in HandleTranslationUnit.

This patch follows from the discussion on the following thread on cfe-commits:

http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20080804/006849.html

llvm-svn: 54486
2008-08-07 19:47:41 +00:00
Ted Kremenek 59f3553392 Remove unneeded #includes.
llvm-svn: 54478
2008-08-07 18:14:04 +00:00
Ted Kremenek 6b515b5b34 Micro cleanups.
llvm-svn: 54477
2008-08-07 18:13:12 +00:00
Ted Kremenek 1f4eb6b8da Fix by Jordan Breeding: when scanning for prior runs, scan-build should ignore files that are not directories.
llvm-svn: 54473
2008-08-07 17:57:34 +00:00
Ted Kremenek 31691ae862 Fix --html-diags in driver by delaying the construction of an HTMLDiagnosticClient until after we have created the Preprocessor object.
llvm-svn: 54472
2008-08-07 17:49:57 +00:00
Daniel Dunbar da8b85b415 Add test for nested enum redefinition.
- <rdar://problem/6093889>

llvm-svn: 54470
2008-08-07 16:22:45 +00:00
Matthijs Kooijman 8dab3eec81 Let LLVMCodeGenWriter forward all the methods defined in ASTConsumer, to
prevent unexpected surprises later on.

llvm-svn: 54469
2008-08-07 16:04:15 +00:00
Steve Naroff f960c0bb9e Sema::ActOnEnumBody(): handle nested enum redefinitions.
Fixes <rdar://problem/6093889> Nested enum redefinition crashes sema.

llvm-svn: 54463
2008-08-07 14:08:16 +00:00
Ted Kremenek 955516e6c7 attribute "unused" also applies to functions.
llvm-svn: 54440
2008-08-07 01:02:05 +00:00
Ted Kremenek c3b4c52a4d Fix <rdar://problem/6125909>.
Unify logic in return-of-stack-check (Sema) for casts and implicit casts.

llvm-svn: 54439
2008-08-07 00:49:01 +00:00
Ted Kremenek a4750cb1e5 Updated checker build.
llvm-svn: 54437
2008-08-06 23:57:27 +00:00
Ted Kremenek 83180f6e47 Enhanced test case.
llvm-svn: 54436
2008-08-06 23:26:31 +00:00
Ted Kremenek 8889bb3ff4 Cleanup some processing with DeclStmt, and gradually start using the internal BumpPtrAllocator to allocator more of CFG's data structures.
llvm-svn: 54433
2008-08-06 23:20:50 +00:00
Ted Kremenek e26ccf3553 Always construct the BumpPtrAllocator used by CFG as an instance variable.
llvm-svn: 54429
2008-08-06 22:22:32 +00:00
Ted Kremenek 66db7d66de Fix serialization of DeclStmt.
llvm-svn: 54428
2008-08-06 22:17:30 +00:00
Ted Kremenek 93e9233355 Added VCProj file for libDriver.
llvm-svn: 54423
2008-08-06 20:50:20 +00:00
Daniel Dunbar 8d81683554 Replace old bitfield test.
- Change hardcoded assembly instructions to a use of 'opt' (still
   waiting for someone to yell at me for this).

 - Add some cases to cover behavior fixed by previous commit.

llvm-svn: 54413
2008-08-06 16:07:39 +00:00
Steve Naroff c884aa8e84 Fix for <rdar://problem/6113807> clang ObjC rewriter: crash rewriting attached file
While this is a safe rewriter fix, there is still a need for some discussion (see report for more info).

llvm-svn: 54412
2008-08-06 15:58:23 +00:00