]> granicus.if.org Git - clang/log
clang
15 years agoMore improvements to namespace aliases. We now support everything except aliases...
Anders Carlsson [Sat, 28 Mar 2009 23:53:49 +0000 (23:53 +0000)]
More improvements to namespace aliases. We now support everything except aliases in using directives.

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

15 years agoHandle the case where the namespace decl is an alias.
Anders Carlsson [Sat, 28 Mar 2009 23:50:18 +0000 (23:50 +0000)]
Handle the case where the namespace decl is an alias.

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

15 years agoFix lookup bug
Anders Carlsson [Sat, 28 Mar 2009 23:49:35 +0000 (23:49 +0000)]
Fix lookup bug

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

15 years agoLet getIdentifierNamespaceForKind know about aliases and have it treat them just...
Anders Carlsson [Sat, 28 Mar 2009 23:02:53 +0000 (23:02 +0000)]
Let getIdentifierNamespaceForKind know about aliases and have it treat them just like namespace decls.

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

15 years agoCreate AST nodes for namespace aliases.
Anders Carlsson [Sat, 28 Mar 2009 22:58:02 +0000 (22:58 +0000)]
Create AST nodes for namespace aliases.

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

15 years agoParse the location of the 'namespace' token to ActOnNamespaceAliasDef. No functionali...
Anders Carlsson [Sat, 28 Mar 2009 22:53:22 +0000 (22:53 +0000)]
Parse the location of the 'namespace' token to ActOnNamespaceAliasDef. No functionality change.

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

15 years agoFix regression in pointer comparison with NULL (e.g., 0 != ptr). This fixes
Ted Kremenek [Sat, 28 Mar 2009 19:59:33 +0000 (19:59 +0000)]
Fix regression in pointer comparison with NULL (e.g., 0 != ptr). This fixes
<rdar://problem/6732151>.

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

15 years agoIntroduce a new OpaquePtr<N> struct type, which is a simple POD wrapper for a
Chris Lattner [Sat, 28 Mar 2009 19:18:32 +0000 (19:18 +0000)]
Introduce a new OpaquePtr<N> struct type, which is a simple POD wrapper for a
pointer.  Its purpose in life is to be a glorified void*, but which does not
implicitly convert to void* or other OpaquePtr's with a different UID.

Introduce Action::DeclPtrTy which is a typedef for OpaquePtr<0>.  Change the
entire parser/sema interface to use DeclPtrTy instead of DeclTy*.  This
makes the C++ compiler enforce that these aren't convertible to other opaque
types.

We should also convert ExprTy, StmtTy, TypeTy, AttrTy, BaseTy, etc,
but I don't plan to do that in the short term.

The one outstanding known problem with this patch is that we lose the
bitmangling optimization where ActionResult<DeclPtrTy> doesn't know how to
bitmangle the success bit into the low bit of DeclPtrTy.  I will rectify
this with a subsequent patch.

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

15 years agosort alphabetically
Chris Lattner [Sat, 28 Mar 2009 19:10:22 +0000 (19:10 +0000)]
sort alphabetically

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

15 years agoAdjust control-flow endpoints for '&&' and '||'.
Ted Kremenek [Sat, 28 Mar 2009 17:33:57 +0000 (17:33 +0000)]
Adjust control-flow endpoints for '&&' and '||'.

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

15 years agoAdd comparison operators for PathDiagosticLocation.
Ted Kremenek [Sat, 28 Mar 2009 17:33:08 +0000 (17:33 +0000)]
Add comparison operators for PathDiagosticLocation.

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

15 years agoAdd comparison operators for SourceRange.
Ted Kremenek [Sat, 28 Mar 2009 17:32:39 +0000 (17:32 +0000)]
Add comparison operators for SourceRange.

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

15 years agoCMake: remove TranslationUnit.cpp from build (file has been removed).
Cedric Venet [Sat, 28 Mar 2009 12:41:49 +0000 (12:41 +0000)]
CMake: remove TranslationUnit.cpp from build (file has been removed).

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

15 years agomove file to proper place.
Chris Lattner [Sat, 28 Mar 2009 08:04:44 +0000 (08:04 +0000)]
move file to proper place.

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

15 years agoAs Eli pointed out, it is possible that a namespace lookup is ambiguous!
Anders Carlsson [Sat, 28 Mar 2009 07:51:31 +0000 (07:51 +0000)]
As Eli pointed out, it is possible that a namespace lookup is ambiguous!

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

15 years agoadd accessors.
Chris Lattner [Sat, 28 Mar 2009 07:00:38 +0000 (07:00 +0000)]
add accessors.

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

15 years agosome random cleanups
Chris Lattner [Sat, 28 Mar 2009 06:53:40 +0000 (06:53 +0000)]
some random cleanups

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

15 years agoeliminate unneeded iterator wrappers.
Chris Lattner [Sat, 28 Mar 2009 06:47:16 +0000 (06:47 +0000)]
eliminate unneeded iterator wrappers.

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

15 years agochange NamespaceDecl to hold its 'NextNamespace' pointer itself
Chris Lattner [Sat, 28 Mar 2009 06:44:59 +0000 (06:44 +0000)]
change NamespaceDecl to hold its 'NextNamespace' pointer itself
instead of in NextDeclarator.  This temporarily increases memory
usage, but simplifies and decouples things.

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

15 years agoCheck that the alias points to a valid namespace.
Anders Carlsson [Sat, 28 Mar 2009 06:42:02 +0000 (06:42 +0000)]
Check that the alias points to a valid namespace.

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

15 years agoProperly escape special characters in <string>'s in plist file.
Ted Kremenek [Sat, 28 Mar 2009 06:40:54 +0000 (06:40 +0000)]
Properly escape special characters in <string>'s in plist file.

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

15 years agorename some methods.
Chris Lattner [Sat, 28 Mar 2009 06:33:19 +0000 (06:33 +0000)]
rename some methods.

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

15 years agoCleanups for DeclGroup.
Chris Lattner [Sat, 28 Mar 2009 06:26:18 +0000 (06:26 +0000)]
Cleanups for DeclGroup.

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

15 years agoCheck that the namespace alias doesn't conflict with a previous declaration in this...
Anders Carlsson [Sat, 28 Mar 2009 06:23:46 +0000 (06:23 +0000)]
Check that the namespace alias doesn't conflict with a previous declaration in this scope.

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

15 years agotidy whitespace.
Chris Lattner [Sat, 28 Mar 2009 06:13:37 +0000 (06:13 +0000)]
tidy whitespace.

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

15 years agorename NextDeclInScope to NextDeclInContext, since the pointer
Chris Lattner [Sat, 28 Mar 2009 06:04:26 +0000 (06:04 +0000)]
rename NextDeclInScope to NextDeclInContext, since the pointer
points within contexts not scopes.

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

15 years agosimplify getNextDeclInScope
Chris Lattner [Sat, 28 Mar 2009 05:59:45 +0000 (05:59 +0000)]
simplify getNextDeclInScope

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

15 years agoreduce indentation, no functionality change.
Chris Lattner [Sat, 28 Mar 2009 05:44:17 +0000 (05:44 +0000)]
reduce indentation, no functionality change.

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

15 years agoAdd an ActOnNamespaceAliasDef action and have the parser call it.
Anders Carlsson [Sat, 28 Mar 2009 05:27:17 +0000 (05:27 +0000)]
Add an ActOnNamespaceAliasDef action and have the parser call it.

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

15 years agoremove TranslationUnit.
Chris Lattner [Sat, 28 Mar 2009 04:31:31 +0000 (04:31 +0000)]
remove TranslationUnit.

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

15 years agopush more ASTContext goodness out through interfaces that use
Chris Lattner [Sat, 28 Mar 2009 04:27:18 +0000 (04:27 +0000)]
push more ASTContext goodness out through interfaces that use
 TranslationUnit

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

15 years agoRevert Sebastian's rvalue patch (r67870) since it caused test failures in
Anders Carlsson [Sat, 28 Mar 2009 04:17:27 +0000 (04:17 +0000)]
Revert Sebastian's rvalue patch (r67870) since it caused test failures in

SemaCXX//overload-member-call.cpp
SemaCXX//overloaded-operator.cpp
SemaTemplate//instantiate-method.cpp

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

15 years agoremove TranslationUnit from ParseAST.
Chris Lattner [Sat, 28 Mar 2009 04:13:34 +0000 (04:13 +0000)]
remove TranslationUnit from ParseAST.

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

15 years agochange HandleTranslationUnit to take an ASTContext instead of TranslationUnit
Chris Lattner [Sat, 28 Mar 2009 04:11:33 +0000 (04:11 +0000)]
change HandleTranslationUnit to take an ASTContext instead of TranslationUnit

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

15 years agoText PathDiagnosticBuilder::getEnclosingStmt() about '?'
Ted Kremenek [Sat, 28 Mar 2009 04:08:14 +0000 (04:08 +0000)]
Text PathDiagnosticBuilder::getEnclosingStmt() about '?'

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

15 years agoParse namespace aliases.
Anders Carlsson [Sat, 28 Mar 2009 04:07:16 +0000 (04:07 +0000)]
Parse namespace aliases.

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

15 years agoremove dead ivar.
Chris Lattner [Sat, 28 Mar 2009 04:05:05 +0000 (04:05 +0000)]
remove dead ivar.

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

15 years agosimplify away some dead ownership stuff, TranslationUnit is now
Chris Lattner [Sat, 28 Mar 2009 04:00:23 +0000 (04:00 +0000)]
simplify away some dead ownership stuff, TranslationUnit is now
just a wrapper around ASTContext.

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

15 years agohoist TranslationUnit some more.
Chris Lattner [Sat, 28 Mar 2009 03:56:54 +0000 (03:56 +0000)]
hoist TranslationUnit some more.

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

15 years agoeliminate some wrappers.
Chris Lattner [Sat, 28 Mar 2009 03:53:02 +0000 (03:53 +0000)]
eliminate some wrappers.

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

15 years agoeliminate ReadASTBitcodeFile
Chris Lattner [Sat, 28 Mar 2009 03:49:26 +0000 (03:49 +0000)]
eliminate ReadASTBitcodeFile

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

15 years agomove serialization logic from TranslationUnit to ASTContext.
Chris Lattner [Sat, 28 Mar 2009 03:45:20 +0000 (03:45 +0000)]
move serialization logic from TranslationUnit to ASTContext.

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

15 years agoTeach PathDiagnosticBuilder::getEnclosingStmtLocation() about while/if/do/for,
Ted Kremenek [Sat, 28 Mar 2009 03:37:59 +0000 (03:37 +0000)]
Teach PathDiagnosticBuilder::getEnclosingStmtLocation() about while/if/do/for,
etc., so that the "body" is always considered a top-level statement for edge
transitions (even if it is an expression).

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

15 years agodon't poke at TranslationUnit directly
Chris Lattner [Sat, 28 Mar 2009 03:29:40 +0000 (03:29 +0000)]
don't poke at TranslationUnit directly

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

15 years agoTrivial cleanup.
Eli Friedman [Sat, 28 Mar 2009 03:27:06 +0000 (03:27 +0000)]
Trivial cleanup.

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

15 years agoMove where block-related variables are initialized so that block
Eli Friedman [Sat, 28 Mar 2009 03:24:54 +0000 (03:24 +0000)]
Move where block-related variables are initialized so that block
types don't get generated when blocks aren't used.

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

15 years agoFix silly mistake in test.
Eli Friedman [Sat, 28 Mar 2009 03:14:28 +0000 (03:14 +0000)]
Fix silly mistake in test.

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

15 years agoMinor cleanup.
Eli Friedman [Sat, 28 Mar 2009 03:10:45 +0000 (03:10 +0000)]
Minor cleanup.

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

15 years agoMisc small fixes/cleanups/comment changes.
Eli Friedman [Sat, 28 Mar 2009 02:45:41 +0000 (02:45 +0000)]
Misc small fixes/cleanups/comment changes.

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

15 years agoeliminate ASTConsumer::InitializeTU, all clients are
Chris Lattner [Sat, 28 Mar 2009 02:18:25 +0000 (02:18 +0000)]
eliminate ASTConsumer::InitializeTU, all clients are
happy with just ASTContext, they don't need a TU.

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

15 years agorevert mike's patch which broke test/CodeGen/no-common.c.
Chris Lattner [Sat, 28 Mar 2009 02:12:08 +0000 (02:12 +0000)]
revert mike's patch which broke test/CodeGen/no-common.c.

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

15 years agoremove TranslationUnit::OwnsDecls, which is only set, never read.
Chris Lattner [Sat, 28 Mar 2009 01:44:40 +0000 (01:44 +0000)]
remove TranslationUnit::OwnsDecls, which is only set, never read.

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

15 years agosimplify ParseAST by sucking -disable-free handling logic up into
Chris Lattner [Sat, 28 Mar 2009 01:37:17 +0000 (01:37 +0000)]
simplify ParseAST by sucking -disable-free handling logic up into
clang.cpp

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

15 years agoChange compound assignment operators to keep track of both the promoted
Eli Friedman [Sat, 28 Mar 2009 01:22:36 +0000 (01:22 +0000)]
Change compound assignment operators to keep track of both the promoted
LHS type and the computation result type; this encodes information into
the AST which is otherwise non-obvious.  Fix Sema to always come up with the
right answer for both of these types.  Fix IRGen and the analyzer to
account for these changes.  This fixes PR2601.  The approach is inspired
by PR2601 comment 2.

Note that this changes real *= complex in CodeGen from a silent
miscompilation to an explicit error.

I'm not really sure that the analyzer changes are correct, or how to
test them... someone more familiar with the analyzer should check those
changes.

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

15 years agoImplement access checking for protected base classes.
Anders Carlsson [Sat, 28 Mar 2009 01:09:05 +0000 (01:09 +0000)]
Implement access checking for protected base classes.

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

15 years agomove StatListener out to top level.
Chris Lattner [Sat, 28 Mar 2009 00:55:35 +0000 (00:55 +0000)]
move StatListener out to top level.

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

15 years agoMake our diagnostics about the obsolete GNU designated-initializer
Douglas Gregor [Sat, 28 Mar 2009 00:41:23 +0000 (00:41 +0000)]
Make our diagnostics about the obsolete GNU designated-initializer
syntax into extension warnings, and provide code-modification hints
showing how to fix the problem.

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

15 years agovarious cleanups, no functionality change
Chris Lattner [Sat, 28 Mar 2009 00:16:20 +0000 (00:16 +0000)]
various cleanups, no functionality change

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

15 years agoBetter way to free NestedNameSpecifiers. Thanks, Chris
Douglas Gregor [Fri, 27 Mar 2009 23:54:10 +0000 (23:54 +0000)]
Better way to free NestedNameSpecifiers. Thanks, Chris

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

15 years agoFix <rdar://problem/6724396>, where we were silently dropping
Douglas Gregor [Fri, 27 Mar 2009 23:40:29 +0000 (23:40 +0000)]
Fix <rdar://problem/6724396>, where we were silently dropping
GNU-style array designators, causing us to emit broken initializers.

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

15 years agoPerform a very, very ugly song-and-dance number to free the
Douglas Gregor [Fri, 27 Mar 2009 23:25:45 +0000 (23:25 +0000)]
Perform a very, very ugly song-and-dance number to free the
NestedNameSpecifiers without causing problems for the FoldingSet that
contains them.

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

15 years agoDo not emit debug information for variables while generating optimized code. The...
Devang Patel [Fri, 27 Mar 2009 23:16:32 +0000 (23:16 +0000)]
Do not emit debug information for variables while generating optimized code.  The llvm optimizer and code generator are not yet ready to support optimized code debugging.

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

15 years agoInitial implementation of parsing, semantic analysis, and template
Douglas Gregor [Fri, 27 Mar 2009 23:10:48 +0000 (23:10 +0000)]
Initial implementation of parsing, semantic analysis, and template
instantiation for C++ typename-specifiers such as

  typename T::type

The parsing of typename-specifiers is relatively easy thanks to
annotation tokens. When we see the "typename", we parse the
typename-specifier and produce a typename annotation token. There are
only a few places where we need to handle this. We currently parse the
typename-specifier form that terminates in an identifier, but not the
simple-template-id form, e.g.,

  typename T::template apply<U, V>

Parsing of nested-name-specifiers has a similar problem, since at this
point we don't have any representation of a class template
specialization whose template-name is unknown.

Semantic analysis is only partially complete, with some support for
template instantiation that works for simple examples.

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

15 years agoAdd missing header file change.
Ted Kremenek [Fri, 27 Mar 2009 22:00:38 +0000 (22:00 +0000)]
Add missing header file change.

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

15 years agoBetter overload resolution for rvalue references.
Sebastian Redl [Fri, 27 Mar 2009 21:36:42 +0000 (21:36 +0000)]
Better overload resolution for rvalue references.

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

15 years agoBugReporter: For control-flow edges from 'if', 'for', 'do', 'while' to
Ted Kremenek [Fri, 27 Mar 2009 21:16:25 +0000 (21:16 +0000)]
BugReporter: For control-flow edges from 'if', 'for', 'do', 'while' to
successor, using 'getEnclosingStmt()' to have the end location be the top-level
Stmt* enclosing the target Expr*.

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

15 years agoFinish off semantic analysis for regparm, and remove the warning. Also
Eli Friedman [Fri, 27 Mar 2009 21:06:47 +0000 (21:06 +0000)]
Finish off semantic analysis for regparm, and remove the warning.  Also
remove a redundant error in CodeGen.

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

15 years agoFix test failures caused by reading memory after freeing it. My fix is
Eli Friedman [Fri, 27 Mar 2009 20:56:17 +0000 (20:56 +0000)]
Fix test failures caused by reading memory after freeing it.  My fix is
rather nasty, but I can't think of a better fix off the top of my head.

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

15 years agoBugReporter: PathDiagnosticBuilder::ExecutionContinues now returns a
Ted Kremenek [Fri, 27 Mar 2009 20:55:39 +0000 (20:55 +0000)]
BugReporter: PathDiagnosticBuilder::ExecutionContinues now returns a
PathDiagnosticLocation.

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

15 years agominor cleanups: make getIdentifierNamespace() be a single load
Chris Lattner [Fri, 27 Mar 2009 20:18:19 +0000 (20:18 +0000)]
minor cleanups: make getIdentifierNamespace() be a single load
instead of a load + large inlined switch.

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

15 years agoFixup -fcommon and -fno-common to be more gcc compatible.
Mike Stump [Fri, 27 Mar 2009 20:15:22 +0000 (20:15 +0000)]
Fixup -fcommon and -fno-common to be more gcc compatible.

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

15 years agoreduce # const_casts, no functionality change.
Chris Lattner [Fri, 27 Mar 2009 19:19:59 +0000 (19:19 +0000)]
reduce # const_casts, no functionality change.

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

15 years agoIt is OK to cast to a private base class if the current member belongs to the class...
Anders Carlsson [Fri, 27 Mar 2009 19:01:12 +0000 (19:01 +0000)]
It is OK to cast to a private base class if the current member belongs to the class that the private base class is a base of:

class A {};
class B : private A {
  void f(B *b) { A* a = b; }
};

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

15 years agoAdd a Class field to the base path element structure. This holds the record decl...
Anders Carlsson [Fri, 27 Mar 2009 18:54:29 +0000 (18:54 +0000)]
Add a Class field to the base path element structure. This holds the record decl of the class taht the base is a base of.

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

15 years agochange Decl::DeclCtx to use a PointerIntPair instead of hand bitmangling.
Chris Lattner [Fri, 27 Mar 2009 18:46:15 +0000 (18:46 +0000)]
change Decl::DeclCtx to use a PointerIntPair instead of hand bitmangling.

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

15 years agoBesides the warning, issue unsupported diagnostics in
Fariborz Jahanian [Fri, 27 Mar 2009 18:38:55 +0000 (18:38 +0000)]
Besides the warning, issue unsupported diagnostics in
ir gen. No intended change in functionality.

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

15 years agopush line markers through -E mode.
Chris Lattner [Fri, 27 Mar 2009 17:13:49 +0000 (17:13 +0000)]
push line markers through -E mode.

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

15 years agoUpdate "Getting Started" with more current information about 'clang-cc' and 'clang'.
Ted Kremenek [Fri, 27 Mar 2009 16:32:57 +0000 (16:32 +0000)]
Update "Getting Started" with more current information about 'clang-cc' and 'clang'.

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

15 years agoanalyzer plist: For PathDiagnosticControlFlowPieces, now output an array of
Ted Kremenek [Fri, 27 Mar 2009 15:53:20 +0000 (15:53 +0000)]
analyzer plist: For PathDiagnosticControlFlowPieces, now output an array of
start-end points, where start and end are source ranges.

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

15 years agoEmit aggregate "location" for PathDiagnostic to plist. This fixes <rdar://problem...
Ted Kremenek [Fri, 27 Mar 2009 15:31:11 +0000 (15:31 +0000)]
Emit aggregate "location" for PathDiagnostic to plist.  This fixes <rdar://problem/6729558>.

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

15 years agoMove declaration of 'PathDiagnostic' to the end of PathDiagnostic.h and add PathDiagn...
Ted Kremenek [Fri, 27 Mar 2009 15:24:36 +0000 (15:24 +0000)]
Move declaration of 'PathDiagnostic' to the end of PathDiagnostic.h and add PathDiagnostic::getLocation().

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

15 years agoDriver: Pass -f[no-]pascal-strings on to clang, even if it has been
Daniel Dunbar [Fri, 27 Mar 2009 15:22:28 +0000 (15:22 +0000)]
Driver: Pass -f[no-]pascal-strings on to clang, even if it has been
turned into -m[no-]pascal-strings by the tool chain.
 - This still has issue that derived arguments don't propogate "used"
   information correctly so spurious "argument unused" warnings will
   still show up.

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

15 years agoPathDiagnostic: replace 'std::list' with 'std::deque'
Ted Kremenek [Fri, 27 Mar 2009 14:59:04 +0000 (14:59 +0000)]
PathDiagnostic: replace 'std::list' with 'std::deque'

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

15 years agoAdd iterators to PathDiagnosticControlFlowDiagnostic for iterating over the
Ted Kremenek [Fri, 27 Mar 2009 14:54:49 +0000 (14:54 +0000)]
Add iterators to PathDiagnosticControlFlowDiagnostic for iterating over the
multiple location vectors.

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

15 years agoDriver: -print-libgcc-file-name was searching wrong path list.
Daniel Dunbar [Fri, 27 Mar 2009 14:26:33 +0000 (14:26 +0000)]
Driver: -print-libgcc-file-name was searching wrong path list.

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

15 years agoImplement checking for base class access. Right now it's overly conservative but...
Anders Carlsson [Fri, 27 Mar 2009 06:03:27 +0000 (06:03 +0000)]
Implement checking for base class access. Right now it's overly conservative but that will change. (Also, protected isn't implemented right now).

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

15 years agoIf the user is trying to apply the -> or . member reference operator
Douglas Gregor [Fri, 27 Mar 2009 06:00:30 +0000 (06:00 +0000)]
If the user is trying to apply the -> or . member reference operator
to a function or function pointer, it's probably because the user
forgot to put in parentheses () to call the function.

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

15 years agoremove dead code.
Zhongxing Xu [Fri, 27 Mar 2009 05:31:12 +0000 (05:31 +0000)]
remove dead code.

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

15 years agoUpdate CMake
Douglas Gregor [Fri, 27 Mar 2009 05:18:33 +0000 (05:18 +0000)]
Update CMake

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

15 years agoRemove the code insertion hint for implicit int. Too often, we're wrong about this...
Douglas Gregor [Fri, 27 Mar 2009 05:10:56 +0000 (05:10 +0000)]
Remove the code insertion hint for implicit int. Too often, we're wrong about this hint, so it loses its usefulness. Maybe some day we can make the hint smart enough to be useful.

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

15 years agoBugReporter:
Ted Kremenek [Fri, 27 Mar 2009 05:06:10 +0000 (05:06 +0000)]
BugReporter:
- Added an internal helper class 'PathDiagnosticBuilder' which now bundles the
  'ExecutionContinues' methods.
- Added preliminary diagnostics for short-circuit '&&' and '||'

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

15 years agoAdd a stubbed out CheckBaseClassAccess method.
Anders Carlsson [Fri, 27 Mar 2009 05:05:05 +0000 (05:05 +0000)]
Add a stubbed out CheckBaseClassAccess method.

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

15 years agoMove Sema::SetMemberAccessSpecifier to SemaAccess.cpp
Anders Carlsson [Fri, 27 Mar 2009 04:54:36 +0000 (04:54 +0000)]
Move Sema::SetMemberAccessSpecifier to SemaAccess.cpp

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

15 years agoAdd SemaAccess.cpp
Anders Carlsson [Fri, 27 Mar 2009 04:43:36 +0000 (04:43 +0000)]
Add SemaAccess.cpp

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

15 years agoImprove recovery when a constructor fails to type-check. Test case from Anders
Douglas Gregor [Fri, 27 Mar 2009 04:38:56 +0000 (04:38 +0000)]
Improve recovery when a constructor fails to type-check. Test case from Anders

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

15 years agoTests and fixes for templates declared within (non-template)
Douglas Gregor [Fri, 27 Mar 2009 04:21:56 +0000 (04:21 +0000)]
Tests and fixes for templates declared within (non-template)
classes. Test case from Anders Carlsson, fix from Piotr Rak!

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

15 years agoFix rdar://6719156 - clang should emit a better error when blocks are disabled but...
Chris Lattner [Fri, 27 Mar 2009 04:18:06 +0000 (04:18 +0000)]
Fix rdar://6719156 - clang should emit a better error when blocks are disabled but are used anyway
by changing blocks from being disabled in the parser to being disabled
in Sema.

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

15 years agoremove the updated notes.
Zhongxing Xu [Fri, 27 Mar 2009 02:22:41 +0000 (02:22 +0000)]
remove the updated notes.

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

15 years ago- Fix thinko in implementation of PathDiagnosticLocation::asStmt(). Thanks to
Ted Kremenek [Fri, 27 Mar 2009 02:22:03 +0000 (02:22 +0000)]
- Fix thinko in implementation of PathDiagnosticLocation::asStmt(). Thanks to
  Anders Johnsen for pointing this out.
- Have PathDiagnosticControlFlowPiece take PathDiagnosticLocation for the
  arguments to its constructors.

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

15 years agoFix searching for gcc, we only want executable files.
Mike Stump [Fri, 27 Mar 2009 00:40:20 +0000 (00:40 +0000)]
Fix searching for gcc, we only want executable files.

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