]> granicus.if.org Git - clang/log
clang
14 years agoFix a thinko where we weren't always performing unary conversions on the switch condi...
Douglas Gregor [Wed, 25 Nov 2009 15:17:36 +0000 (15:17 +0000)]
Fix a thinko where we weren't always performing unary conversions on the switch condition, fixing PR5612

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

14 years agoWhat the FIXMEs want, the FIXMEs shall have.
Daniel Dunbar [Wed, 25 Nov 2009 11:53:23 +0000 (11:53 +0000)]
What the FIXMEs want, the FIXMEs shall have.

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

14 years agoAdd an arg_iterator, for iterating over a subset of arguments in an ArgList.
Daniel Dunbar [Wed, 25 Nov 2009 11:33:30 +0000 (11:33 +0000)]
Add an arg_iterator, for iterating over a subset of arguments in an ArgList.

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

14 years agoAdd a missing include <cstdio>
Daniel Dunbar [Wed, 25 Nov 2009 10:53:00 +0000 (10:53 +0000)]
Add a missing include <cstdio>

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

14 years agoFix some uses of fprintf/stderr without a prototype.
Daniel Dunbar [Wed, 25 Nov 2009 10:27:48 +0000 (10:27 +0000)]
Fix some uses of fprintf/stderr without a prototype.

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

14 years agoAdd clang -cc1 parsing for frontend options.
Daniel Dunbar [Wed, 25 Nov 2009 10:14:52 +0000 (10:14 +0000)]
Add clang -cc1 parsing for frontend options.

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

14 years agoAdd ParseSourceLocation::FromString, and simplify.
Daniel Dunbar [Wed, 25 Nov 2009 10:14:44 +0000 (10:14 +0000)]
Add ParseSourceLocation::FromString, and simplify.

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

14 years agoAdd clang -cc1 parsing for preprocessor output options (-E).
Daniel Dunbar [Wed, 25 Nov 2009 10:14:37 +0000 (10:14 +0000)]
Add clang -cc1 parsing for preprocessor output options (-E).

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

14 years agoDon't pass -fexceptions=0 (it is the default).
Daniel Dunbar [Wed, 25 Nov 2009 10:14:30 +0000 (10:14 +0000)]
Don't pass -fexceptions=0 (it is the default).

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

14 years agoThis patch streamlines CheckerVisitor.def so that it follows the usual '#ifndef foo...
Kovarththanan Rajaratnam [Wed, 25 Nov 2009 08:37:20 +0000 (08:37 +0000)]
This patch streamlines CheckerVisitor.def so that it follows the usual '#ifndef foo' pattern:

#ifndef foo
#define foo(parm1)
#endif

foo(parm1) parm1 ...

#undef foo

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

14 years agoFix for Path::isSpecialFile to Path::isRegularFile API in rev 89765.
Edward O'Callaghan [Wed, 25 Nov 2009 06:33:27 +0000 (06:33 +0000)]
Fix for Path::isSpecialFile to Path::isRegularFile API in rev 89765.

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

14 years agoWhen the condition of a switch() statement is semantically invalid,
Douglas Gregor [Wed, 25 Nov 2009 06:20:02 +0000 (06:20 +0000)]
When the condition of a switch() statement is semantically invalid,
still parse the body of the switch to try to avoid spurious
diagnostics. Fixes PR5606.

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

14 years agoDon't crash when we re-use a template specialization node for an explicit instantiati...
Douglas Gregor [Wed, 25 Nov 2009 06:01:46 +0000 (06:01 +0000)]
Don't crash when we re-use a template specialization node for an explicit instantiation. lib/Support/CommandLine.cpp is our test case

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

14 years agoRefactor ActOnFinishSwitchStmt to simplify it further
Douglas Gregor [Wed, 25 Nov 2009 05:02:21 +0000 (05:02 +0000)]
Refactor ActOnFinishSwitchStmt to simplify it further

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

14 years agoRefactor ActOnFinishSwitchStmt to simplify and reduce nesting
Douglas Gregor [Wed, 25 Nov 2009 04:55:54 +0000 (04:55 +0000)]
Refactor ActOnFinishSwitchStmt to simplify and reduce nesting

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

14 years agoParse C++ member check attributes - base_check, hiding, and override.
Sean Hunt [Wed, 25 Nov 2009 04:20:27 +0000 (04:20 +0000)]
Parse C++ member check attributes - base_check, hiding, and override.
The attributes are currently ignored.

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

14 years agoDon't try to install .dir files.
Daniel Dunbar [Wed, 25 Nov 2009 03:46:30 +0000 (03:46 +0000)]
Don't try to install .dir files.

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

14 years agoAdd VTT parameter to base ctors/dtors with virtual bases. (They aren't used yet).
Anders Carlsson [Wed, 25 Nov 2009 03:15:49 +0000 (03:15 +0000)]
Add VTT parameter to base ctors/dtors with virtual bases. (They aren't used yet).

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

14 years agoUndefResults is not needed.
Zhongxing Xu [Wed, 25 Nov 2009 03:07:22 +0000 (03:07 +0000)]
UndefResults is not needed.

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

14 years agoImplement proper cleanup semantics for condition variables in for
Douglas Gregor [Wed, 25 Nov 2009 01:51:31 +0000 (01:51 +0000)]
Implement proper cleanup semantics for condition variables in for
statements, e.g.,

  for(; X x = X(); ) { ... }

Daniel or Anders, please review!

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

14 years agoAdd really basic support for blocks in the retain/release checker. For now, anytime...
Ted Kremenek [Wed, 25 Nov 2009 01:35:18 +0000 (01:35 +0000)]
Add really basic support for blocks in the retain/release checker.  For now, anytime we pass a tracked object to a block call we stop tracking it.

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

14 years agoAllow building of CFGs for ASTs that contain BlockExprs.
Ted Kremenek [Wed, 25 Nov 2009 01:34:30 +0000 (01:34 +0000)]
Allow building of CFGs for ASTs that contain BlockExprs.

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

14 years agoAdd transfer function support for BlockExpr.
Ted Kremenek [Wed, 25 Nov 2009 01:33:13 +0000 (01:33 +0000)]
Add transfer function support for BlockExpr.

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

14 years agoSplit CodeTextRegion into FunctionTextRegion and BlockTextRegion. This a precursor...
Ted Kremenek [Wed, 25 Nov 2009 01:32:22 +0000 (01:32 +0000)]
Split CodeTextRegion into FunctionTextRegion and BlockTextRegion.  This a precursor to having basic static analysis support for blocks.

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

14 years agoSome fancy footwork to move the decision on how
Fariborz Jahanian [Wed, 25 Nov 2009 01:26:41 +0000 (01:26 +0000)]
Some fancy footwork to move the decision on how
to build casted expression-list AST to Sema.

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

14 years agoQualify the name of the llvm::cast template. I am somewhat amazed that GCC parsed...
Douglas Gregor [Wed, 25 Nov 2009 00:38:36 +0000 (00:38 +0000)]
Qualify the name of the llvm::cast template. I am somewhat amazed that GCC parsed this

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

14 years agoDon't try to parse LinkAllParses.h for now
Douglas Gregor [Wed, 25 Nov 2009 00:31:20 +0000 (00:31 +0000)]
Don't try to parse LinkAllParses.h for now

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

14 years agoTweak the code-generation-for-condition-variables test case to get to what we want...
Douglas Gregor [Wed, 25 Nov 2009 00:29:29 +0000 (00:29 +0000)]
Tweak the code-generation-for-condition-variables test case to get to what we want to test

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

14 years agoEliminate CXXConditionDeclExpr with extreme prejudice.
Douglas Gregor [Wed, 25 Nov 2009 00:27:52 +0000 (00:27 +0000)]
Eliminate CXXConditionDeclExpr with extreme prejudice.

All statements that involve conditions can now hold on to a separate
condition declaration (a VarDecl), and will use a DeclRefExpr
referring to that VarDecl for the condition expression. ForStmts now
have such a VarDecl (I'd missed those in previous commits).

Also, since this change reworks the Action interface for
if/while/switch/for, use FullExprArg for the full expressions in those
expressions, to ensure that we're emitting

Note that we are (still) not generating the right cleanups for
condition variables in for statements. That will be a follow-on
commit.

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

14 years agoHave the parser tell sema whether a member declaration is a function definition....
Sebastian Redl [Tue, 24 Nov 2009 23:38:44 +0000 (23:38 +0000)]
Have the parser tell sema whether a member declaration is a function definition. This allows sema to not emit spurious diagnostics in some invalid code.

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

14 years agoConvert test case to FileCheck to test the behavior of the nil-receiver checker when...
Ted Kremenek [Tue, 24 Nov 2009 22:56:53 +0000 (22:56 +0000)]
Convert test case to FileCheck to test the behavior of the nil-receiver checker when the code is targetted for either Tiger or Leopard.

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

14 years agoFor the nil-receiver checker, take into account the behavioral changes that got intro...
Ted Kremenek [Tue, 24 Nov 2009 22:48:18 +0000 (22:48 +0000)]
For the nil-receiver checker, take into account the behavioral changes that got introduced in Mac OS X 10.5 and later, notably return values of double, float, etc., will not be garbage.  Fixes <rdar://problem/6829160>.

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

14 years agoCleanups and fixes to the nil-receiver checker, some of it fallout the
Ted Kremenek [Tue, 24 Nov 2009 21:41:28 +0000 (21:41 +0000)]
Cleanups and fixes to the nil-receiver checker, some of it fallout the
initial transition of the nil-receiver checker to the Checker
interface as done in r89745.  Some important changes include:

1) We consolidate the BugType object used for nil receiver bug
reports, and don't include the type of the returned value in the
BugType (which would be wrong if a nil receiver bug was reported more
than once)

2) Added a new (temporary) flag to CheckerContext: DoneEvauating.
This is used by GRExprEngine when evaluating message expressions to
not continue evaluating the message expression if this flag is set.
This flag is currently set by the nil receiver checker.  This is an
intermediate solution to allow the nil-receiver checker to properly
work as a plug-in outside of GRExprEngine.  Basically, this flag
indicates that the entire message expression has been evaluated, not
just a precondition (which is what the nil-receiver checker does).
This flag *should not* be repurposed for general use, but just to pull
more things out of GRExprEngine that already in there as we devise a
better interface in the Checker class.

3) Cleaned up the logic in the nil-receiver checker, making the
control-flow a lot easier to read.

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

14 years agoRefactor argument collection of constructor calls using
Fariborz Jahanian [Tue, 24 Nov 2009 21:37:28 +0000 (21:37 +0000)]
Refactor argument collection of constructor calls using
the common routine.

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

14 years ago"Do" loops cannot have condition variables, so don't parse them.
Douglas Gregor [Tue, 24 Nov 2009 21:34:32 +0000 (21:34 +0000)]
"Do" loops cannot have condition variables, so don't parse them.

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

14 years agoClean up the AST for while loops and fix several problems with
Douglas Gregor [Tue, 24 Nov 2009 21:15:44 +0000 (21:15 +0000)]
Clean up the AST for while loops and fix several problems with
cleanups for while loops:

1) Make sure that we destroy the condition variable of a while statement each time through the loop for, e.g.,

   while (shared_ptr<WorkInt> p = getWorkItem()) {
         // ...
         }

2) Make sure that we always enter a new cleanup scope for the body of the while loop, even when there is no compound expression, e.g.,

   while (blah)
     RAIIObject raii(blah+1);

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

14 years agoHandle references correctly when synthesizing copy constructors.
Anders Carlsson [Tue, 24 Nov 2009 21:08:10 +0000 (21:08 +0000)]
Handle references correctly when synthesizing copy constructors.

With this change, the clang-on-clang test result is now

Expected Passes    : 224
Unexpected Failures: 37

Which means that we can compile over 80% of clang with clang! :)

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

14 years agoFix some major problems dealing with dependently-qualified names in implicit
John McCall [Tue, 24 Nov 2009 20:33:45 +0000 (20:33 +0000)]
Fix some major problems dealing with dependently-qualified names in implicit
member-reference contexts.  Fixes some clang-on-clang asserts.

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

14 years agoFix the test case failed in buildbot.
Fariborz Jahanian [Tue, 24 Nov 2009 19:37:10 +0000 (19:37 +0000)]
Fix the test case failed in buildbot.

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

14 years agoMore cleanup of argument call collection.
Fariborz Jahanian [Tue, 24 Nov 2009 19:27:49 +0000 (19:27 +0000)]
More cleanup of argument call collection.

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

14 years agoRip out TemplateIdRefExpr and make UnresolvedLookupExpr and
John McCall [Tue, 24 Nov 2009 19:00:30 +0000 (19:00 +0000)]
Rip out TemplateIdRefExpr and make UnresolvedLookupExpr and
DependentScopeDeclRefExpr support storing templateids.  Unite the common
code paths between ActOnDeclarationNameExpr and ActOnTemplateIdExpr.

This gets us to a point where we don't need to store function templates in
the AST using TemplateNames, which is critical to ripping out OverloadedFunction.

Also resolves a few FIXMEs.

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

14 years agoDeclarationName::getIdentifier should take a const IdentifierInfo, since the
John McCall [Tue, 24 Nov 2009 18:44:29 +0000 (18:44 +0000)]
DeclarationName::getIdentifier should take a const IdentifierInfo, since the
constructor does anyway.

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

14 years agoHandle cases where we're constructing an array of objects and the constructor has...
Anders Carlsson [Tue, 24 Nov 2009 18:43:52 +0000 (18:43 +0000)]
Handle cases where we're constructing an array of objects and the constructor has default arguments.

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

14 years agoHelper function for turning a TemplateName into a DeclarationName.
John McCall [Tue, 24 Nov 2009 18:42:40 +0000 (18:42 +0000)]
Helper function for turning a TemplateName into a DeclarationName.

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

14 years agoRefactor collection of call arguments in common code.
Fariborz Jahanian [Tue, 24 Nov 2009 18:29:37 +0000 (18:29 +0000)]
Refactor collection of call arguments in common code.
Add support for variadic collection functions. More to do
here.

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

14 years agoGNUNullExpr is a valid sentinel even though it isn't of pointer type.
Anders Carlsson [Tue, 24 Nov 2009 17:24:21 +0000 (17:24 +0000)]
GNUNullExpr is a valid sentinel even though it isn't of pointer type.

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

14 years agoMake sure redeclaration chains are properly linked, even through invalid decls. This...
Sebastian Redl [Tue, 24 Nov 2009 17:14:34 +0000 (17:14 +0000)]
Make sure redeclaration chains are properly linked, even through invalid decls. This fixes PR5415.

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

14 years agoExplicitly store the condition variable within switch statements, and
Douglas Gregor [Tue, 24 Nov 2009 17:07:59 +0000 (17:07 +0000)]
Explicitly store the condition variable within switch statements, and
make sure that this variable is destroyed when we exit the switch
statement.

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

14 years agoWe always need to emit the base expression of a member expression, even when the...
Anders Carlsson [Tue, 24 Nov 2009 16:57:33 +0000 (16:57 +0000)]
We always need to emit the base expression of a member expression, even when the member decl refers to an enum. Thanks to Eli for pointing this out!

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

14 years agoFix a crash when "instantiating" VarDecls that are neither type nor value dependent.
Anders Carlsson [Tue, 24 Nov 2009 16:52:50 +0000 (16:52 +0000)]
Fix a crash when "instantiating" VarDecls that are neither type nor value dependent.

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

14 years agoIntroduce cleanup scopes for "if" statements in two places:
Douglas Gregor [Tue, 24 Nov 2009 16:43:22 +0000 (16:43 +0000)]
Introduce cleanup scopes for "if" statements in two places:
  - Outside the "if", to ensure that we destroy the condition variable
    at the end of the "if" statement rather than at the end of the
    block containing the "if" statement.
  - Inside the "then" and "else" branches, so that we emit then- or
    else-local cleanups at the end of the corresponding block when the
    block is not a compound statement.

To make adding these new cleanup scopes easier (and since
switch/do/while will all need the same treatment), added the
CleanupScope RAII object to introduce a new cleanup scope and make
sure it gets cleaned up.

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

14 years agoRemove empty wpa directory. It was moved to examples/wpa in r88825
Kovarththanan Rajaratnam [Tue, 24 Nov 2009 16:40:46 +0000 (16:40 +0000)]
Remove empty wpa directory. It was moved to examples/wpa in r88825

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

14 years agoSort CMakeLists.txt
Kovarththanan Rajaratnam [Tue, 24 Nov 2009 16:32:20 +0000 (16:32 +0000)]
Sort CMakeLists.txt

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

14 years agoRename CleanupScope -> DelayedCleanupBlock. No functionality change.
Douglas Gregor [Tue, 24 Nov 2009 16:21:10 +0000 (16:21 +0000)]
Rename CleanupScope -> DelayedCleanupBlock. No functionality change.

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

14 years agoUpdate project file.
Anders Carlsson [Tue, 24 Nov 2009 16:12:41 +0000 (16:12 +0000)]
Update project file.

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

14 years agoUn-break instantiation of if statements with conditional variables
Douglas Gregor [Tue, 24 Nov 2009 16:07:02 +0000 (16:07 +0000)]
Un-break instantiation of if statements with conditional variables

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

14 years agoFix for PR5568.
Edward O'Callaghan [Tue, 24 Nov 2009 15:23:21 +0000 (15:23 +0000)]
Fix for PR5568.

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

14 years agoRemove trailing spaces
Kovarththanan Rajaratnam [Tue, 24 Nov 2009 14:30:21 +0000 (14:30 +0000)]
Remove trailing spaces

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

14 years agoAdd getByteSize() and getTypeSizeInBytes().
Ken Dyck [Tue, 24 Nov 2009 12:04:54 +0000 (12:04 +0000)]
Add getByteSize() and getTypeSizeInBytes().

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

14 years agoWe can remove this file now.
Zhongxing Xu [Tue, 24 Nov 2009 08:28:49 +0000 (08:28 +0000)]
We can remove this file now.

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

14 years agoRefactor undefined result checker. This is the last one.
Zhongxing Xu [Tue, 24 Nov 2009 08:24:26 +0000 (08:24 +0000)]
Refactor undefined result checker. This is the last one.

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

14 years agoRefactor NilReceiverStructRet and NilReceiverLargerThanVoidPtrRet into
Zhongxing Xu [Tue, 24 Nov 2009 07:06:39 +0000 (07:06 +0000)]
Refactor NilReceiverStructRet and NilReceiverLargerThanVoidPtrRet into
CallAndMessageChecker.

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

14 years agoRemove trailing spaces
Kovarththanan Rajaratnam [Tue, 24 Nov 2009 06:30:23 +0000 (06:30 +0000)]
Remove trailing spaces

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

14 years agoGet rid of the ugly CGCXX names and replace them with CGClass, CGExprCXX and CGTempor...
Anders Carlsson [Tue, 24 Nov 2009 05:51:11 +0000 (05:51 +0000)]
Get rid of the ugly CGCXX names and replace them with CGClass, CGExprCXX and CGTemporaries.

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

14 years agoWhen mangling a ctor/dtor we need to take into consideration whether it's a member...
Anders Carlsson [Tue, 24 Nov 2009 05:36:32 +0000 (05:36 +0000)]
When mangling a ctor/dtor we need to take into consideration whether it's a member template.

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

14 years agoSet the template specialization kind before instantiating the function definition...
Anders Carlsson [Tue, 24 Nov 2009 05:34:41 +0000 (05:34 +0000)]
Set the template specialization kind before instantiating the function definition so that the function will have the right linkage.

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

14 years agoTeach Evaluate to handle member expressions referring to enum constants and
Eli Friedman [Tue, 24 Nov 2009 05:28:59 +0000 (05:28 +0000)]
Teach Evaluate to handle member expressions referring to enum constants and
static member constants. No significant visible difference at the moment
because it conservatively assumes the base has side effects. I'm planning to
use this for CodeGen.

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

14 years agoIgnore constructor member templates in CodeGenModule::EmitTopLevelDecl.
Anders Carlsson [Tue, 24 Nov 2009 05:16:24 +0000 (05:16 +0000)]
Ignore constructor member templates in CodeGenModule::EmitTopLevelDecl.

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

14 years agoIt is common for vtables to contain pointers to functions that have either incomplete...
Anders Carlsson [Tue, 24 Nov 2009 05:08:52 +0000 (05:08 +0000)]
It is common for vtables to contain pointers to functions that have either incomplete return types or incomplete argument types.

Handle this by returning the llvm::OpaqueType for those cases, which CodeGenModule::GetOrCreateLLVMFunction knows about, and treats as being an "incomplete function".

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

14 years agorename UndefinedArgChecker to CallAndMessageChecker.
Zhongxing Xu [Tue, 24 Nov 2009 04:45:44 +0000 (04:45 +0000)]
rename UndefinedArgChecker to CallAndMessageChecker.

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

14 years agoRename: UndefinedArgChecker.cpp => CallAndMessageChecker.cpp
Zhongxing Xu [Tue, 24 Nov 2009 04:08:01 +0000 (04:08 +0000)]
Rename: UndefinedArgChecker.cpp => CallAndMessageChecker.cpp

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

14 years agoEnhance null dereference diagnostics by indicating what variable (if any) was derefer...
Ted Kremenek [Tue, 24 Nov 2009 01:33:10 +0000 (01:33 +0000)]
Enhance null dereference diagnostics by indicating what variable (if any) was dereferenced.  Addresses <rdar://problem/7039161>.

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

14 years agoSketch the rest of the clang -cc1 option definitions, aka fun with C-x C-(.
Daniel Dunbar [Tue, 24 Nov 2009 00:54:16 +0000 (00:54 +0000)]
Sketch the rest of the clang -cc1 option definitions, aka fun with C-x C-(.

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

14 years agoExplicitly track the condition variable within an "if" statement,
Douglas Gregor [Mon, 23 Nov 2009 23:44:04 +0000 (23:44 +0000)]
Explicitly track the condition variable within an "if" statement,
rather than burying it in a CXXConditionDeclExpr (that occassionally
hides behind implicit conversions). Similar changes for
switch, while, and do-while will follow, then the removal of
CXXConditionDeclExpr. This commit is the canary.

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

14 years agoAdd clang -cc1 parsing of diagnostic options.
Daniel Dunbar [Mon, 23 Nov 2009 23:41:17 +0000 (23:41 +0000)]
Add clang -cc1 parsing of diagnostic options.

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

14 years agoAfter performing a bounds check in ArrayBoundChecker, record the fact that a bounds...
Ted Kremenek [Mon, 23 Nov 2009 23:23:26 +0000 (23:23 +0000)]
After performing a bounds check in ArrayBoundChecker, record the fact that a bounds check succeeded by transitioning the ExplodedGraph.

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

14 years agoClean up the Checker API a little more, resolving some hidden bugs
Ted Kremenek [Mon, 23 Nov 2009 22:22:01 +0000 (22:22 +0000)]
Clean up the Checker API a little more, resolving some hidden bugs
along the way.  Important changes:

1) To generate a sink node, use GenerateSink(); GenerateNode() is for
generating regular transitions.  This makes the API clearer and also
allows us to use the 'bool' option to GenerateNode() for a different
purpose.

2) GenerateNode() now automatically adds the generated node to the
destination ExplodedNodeSet (autotransition) unless the client
specifies otherwise with a bool flag.  Several checkers did not call
'addTransition()' after calling 'GenerateNode()', causing the
simulation path to be prematurely culled when a non-fail stop bug was
encountered.

3) Add variants of GenerateNode()/GenerateSink() that take neither a
Stmt* or a GRState*; most callers of GenerateNode() just pass in the
same Stmt* as provided when the CheckerContext object is created; we
can just use that the majority of the time.  This cleanup also allows
us to potentially coelesce the APIs for evaluating branches and
end-of-paths (which currently directly use builders).

4) addTransition() no longer needs to be called except for a few
cases.  We now have a variant of addTransition() that takes a
GRState*; this allows one to propagate the updated state without
caring about generating a new node explicitly.  This nicely cleaned up
a bunch of cases that called autoTransition() with a bunch of
conditional logic surround the call (that common logic has now been
swallowed up by addTransition() itself).

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

14 years agoDon't try to treat an enum constant as an lvalue.
Anders Carlsson [Mon, 23 Nov 2009 21:56:41 +0000 (21:56 +0000)]
Don't try to treat an enum constant as an lvalue.

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

14 years agoConvert the && and || operands to bool using standard conversions. Fixes PR5593.
Anders Carlsson [Mon, 23 Nov 2009 21:47:44 +0000 (21:47 +0000)]
Convert the && and || operands to bool using standard conversions. Fixes PR5593.

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

14 years agoFixe a crash in encoding of SEL type caused by recent changes.
Fariborz Jahanian [Mon, 23 Nov 2009 20:40:50 +0000 (20:40 +0000)]
Fixe a crash in encoding of SEL type caused by recent changes.

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

14 years agoHandle converting member pointers to bool.
Anders Carlsson [Mon, 23 Nov 2009 20:04:44 +0000 (20:04 +0000)]
Handle converting member pointers to bool.

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

14 years agoFix a recent regression probably caused by addition of altivec-style
Fariborz Jahanian [Mon, 23 Nov 2009 19:51:43 +0000 (19:51 +0000)]
Fix a recent regression probably caused by addition of altivec-style
type-casts in the parser.

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

14 years agoProvide out-of-line definition for destructor of Checker.
Ted Kremenek [Mon, 23 Nov 2009 18:53:03 +0000 (18:53 +0000)]
Provide out-of-line definition for destructor of Checker.

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

14 years agoTweak UndefBranchChecker to register the most nested "undefined" expression with...
Ted Kremenek [Mon, 23 Nov 2009 18:12:03 +0000 (18:12 +0000)]
Tweak UndefBranchChecker to register the most nested "undefined" expression with bugreporter::registerTrackNullOrUndefValue instead of the condition itself.

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

14 years agoMake 'SEL' pointer to a builtin type and not an
Fariborz Jahanian [Mon, 23 Nov 2009 18:04:25 +0000 (18:04 +0000)]
Make 'SEL' pointer to a builtin type and not an
objective-c pointer type. This was a serious mishap and
luckily, Ted's test caught that (and patch fixes the test case).

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

14 years agoCleanup title/description of "undefined branch" BugType and add some test cases for...
Ted Kremenek [Mon, 23 Nov 2009 17:58:48 +0000 (17:58 +0000)]
Cleanup title/description of "undefined branch" BugType and add some test cases for this check.

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

14 years agoHandle base-to-derived casts. Will land test case shortly.
Anders Carlsson [Mon, 23 Nov 2009 17:57:54 +0000 (17:57 +0000)]
Handle base-to-derived casts. Will land test case shortly.

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

14 years agoPut back hard-coded paths for win32 until I figure out what happened to failed tests.
John Thompson [Mon, 23 Nov 2009 17:49:27 +0000 (17:49 +0000)]
Put back hard-coded paths for win32 until I figure out what happened to failed tests.

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

14 years agoRemove '-checker-simple' reference from scan-build. Patch by Kovarththanan Rajaratnam!
Ted Kremenek [Mon, 23 Nov 2009 17:37:58 +0000 (17:37 +0000)]
Remove '-checker-simple' reference from scan-build.  Patch by Kovarththanan Rajaratnam!

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

14 years agoIntercept sizeof and alignof references before they get into ASTContext methods....
Sebastian Redl [Mon, 23 Nov 2009 17:18:46 +0000 (17:18 +0000)]
Intercept sizeof and alignof references before they get into ASTContext methods. This fixes a crash when writing sizeof(Incomplete&), and lets ASTContext's methods do the right thing for CodeGen, which fixes PR5590.

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

14 years agoReorder the header search a bit so that it matches gcc exactly:
Rafael Espindola [Mon, 23 Nov 2009 16:31:19 +0000 (16:31 +0000)]
Reorder the header search a bit so that it matches gcc exactly:

*) the ../backward dir is the last in libstdc++ to be searched
*) If compiling c++, the c++ headers are searched first

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

14 years agoLet using directives refer to namespace aliases. Fixes PR5479.
Sebastian Redl [Mon, 23 Nov 2009 15:34:23 +0000 (15:34 +0000)]
Let using directives refer to namespace aliases. Fixes PR5479.

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

14 years agoRequire a class type to be complete before probing its conversion
Douglas Gregor [Mon, 23 Nov 2009 13:53:21 +0000 (13:53 +0000)]
Require a class type to be complete before probing its conversion
functions for a switch condition's conversion to integral or
enumeration type.

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

14 years agoImplement conversion from a switch condition with class type to an
Douglas Gregor [Mon, 23 Nov 2009 13:46:08 +0000 (13:46 +0000)]
Implement conversion from a switch condition with class type to an
integral or enumeration type (vi user-defined conversions). Fixes PR5518.

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

14 years agoCanonical template arguments that are template template parameters by
Douglas Gregor [Mon, 23 Nov 2009 12:52:47 +0000 (12:52 +0000)]
Canonical template arguments that are template template parameters by
their template parameter depth and position, so that we can match
redeclarations appropriately. Fixes PR5527 and PR5528.

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

14 years agoImprove type-checking of templates by distinguishing between members
Douglas Gregor [Mon, 23 Nov 2009 12:39:54 +0000 (12:39 +0000)]
Improve type-checking of templates by distinguishing between members
of the current instantiation and members of an unknown specialization
when type-checking a qualified-if expression.

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

14 years agoDo not mark declarations as used when performing overload resolution. Fixes PR5541
Douglas Gregor [Mon, 23 Nov 2009 12:27:39 +0000 (12:27 +0000)]
Do not mark declarations as used when performing overload resolution. Fixes PR5541

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

14 years agoTolerate extraneous "template<>" headers better, downgrading the
Douglas Gregor [Mon, 23 Nov 2009 12:11:45 +0000 (12:11 +0000)]
Tolerate extraneous "template<>" headers better, downgrading the
complaint to a warning and providing a helpful node in the case where
the "template<>" header is redundant because the corresponding
template-id refers to an explicit specialization. C++0x might still
change this behavior, and existing practice is all over the place on
the number of "template<>" headers actually needed.

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

14 years agoFix CMake build
Douglas Gregor [Mon, 23 Nov 2009 12:03:50 +0000 (12:03 +0000)]
Fix CMake build

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

14 years agoCentralize and complete the computation of value- and type-dependence for DeclRefExprs
Douglas Gregor [Mon, 23 Nov 2009 11:41:28 +0000 (11:41 +0000)]
Centralize and complete the computation of value- and type-dependence for DeclRefExprs

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