]> granicus.if.org Git - clang/log
clang
16 years agoExpressive diagnostics-- worth their weight in gold?
Gordon Henriksen [Sat, 9 Aug 2008 19:58:22 +0000 (19:58 +0000)]
Expressive diagnostics-- worth their weight in gold?
(Fixing a spelling error.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54591 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agodo not serialize invalid asts. this fixes bug #2637
Nico Weber [Sat, 9 Aug 2008 18:32:11 +0000 (18:32 +0000)]
do not serialize invalid asts. this fixes bug #2637

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54590 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoChange 'Wchar' to 'WChar' casing, for consistency.
Argyrios Kyrtzidis [Sat, 9 Aug 2008 17:20:01 +0000 (17:20 +0000)]
Change 'Wchar' to 'WChar' casing, for consistency.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54588 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoHandle WChar inside BuiltinType::getName().
Argyrios Kyrtzidis [Sat, 9 Aug 2008 17:11:33 +0000 (17:11 +0000)]
Handle WChar inside BuiltinType::getName().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54587 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoImplement support for the 'wchar_t' C++ type.
Argyrios Kyrtzidis [Sat, 9 Aug 2008 16:51:54 +0000 (16:51 +0000)]
Implement support for the 'wchar_t' C++ type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54585 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix Sema::MergeVarDecl() to better handle type compatibility. The previous code was...
Steve Naroff [Sat, 9 Aug 2008 16:04:40 +0000 (16:04 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54583 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoWhen in C++, invoke ASTConsumer::HandleTagDeclDefinition in Sema::ActOnFinishCXXClassDef,
Argyrios Kyrtzidis [Sat, 9 Aug 2008 00:58:37 +0000 (00:58 +0000)]
When in C++, invoke ASTConsumer::HandleTagDeclDefinition in Sema::ActOnFinishCXXClassDef,
at which point the C++ struct/class/union is fully parsed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54569 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdded FIXME.
Ted Kremenek [Sat, 9 Aug 2008 00:41:45 +0000 (00:41 +0000)]
Added FIXME.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54568 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoPassing right brace location to ActOnFinishCXXClassDef is redundant, since it gets...
Argyrios Kyrtzidis [Sat, 9 Aug 2008 00:39:29 +0000 (00:39 +0000)]
Passing right brace location to ActOnFinishCXXClassDef is redundant, since it gets passed to ActOnFinishCXXMemberSpecification too.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54567 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUpdated checker build.
Ted Kremenek [Sat, 9 Aug 2008 00:22:35 +0000 (00:22 +0000)]
Updated checker build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54566 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDon't use Expr::isIntegerConstantExpr just to check if a pointer value is initialize...
Ted Kremenek [Sat, 9 Aug 2008 00:05:14 +0000 (00:05 +0000)]
Don't use Expr::isIntegerConstantExpr just to check if a pointer value is initialize to NULL.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54563 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUpdated checker build.
Ted Kremenek [Fri, 8 Aug 2008 22:25:17 +0000 (22:25 +0000)]
Updated checker build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54562 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMake RecordDecl::Destroy() public.
Argyrios Kyrtzidis [Fri, 8 Aug 2008 22:25:06 +0000 (22:25 +0000)]
Make RecordDecl::Destroy() public.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54561 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoHave scan-build/ccc-analyzer generate preprocessed .i/.mi files for sources that...
Ted Kremenek [Fri, 8 Aug 2008 20:46:42 +0000 (20:46 +0000)]
Have scan-build/ccc-analyzer generate preprocessed .i/.mi files for sources that clang crashes on.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54552 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoupdate to make IRBuilder API change.
Chris Lattner [Fri, 8 Aug 2008 19:57:58 +0000 (19:57 +0000)]
update to make IRBuilder API change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54548 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix issues with C "tentative" definitions.
Steve Naroff [Fri, 8 Aug 2008 17:50:35 +0000 (17:50 +0000)]
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)...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54533 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoChange line endings, CRLF -> LF.
Argyrios Kyrtzidis [Fri, 8 Aug 2008 16:58:19 +0000 (16:58 +0000)]
Change line endings, CRLF -> LF.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54530 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRevert my previous commit where I replaced cast<> with static_cast<> in CXXFieldDecl...
Argyrios Kyrtzidis [Fri, 8 Aug 2008 16:48:14 +0000 (16:48 +0000)]
Revert my previous commit where I replaced cast<> with static_cast<> in CXXFieldDecl::getMember().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54529 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDestroy and delete the FieldDecl members of a RecordDecl.
Argyrios Kyrtzidis [Fri, 8 Aug 2008 14:08:55 +0000 (14:08 +0000)]
Destroy and delete the FieldDecl members of a RecordDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54527 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd iterator access to field members for RecordDecl.
Argyrios Kyrtzidis [Fri, 8 Aug 2008 13:54:06 +0000 (13:54 +0000)]
Add iterator access to field members for RecordDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54526 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUse static_cast<> instead of cast<> for CXXFieldDecl::getMember().
Argyrios Kyrtzidis [Fri, 8 Aug 2008 13:26:45 +0000 (13:26 +0000)]
Use static_cast<> instead of cast<> for CXXFieldDecl::getMember().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54525 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUnbreak SerializationTest and the Rewriter by doing the work in HandleTranslationUnit...
Ted Kremenek [Fri, 8 Aug 2008 04:15:52 +0000 (04:15 +0000)]
Unbreak SerializationTest and the Rewriter by doing the work in HandleTranslationUnit instead of the destructor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54513 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoParseAST now never releases the passed ASTConsumer. This is the responsibility of...
Ted Kremenek [Fri, 8 Aug 2008 02:46:37 +0000 (02:46 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54502 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUse DeclStmt::decl_iterator instead of walking the getNextDeclarator() chain.
Ted Kremenek [Fri, 8 Aug 2008 02:45:18 +0000 (02:45 +0000)]
Use DeclStmt::decl_iterator instead of walking the getNextDeclarator() chain.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54501 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdded AssumeSymGT, AssumeSymGE, AssumeSymLT, AssumeSymLE to add some minor improvemen...
Ted Kremenek [Thu, 7 Aug 2008 22:30:22 +0000 (22:30 +0000)]
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).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54493 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDon't flag any dead stores for variables marked unused.
Ted Kremenek [Thu, 7 Aug 2008 22:28:30 +0000 (22:28 +0000)]
Don't flag any dead stores for variables marked unused.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54492 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoClear DeclSpec::AsmLabel in DeclSpec::clear().
Argyrios Kyrtzidis [Thu, 7 Aug 2008 20:58:03 +0000 (20:58 +0000)]
Clear DeclSpec::AsmLabel in DeclSpec::clear().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54489 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd CXXRecordType class.
Argyrios Kyrtzidis [Thu, 7 Aug 2008 20:55:28 +0000 (20:55 +0000)]
Add CXXRecordType class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54488 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix 80 col violation
Ted Kremenek [Thu, 7 Aug 2008 19:48:19 +0000 (19:48 +0000)]
Fix 80 col violation

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54487 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoParseAST now conditionally deletes the passed ASTConsumer.
Ted Kremenek [Thu, 7 Aug 2008 19:47:41 +0000 (19:47 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54486 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRemove unneeded #includes.
Ted Kremenek [Thu, 7 Aug 2008 18:14:04 +0000 (18:14 +0000)]
Remove unneeded #includes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54478 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMicro cleanups.
Ted Kremenek [Thu, 7 Aug 2008 18:13:12 +0000 (18:13 +0000)]
Micro cleanups.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54477 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix by Jordan Breeding: when scanning for prior runs, scan-build should ignore files...
Ted Kremenek [Thu, 7 Aug 2008 17:57:34 +0000 (17:57 +0000)]
Fix by Jordan Breeding: when scanning for prior runs, scan-build should ignore files that are not directories.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54473 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix --html-diags in driver by delaying the construction of an HTMLDiagnosticClient...
Ted Kremenek [Thu, 7 Aug 2008 17:49:57 +0000 (17:49 +0000)]
Fix --html-diags in driver by delaying the construction of an HTMLDiagnosticClient until after we have created the Preprocessor object.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54472 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd test for nested enum redefinition.
Daniel Dunbar [Thu, 7 Aug 2008 16:22:45 +0000 (16:22 +0000)]
Add test for nested enum redefinition.
 - <rdar://problem/6093889>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54470 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoLet LLVMCodeGenWriter forward all the methods defined in ASTConsumer, to
Matthijs Kooijman [Thu, 7 Aug 2008 16:04:15 +0000 (16:04 +0000)]
Let LLVMCodeGenWriter forward all the methods defined in ASTConsumer, to
prevent unexpected surprises later on.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54469 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoSema::ActOnEnumBody(): handle nested enum redefinitions.
Steve Naroff [Thu, 7 Aug 2008 14:08:16 +0000 (14:08 +0000)]
Sema::ActOnEnumBody(): handle nested enum redefinitions.
Fixes <rdar://problem/6093889> Nested enum redefinition crashes sema.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54463 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoattribute "unused" also applies to functions.
Ted Kremenek [Thu, 7 Aug 2008 01:02:05 +0000 (01:02 +0000)]
attribute "unused" also applies to functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54440 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix <rdar://problem/6125909>.
Ted Kremenek [Thu, 7 Aug 2008 00:49:01 +0000 (00:49 +0000)]
Fix <rdar://problem/6125909>.
Unify logic in return-of-stack-check (Sema) for casts and implicit casts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54439 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUpdated checker build.
Ted Kremenek [Wed, 6 Aug 2008 23:57:27 +0000 (23:57 +0000)]
Updated checker build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54437 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoEnhanced test case.
Ted Kremenek [Wed, 6 Aug 2008 23:26:31 +0000 (23:26 +0000)]
Enhanced test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54436 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoCleanup some processing with DeclStmt, and gradually start using the internal BumpPtr...
Ted Kremenek [Wed, 6 Aug 2008 23:20:50 +0000 (23:20 +0000)]
Cleanup some processing with DeclStmt, and gradually start using the internal BumpPtrAllocator to allocator more of CFG's data structures.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54433 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoignore build dirs
Nuno Lopes [Wed, 6 Aug 2008 23:09:43 +0000 (23:09 +0000)]
ignore build dirs

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54431 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAlways construct the BumpPtrAllocator used by CFG as an instance variable.
Ted Kremenek [Wed, 6 Aug 2008 22:22:32 +0000 (22:22 +0000)]
Always construct the BumpPtrAllocator used by CFG as an instance variable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54429 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix serialization of DeclStmt.
Ted Kremenek [Wed, 6 Aug 2008 22:17:30 +0000 (22:17 +0000)]
Fix serialization of DeclStmt.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54428 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdded VCProj file for libDriver.
Ted Kremenek [Wed, 6 Aug 2008 20:50:20 +0000 (20:50 +0000)]
Added VCProj file for libDriver.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54423 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd svn:ignore on test/Sema/Output
Daniel Dunbar [Wed, 6 Aug 2008 16:08:49 +0000 (16:08 +0000)]
Add svn:ignore on test/Sema/Output

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54414 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoReplace old bitfield test.
Daniel Dunbar [Wed, 6 Aug 2008 16:07:39 +0000 (16:07 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54413 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix for <rdar://problem/6113807> clang ObjC rewriter: crash rewriting attached file
Steve Naroff [Wed, 6 Aug 2008 15:58:23 +0000 (15:58 +0000)]
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).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54412 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoReorder serialization methods.
Ted Kremenek [Wed, 6 Aug 2008 15:50:59 +0000 (15:50 +0000)]
Reorder serialization methods.
When serializing DeclStmt, encode a bit indicating whether or not the DeclStmt owns the Decl.  This is an interim solution.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54410 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix EmitNullInitializationToLValue for bitfield lvalues.
Daniel Dunbar [Wed, 6 Aug 2008 05:32:55 +0000 (05:32 +0000)]
Fix EmitNullInitializationToLValue for bitfield lvalues.
 - PR2643

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54397 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix bitfield accesses which straddle the boundary of the underlying
Daniel Dunbar [Wed, 6 Aug 2008 05:08:45 +0000 (05:08 +0000)]
Fix bitfield accesses which straddle the boundary of the underlying
type.

 - This generates somewhat less optimal code than before but this is
   not hard to rectify once stable (at the cost of slightly more
   complex code).

 - This currently always uses little-endian ordering of the bitfield.

 - This breaks the CodeGen/bitfield.c test because it was grepping for
   hard-coded assembly instructions. Will fix once a better test case
   is constructed (hard to do without execution).

 - This fixes SingleSource/UnitTests/2006-01-23-InitializedBitField.c
   and Regression/C/PR1386.c from the test suite.

 - <rdar://problem/6085090>, <rdar://problem/6094169>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54395 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUpdate xcode project to new libDriver layout.
Ted Kremenek [Wed, 6 Aug 2008 02:55:08 +0000 (02:55 +0000)]
Update xcode project to new libDriver layout.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54393 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix CodeGen of pointer arithmetic in compound assignment statements.
Daniel Dunbar [Wed, 6 Aug 2008 02:00:38 +0000 (02:00 +0000)]
Fix CodeGen of pointer arithmetic in compound assignment statements.

 - Changed EmitSub to work on all cases (arithmetic, ptr - int, ptr -
   ptr) so that implementation matches that of other operators.

 - Modify EmitCompoundAssign to compute and perform the appropriate
   casts of left, right, and result types for the assorted pointer
   arithmetic cases.

 - Fix EmitSub (ptr - int) case to negate the rhs *after*
   extension. This is critical when the rhs is unsigned (and needs
   extension).

 - This fixes cfrac.

 - <rdr://6115726>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54392 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoImplement GNU asm-label extension support in CodeGen. This fixes
Daniel Dunbar [Wed, 6 Aug 2008 00:03:29 +0000 (00:03 +0000)]
Implement GNU asm-label extension support in CodeGen. This fixes
scimark2 on Darwin.

 - Added Sema support for asm-label on variables, which I forgot before.

 - Update CodeGen to use GlobalDeclMap to determine if static Decls
   require emission (instead of LLVM module name lookup). Important
   since the Decl name and the LLVM module name can differ.

 - <rdar://problem/6116729>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54388 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoadd a libDriver, for now only move the text diangostics stuff from Driver to there
Nico Weber [Tue, 5 Aug 2008 23:33:20 +0000 (23:33 +0000)]
add a libDriver, for now only move the text diangostics stuff from Driver to there

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54383 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoChange CodeGen of global decls to key off of the name (instead of
Daniel Dunbar [Tue, 5 Aug 2008 23:31:02 +0000 (23:31 +0000)]
Change CodeGen of global decls to key off of the name (instead of
  having multiple bindings from all the possible decls which
  conceptually map to the same global).

 - This eliminates CodeGen depending on the LLVM module for name
   lookup.

 - This also eliminates the need for ReplaceMapValuesWith (hurrah).

 - This handles lookups for FunctionDecls correctly in the presence of
   aliases, this was previously broken.

 - WIP: Can still clean up & unify variable and function emission.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54382 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoremove spaces at eol to test commit access
Nico Weber [Tue, 5 Aug 2008 23:15:29 +0000 (23:15 +0000)]
remove spaces at eol to test commit access

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54381 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd missing "classof" methods to NonNullAttr, fixing a heisencrash.
Ted Kremenek [Tue, 5 Aug 2008 21:29:52 +0000 (21:29 +0000)]
Add missing "classof" methods to NonNullAttr, fixing a heisencrash.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54373 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdded decl_iterator to DeclStmt to provide an abstract interface to iterate over...
Ted Kremenek [Tue, 5 Aug 2008 20:46:55 +0000 (20:46 +0000)]
Added decl_iterator to DeclStmt to provide an abstract interface to iterate over the ScopedDecls of a DeclStmt.
Updated a few clients of DeclStmt::getNextDeclarator() to use decl_iterator instead.  Will update other clients after additional testing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54368 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFinish fixing <rdar://problem/5929344> clang ObjC rewriter: "extern int __CFConstantS...
Steve Naroff [Tue, 5 Aug 2008 20:04:48 +0000 (20:04 +0000)]
Finish fixing <rdar://problem/5929344> clang ObjC rewriter: "extern int __CFConstantStringClassReference[];" should be extern "C"

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54367 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRemove excess #include.
Ted Kremenek [Tue, 5 Aug 2008 19:56:24 +0000 (19:56 +0000)]
Remove excess #include.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54366 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agofix crash when printing diagnostics with tokens that span through more than one line
Nuno Lopes [Tue, 5 Aug 2008 19:40:20 +0000 (19:40 +0000)]
fix crash when printing diagnostics with tokens that span through more than one line

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54365 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRefactored driver logic for CodeGen into LLVMCodeGenWriter. This ASTConsumer layers...
Ted Kremenek [Tue, 5 Aug 2008 18:50:11 +0000 (18:50 +0000)]
Refactored driver logic for CodeGen into LLVMCodeGenWriter.  This ASTConsumer layers on top of LLVMCodeGen (another existing ASTConsumer) to emit bitcode files to disk.  This layering takes this logic out of clang.cpp and puts it directly into the ASTConsumer interface.  The benefit is that now --emit-llvm works with both serialized ASTs and regular source files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54364 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix <rdar://problem/6108119> clang ObjC rewriter: if no newline at end of input file...
Steve Naroff [Tue, 5 Aug 2008 18:47:23 +0000 (18:47 +0000)]
Fix <rdar://problem/6108119> clang ObjC rewriter: if no newline at end of input file, rewriter inserts #define on same line as closing brace

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54363 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMove AsmLabel into Declarator instead of just a parameter to
Daniel Dunbar [Tue, 5 Aug 2008 16:28:08 +0000 (16:28 +0000)]
Move AsmLabel into Declarator instead of just a parameter to
  ActOnDeclarator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54353 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd test case for PR2001.
Daniel Dunbar [Tue, 5 Aug 2008 16:15:29 +0000 (16:15 +0000)]
Add test case for PR2001.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54352 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix const-init test case
Daniel Dunbar [Tue, 5 Aug 2008 06:30:41 +0000 (06:30 +0000)]
Fix const-init test case
 - Use -verify and added expected warnings for EXTWARN change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54342 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix rdar://6124613 a crash on invalid code.
Chris Lattner [Tue, 5 Aug 2008 06:19:09 +0000 (06:19 +0000)]
Fix rdar://6124613 a crash on invalid code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54340 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd more Parser/Sema support for GCC asm-label extension.
Daniel Dunbar [Tue, 5 Aug 2008 01:35:17 +0000 (01:35 +0000)]
Add more Parser/Sema support for GCC asm-label extension.
 - ActOnDeclarator now takes an additional parameter which is the
   AsmLabel if used. Its unfortunate that this bubbles up this high,
   but we cannot just lump it in as an attribute without mistakenly
   *accepting* it as an attribute.
 - The actual asm-label itself is, however, encoded as an AsmLabelAttr
   on the FunctionDecl.
 - Slightly improved parser error recovery on malformed asm-labels.
 - CodeGen support still missing...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54339 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoBug fix, CodeGen of (void*) - (void*) was broken.
Daniel Dunbar [Tue, 5 Aug 2008 00:47:03 +0000 (00:47 +0000)]
Bug fix, CodeGen of (void*) - (void*) was broken.
 - <rdar://problem/6122967>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54338 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd EXTWARN Diagnostic class.
Daniel Dunbar [Tue, 5 Aug 2008 00:07:51 +0000 (00:07 +0000)]
Add EXTWARN Diagnostic class.
 - Like EXTENSION but always generates a warning (even without
   -pedantic).
 - Updated ptr -> int, int -> ptr, and incompatible cast warnings to
   be EXTWARN.
 - Other EXTENSION level diagnostics should be audited for upgrade.
 - Updated several test cases to fix code which produced unanticipated
   warnings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54335 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoNico Weber:
Ted Kremenek [Mon, 4 Aug 2008 22:51:42 +0000 (22:51 +0000)]
Nico Weber:

"the attached patch fixes some typos, 80 cols violations, etc. in comments."

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54328 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix several issues in checking of address-of expressions.
Daniel Dunbar [Mon, 4 Aug 2008 20:02:37 +0000 (20:02 +0000)]
Fix several issues in checking of address-of expressions.
 - clang was erroneously accepting address-of applied to lvalue
   expressions involving pointer arithmetic.
 - clang was erroneously rejecting address-of applied to deref
   expressions of pointer-typed variables.
 - Improved existing test case.
 - Fixes: <rdar://problem/6113867>, <rdar://problem/6080158>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54326 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMisc cleanups.
Ted Kremenek [Mon, 4 Aug 2008 18:15:26 +0000 (18:15 +0000)]
Misc cleanups.

When results go to a auto-generated dir in /tmp, don't use randomized file names.  Just output /tmp/scan-build-DATE-counter, where counter is an auto-incremented counter for runs produced that day.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54325 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUpdated latest checker build.
Ted Kremenek [Mon, 4 Aug 2008 17:36:34 +0000 (17:36 +0000)]
Updated latest checker build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54324 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoConvert remaining "open" calls to use three-argument form (thanks to Sam Bishop for...
Ted Kremenek [Mon, 4 Aug 2008 17:34:06 +0000 (17:34 +0000)]
Convert remaining "open" calls to use three-argument form (thanks to Sam Bishop for the tip!).

Recognize 'ccc-analyzer' as a build command some users may use.  Treat it just like calling gcc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54323 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAvoid creating dummy block when no indirect gotos are present.
Daniel Dunbar [Mon, 4 Aug 2008 17:24:44 +0000 (17:24 +0000)]
Avoid creating dummy block when no indirect gotos are present.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54322 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix regression when invoking the MissingDealloc analysis: disable this check when...
Ted Kremenek [Mon, 4 Aug 2008 17:14:10 +0000 (17:14 +0000)]
Fix regression when invoking the MissingDealloc analysis: disable this check when in -fobjc-gc-only mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54319 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd CodeGen support for indirect goto.
Daniel Dunbar [Mon, 4 Aug 2008 16:51:22 +0000 (16:51 +0000)]
Add CodeGen support for indirect goto.
 - Follows emission scheme used by llvm-gcc, i.e. invent an id for
   each label whose address is taken and replace each indirect goto by
   a switch to each possible target.
 - Currently we emit a switch for each indirect goto instead of
   merging them as llvm-gcc does.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54318 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFinally fix PR2189. This makes a fairly invasive but important change to
Chris Lattner [Mon, 4 Aug 2008 07:31:14 +0000 (07:31 +0000)]
Finally fix PR2189.  This makes a fairly invasive but important change to
move getAsArrayType into ASTContext instead of being a method on type.
This is required because getAsArrayType(const AT), where AT is a typedef
for "int[10]" needs to return ArrayType(const int, 10).

Fixing this greatly simplifies getArrayDecayedType, which is a good sign.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54317 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUpdated latest checker build.
Ted Kremenek [Sun, 3 Aug 2008 03:14:03 +0000 (03:14 +0000)]
Updated latest checker build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54276 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoChange 'dead store (++/--)' to 'dead increment'
Ted Kremenek [Sat, 2 Aug 2008 18:19:48 +0000 (18:19 +0000)]
Change 'dead store (++/--)' to 'dead increment'

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54268 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoWherever a type is used/returned from the Action module, use TypeTy instead of DeclTy...
Argyrios Kyrtzidis [Fri, 1 Aug 2008 10:35:27 +0000 (10:35 +0000)]
Wherever a type is used/returned from the Action module, use TypeTy instead of DeclTy or void.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54265 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMake the default constructor of IdentifierResolver::iterator public.
Argyrios Kyrtzidis [Fri, 1 Aug 2008 10:20:48 +0000 (10:20 +0000)]
Make the default constructor of IdentifierResolver::iterator public.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54264 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd more output to clang -parse-print-callbacks
Daniel Dunbar [Fri, 1 Aug 2008 00:41:12 +0000 (00:41 +0000)]
Add more output to clang -parse-print-callbacks

 - Just added prints for all the action functions. Ideally this would
   be extended to print all the information for the actions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54259 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoSupport constructor and destructor attributes in CodeGen
Daniel Dunbar [Fri, 1 Aug 2008 00:01:51 +0000 (00:01 +0000)]
Support constructor and destructor attributes in CodeGen

 - There is an miscompilation issue remaining due to a poor
   interaction between the delayed emission of static functions and
   the emission of constructors, but that already existed prior to
   this change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54258 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoSupport __attribute__(({con,de}structor)) in Parse & Sema
Daniel Dunbar [Thu, 31 Jul 2008 22:40:48 +0000 (22:40 +0000)]
Support __attribute__(({con,de}structor)) in Parse & Sema
 - Including possible priority argument
 - In other news, the attribute parsing code really needs a cleanup

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54257 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoEnhanced path-sensitive return-of-stack-address check to print out the name of the...
Ted Kremenek [Thu, 31 Jul 2008 20:31:27 +0000 (20:31 +0000)]
Enhanced path-sensitive return-of-stack-address check to print out the name of the variable whose address was returned.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54253 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRemove getCodeBody() from Decl, and hoist getBody() into Decl as a virtual function.
Ted Kremenek [Thu, 31 Jul 2008 17:32:12 +0000 (17:32 +0000)]
Remove getCodeBody() from Decl, and hoist getBody() into Decl as a virtual function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54247 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoimprove order
Chris Lattner [Thu, 31 Jul 2008 06:48:13 +0000 (06:48 +0000)]
improve order

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54244 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix a regression I introduced in r54107:
Chris Lattner [Thu, 31 Jul 2008 04:58:58 +0000 (04:58 +0000)]
Fix a regression I introduced in r54107:
http://llvm.org/viewvc/llvm-project?view=rev&revision=54107

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54242 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUpdated to match new atomic names (to enable overloading for pointers to
Mon P Wang [Thu, 31 Jul 2008 03:28:23 +0000 (03:28 +0000)]
Updated to match new atomic names (to enable overloading for pointers to
different address spaces) for llvm r54195.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54241 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix implicit initialization of structures.
Daniel Dunbar [Wed, 30 Jul 2008 21:00:24 +0000 (21:00 +0000)]
Fix implicit initialization of structures.

<rdar://problem/6113085>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54237 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUse stable sort.
Ted Kremenek [Wed, 30 Jul 2008 18:03:31 +0000 (18:03 +0000)]
Use stable sort.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54222 91177308-0d34-0410-b5e6-96231b3b80d8

16 years ago"Escape" bug names with quotes for selecting/deselecting from the bug table.
Ted Kremenek [Wed, 30 Jul 2008 17:58:08 +0000 (17:58 +0000)]
"Escape" bug names with quotes for selecting/deselecting from the bug table.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54220 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd range highlighting for path-sensitive return-of-stack-address check.
Ted Kremenek [Wed, 30 Jul 2008 17:49:12 +0000 (17:49 +0000)]
Add range highlighting for path-sensitive return-of-stack-address check.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54219 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoChange CodeGenModule GlobalDeclMap to directly reference globals
Daniel Dunbar [Wed, 30 Jul 2008 16:32:24 +0000 (16:32 +0000)]
Change CodeGenModule GlobalDeclMap to directly reference globals
instead of mapping the decl to a bitcast of the global to the correct
type.

 - GetAddrOf{Function,GlobalVar} introduce the bitcast on every use now.

 - This solves a problem where a dangling pointer could be introduced
   by the RAUW done when replacing a forward or tentative
   definition. See testcase for more details.

 - Fixes <rdar://problem/6108358>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54211 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix regression in range highlighting in HTML output.
Ted Kremenek [Tue, 29 Jul 2008 23:35:38 +0000 (23:35 +0000)]
Fix regression in range highlighting in HTML output.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54181 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRework codegen emission of globals
Daniel Dunbar [Tue, 29 Jul 2008 23:18:29 +0000 (23:18 +0000)]
Rework codegen emission of globals
 - No (intended) functionality change.

 - Primary purpose is to clearly separate (lazy) construction of
   globals that are a forward declaration or tentative definition from
   those that are the final definition.

 - Lazy construction is now encapsulated in
   GetAddrOf{Function,GlobalVar} while final definitions are
   constructed in EmitGlobal{Function,Var}Definition.

 - External interface for dealing with globals is now limited to
   EmitGlobal and GetAddrOf{Function,GlobalVar}.

 - Also updated helper functions dealing with statics, annotations,
   and ctors to be private.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54179 91177308-0d34-0410-b5e6-96231b3b80d8