]> granicus.if.org Git - clang/log
clang
16 years agoAssert that Parser::MaybeParseOperatorFunctionId is called when token is kw_operator...
Argyrios Kyrtzidis [Fri, 7 Nov 2008 15:54:02 +0000 (15:54 +0000)]
Assert that Parser::MaybeParseOperatorFunctionId is called when token is kw_operator, and replace ExpectAndConsume for the 'operator' token with a ConsumeToken.

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

16 years agoSeparate the parsing of type-specifiers from other declaration specifiers, so that...
Douglas Gregor [Fri, 7 Nov 2008 15:42:26 +0000 (15:42 +0000)]
Separate the parsing of type-specifiers from other declaration specifiers, so that we can parse a C++ type-specifier-seq

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

16 years agoinclude alloca.h instead of malloc.h. If this doesn't work for everyone we can just...
Anders Carlsson [Fri, 7 Nov 2008 15:41:33 +0000 (15:41 +0000)]
include alloca.h instead of malloc.h. If this doesn't work for everyone we can just declare alloca directly in the file.

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

16 years agoAppend the test runs with '&&'.
Argyrios Kyrtzidis [Fri, 7 Nov 2008 14:28:18 +0000 (14:28 +0000)]
Append the test runs with '&&'.

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

16 years agoProperly deserialize ParamInfo of FunctionDecl.
Argyrios Kyrtzidis [Fri, 7 Nov 2008 14:22:23 +0000 (14:22 +0000)]
Properly deserialize ParamInfo of FunctionDecl.

When allocating an array for ParamInfo, the "decl->getNumParams()" call was used, but this will return 0 since it checks ParamInfo (which isn't yet defined and is null).
The result was that ParamInfo got an array of zero length to hold the ParmVarDecls.

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

16 years agoBring in 'alloca' for the Analysis/stack-addr-ps.c test case.
Argyrios Kyrtzidis [Fri, 7 Nov 2008 14:00:25 +0000 (14:00 +0000)]
Bring in 'alloca' for the Analysis/stack-addr-ps.c test case.

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

16 years agoAdd simple get method.
Zhongxing Xu [Fri, 7 Nov 2008 13:13:41 +0000 (13:13 +0000)]
Add simple get method.

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

16 years agoJoin two lines.
Zhongxing Xu [Fri, 7 Nov 2008 13:05:39 +0000 (13:05 +0000)]
Join two lines.

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

16 years agoFix crash caused by this:
Argyrios Kyrtzidis [Fri, 7 Nov 2008 13:01:22 +0000 (13:01 +0000)]
Fix crash caused by this:

void f() {
   int +; // crash here
}

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

16 years agoShut off an unsigned/signed comparison warning for GCC.
Argyrios Kyrtzidis [Fri, 7 Nov 2008 12:15:16 +0000 (12:15 +0000)]
Shut off an unsigned/signed comparison warning for GCC.

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

16 years agoFinish the implementation of VisitCompoundLiteralExpr. As VisitInitListExpr is
Zhongxing Xu [Fri, 7 Nov 2008 10:38:33 +0000 (10:38 +0000)]
Finish the implementation of VisitCompoundLiteralExpr. As VisitInitListExpr is
available, things get much simplified.

One addition is that CompoundLiteralExpr can appear both in rvalue and lvalue
context.

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

16 years agoMake the assertion real.
Zhongxing Xu [Fri, 7 Nov 2008 08:57:30 +0000 (08:57 +0000)]
Make the assertion real.

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

16 years agoPatch by Nikita Zhuk: Add TranslationUnitActions to AnalysisConsumer.
Ted Kremenek [Fri, 7 Nov 2008 02:09:25 +0000 (02:09 +0000)]
Patch by Nikita Zhuk: Add TranslationUnitActions to AnalysisConsumer.

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

16 years agoInitial, rudimentary implementation of operator overloading for binary
Douglas Gregor [Thu, 6 Nov 2008 23:29:22 +0000 (23:29 +0000)]
Initial, rudimentary implementation of operator overloading for binary
operators. For example, one can now write "x + y" where x or y is a
class or enumeration type, and Clang will perform overload resolution
for "+" based on the overloaded operators it finds.

The other kinds of overloadable operators in C++ will follow this same
approach.

Three major issues remain:
  1) We don't find member operators
  2) Since we don't have user-defined conversion operators, we can't
  call any of the built-in overloaded operators in C++ [over.built].
  3) Once we've done the semantic checks, we drop the overloaded
  operator on the floor; it doesn't get into the AST at all.

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

16 years agoParsing, ASTs, and semantic analysis for the declaration of overloaded
Douglas Gregor [Thu, 6 Nov 2008 22:13:31 +0000 (22:13 +0000)]
Parsing, ASTs, and semantic analysis for the declaration of overloaded
operators in C++. Overloaded operators can be called directly via
their operator-function-ids, e.g., "operator+(foo, bar)", but we don't
yet implement the semantics of operator overloading to handle, e.g.,
"foo + bar".

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

16 years agoReclaim some bits in IdentifierInfo, for later use as overloaded operator names.
Douglas Gregor [Thu, 6 Nov 2008 16:32:23 +0000 (16:32 +0000)]
Reclaim some bits in IdentifierInfo, for later use as overloaded operator names.

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

16 years agoSema-check virtual declarations. Complete dynamic_cast checking.
Sebastian Redl [Thu, 6 Nov 2008 15:59:35 +0000 (15:59 +0000)]
Sema-check virtual declarations. Complete dynamic_cast checking.

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

16 years agoAdd the remaining C++0x keywords
Douglas Gregor [Thu, 6 Nov 2008 15:17:27 +0000 (15:17 +0000)]
Add the remaining C++0x keywords

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

16 years agoUpdate VC++ proj.
Steve Naroff [Thu, 6 Nov 2008 06:24:22 +0000 (06:24 +0000)]
Update VC++ proj.

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

16 years agoBring back RegionExtent classes.
Zhongxing Xu [Thu, 6 Nov 2008 04:55:21 +0000 (04:55 +0000)]
Bring back RegionExtent classes.

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

16 years agoUpdated checker build.
Ted Kremenek [Wed, 5 Nov 2008 22:47:25 +0000 (22:47 +0000)]
Updated checker build.

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

16 years agoAdd a test case for CFMakeCollectable.
Ted Kremenek [Wed, 5 Nov 2008 22:17:39 +0000 (22:17 +0000)]
Add a test case for CFMakeCollectable.

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

16 years agoFix regression with handling of CFMakeCollectable.
Ted Kremenek [Wed, 5 Nov 2008 22:17:20 +0000 (22:17 +0000)]
Fix regression with handling of CFMakeCollectable.

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

16 years agoImprove assert messages.
Sebastian Redl [Wed, 5 Nov 2008 22:15:14 +0000 (22:15 +0000)]
Improve assert messages.

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

16 years agoMove named cast sema functions to their own file.
Sebastian Redl [Wed, 5 Nov 2008 21:50:06 +0000 (21:50 +0000)]
Move named cast sema functions to their own file.

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

16 years agoParsing, representation, and preliminary semantic analysis of destructors.
Douglas Gregor [Wed, 5 Nov 2008 20:51:48 +0000 (20:51 +0000)]
Parsing, representation, and preliminary semantic analysis of destructors.

Implicit declaration of destructors (when necessary).

Extended Declarator to store information about parsed constructors
and destructors; this will be extended to deal with declarators that
name overloaded operators (e.g., "operator +") and user-defined
conversion operators (e.g., "operator int").

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

16 years agoAnalysisManager can now be used to for analyses over TranslationUnits.
Ted Kremenek [Wed, 5 Nov 2008 19:05:06 +0000 (19:05 +0000)]
AnalysisManager can now be used to for analyses over TranslationUnits.

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

16 years agoA small error message improvement and some comment cleanup for static_cast.
Sebastian Redl [Wed, 5 Nov 2008 17:54:26 +0000 (17:54 +0000)]
A small error message improvement and some comment cleanup for static_cast.

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

16 years agoinitXXX methods can return owned objects
Ted Kremenek [Wed, 5 Nov 2008 16:54:44 +0000 (16:54 +0000)]
initXXX methods can return owned objects

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

16 years agoKeep track of whether a C++ class is an aggregate. Don't allow initialization of...
Douglas Gregor [Wed, 5 Nov 2008 16:20:31 +0000 (16:20 +0000)]
Keep track of whether a C++ class is an aggregate. Don't allow initialization of non-aggregates with initializer lists.

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

16 years agoImplement C++ copy-initialization for declarations. There is now some
Douglas Gregor [Wed, 5 Nov 2008 15:29:30 +0000 (15:29 +0000)]
Implement C++ copy-initialization for declarations. There is now some
duplication in the handling of copy-initialization by constructor,
which occurs both for initialization of a declaration and for
overloading. The initialization code is due for some refactoring.

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

16 years agoInitial implementation of parsing, semantic analysis, and AST-building
Douglas Gregor [Wed, 5 Nov 2008 04:29:56 +0000 (04:29 +0000)]
Initial implementation of parsing, semantic analysis, and AST-building
for constructor initializations, e.g.,

  class A { };
  class B : public A {
    int m;
  public:
    B() : A(), m(17) { };
  };

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

16 years agoUpdate CMakeLists.txt
Cedric Venet [Tue, 4 Nov 2008 20:31:17 +0000 (20:31 +0000)]
Update CMakeLists.txt

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

16 years agoRemove stray character.
Daniel Dunbar [Tue, 4 Nov 2008 18:44:31 +0000 (18:44 +0000)]
Remove stray character.

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

16 years agoUpdate Xcode project.
Ted Kremenek [Tue, 4 Nov 2008 18:39:58 +0000 (18:39 +0000)]
Update Xcode project.

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

16 years agoMake it an error if an Objective-C declaration is not in the global scope.
Anders Carlsson [Tue, 4 Nov 2008 16:57:32 +0000 (16:57 +0000)]
Make it an error if an Objective-C declaration is not in the global scope.

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

16 years agoLinkageSpecDecl is c++ specific, move it to DeclCXX
Chris Lattner [Tue, 4 Nov 2008 16:51:42 +0000 (16:51 +0000)]
LinkageSpecDecl is c++ specific, move it to DeclCXX

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

16 years agoSome cleanup of the cast checkers. Don't canonicalize types when not needed. Use...
Sebastian Redl [Tue, 4 Nov 2008 15:59:10 +0000 (15:59 +0000)]
Some cleanup of the cast checkers. Don't canonicalize types when not needed. Use distinct diagnostics for distinct errors.

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

16 years agoFine-grained C++ status page
Douglas Gregor [Tue, 4 Nov 2008 15:52:45 +0000 (15:52 +0000)]
Fine-grained C++ status page

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

16 years agoAdd a new expression class, ObjCSuperExpr, to handle the Objective-C 'super'. Remove...
Douglas Gregor [Tue, 4 Nov 2008 14:56:14 +0000 (14:56 +0000)]
Add a new expression class, ObjCSuperExpr, to handle the Objective-C 'super'. Remove ObjCThis from PredefinedExpr

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

16 years agoCreate a new expression class, CXXThisExpr, to handle the C++ 'this' primary expressi...
Douglas Gregor [Tue, 4 Nov 2008 14:32:21 +0000 (14:32 +0000)]
Create a new expression class, CXXThisExpr, to handle the C++ 'this' primary expression. Remove CXXThis from PredefinedExpr

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

16 years agoNow that we have copy initialization support, use it for checking the default arguments
Douglas Gregor [Tue, 4 Nov 2008 13:57:51 +0000 (13:57 +0000)]
Now that we have copy initialization support, use it for checking the default arguments

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

16 years agoDiagnose use of 'this' in a C++ default argument. Thanks to Eli for correcting my...
Douglas Gregor [Tue, 4 Nov 2008 13:41:56 +0000 (13:41 +0000)]
Diagnose use of 'this' in a C++ default argument. Thanks to Eli for correcting my bogus assertion about it already being handled

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

16 years agoTrivial style fix.
Sebastian Redl [Tue, 4 Nov 2008 11:45:54 +0000 (11:45 +0000)]
Trivial style fix.

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

16 years ago#define NULL as 0 when compiling as C++. This fixes the carbon.cpp and cocoa.mm test...
Anders Carlsson [Tue, 4 Nov 2008 06:53:14 +0000 (06:53 +0000)]
#define NULL as 0 when compiling as C++. This fixes the carbon.cpp and cocoa.mm test failures.

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

16 years agoImplement lowering of va_arg in clang directly. (This is 32-bit X86 only for now).
Anders Carlsson [Tue, 4 Nov 2008 05:30:00 +0000 (05:30 +0000)]
Implement lowering of va_arg in clang directly. (This is 32-bit X86 only for now).

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

16 years agoFix bug in va_copy
Anders Carlsson [Tue, 4 Nov 2008 05:29:05 +0000 (05:29 +0000)]
Fix bug in va_copy

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

16 years agoUpdated checker build.
Ted Kremenek [Tue, 4 Nov 2008 01:24:32 +0000 (01:24 +0000)]
Updated checker build.

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

16 years agoHandle prefix '_' that may appear in front of the name of 'Release' functions
Ted Kremenek [Tue, 4 Nov 2008 00:36:12 +0000 (00:36 +0000)]
Handle prefix '_' that may appear in front of the name of 'Release' functions

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

16 years agoFix use of uninitialized variable.
Ted Kremenek [Tue, 4 Nov 2008 00:22:12 +0000 (00:22 +0000)]
Fix use of uninitialized variable.

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

16 years agoUpdated checker build.
Ted Kremenek [Tue, 4 Nov 2008 00:03:24 +0000 (00:03 +0000)]
Updated checker build.

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

16 years agoAllow user toggling between plist and html output with scan-build/ccc-analyzer.
Ted Kremenek [Tue, 4 Nov 2008 00:02:53 +0000 (00:02 +0000)]
Allow user toggling between plist and html output with scan-build/ccc-analyzer.

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

16 years agoUpdate VC++ project file.
Steve Naroff [Tue, 4 Nov 2008 00:01:14 +0000 (00:01 +0000)]
Update VC++ project file.

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

16 years agoFix <rdar://problem/6339636> clang ObjC rewriter: Assertion failed: FileID-1 < FileID...
Steve Naroff [Mon, 3 Nov 2008 23:29:32 +0000 (23:29 +0000)]
Fix <rdar://problem/6339636> clang ObjC rewriter: Assertion failed: FileID-1 < FileIDs.size() && "Invalid FileID!", file c:\cygwin\home\Administrator\llvm\tools\clang\include\clang/Basic/SourceManager.h, line 513

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

16 years agoHook up the Plist diagnostic client to the driver.
Ted Kremenek [Mon, 3 Nov 2008 23:18:07 +0000 (23:18 +0000)]
Hook up the Plist diagnostic client to the driver.
Fix Plist output.

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

16 years agoCheck that this cannot be used in a default argument. Happily, it was already implemented
Douglas Gregor [Mon, 3 Nov 2008 22:47:57 +0000 (22:47 +0000)]
Check that this cannot be used in a default argument. Happily, it was already implemented

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

16 years agoAdd path diagnostics client for emitting path reports using Plists.
Ted Kremenek [Mon, 3 Nov 2008 22:33:57 +0000 (22:33 +0000)]
Add path diagnostics client for emitting path reports using Plists.

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

16 years agoRename 'HTMLDiagnostics.h' to 'PathDiagnosticClients.h'
Ted Kremenek [Mon, 3 Nov 2008 22:31:48 +0000 (22:31 +0000)]
Rename 'HTMLDiagnostics.h' to 'PathDiagnosticClients.h'

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

16 years agoImplicit support for direct initialization of objects of class type, e.g.,
Douglas Gregor [Mon, 3 Nov 2008 20:45:27 +0000 (20:45 +0000)]
Implicit support for direct initialization of objects of class type, e.g.,

  X x(5, 7);

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

16 years agoClarify performance experiments description based on feedback from
Daniel Dunbar [Mon, 3 Nov 2008 20:03:58 +0000 (20:03 +0000)]
Clarify performance experiments description based on feedback from
Eric C, thanks!

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

16 years agoStandard conversion sequences now have a CopyConstructor field, to
Douglas Gregor [Mon, 3 Nov 2008 19:09:14 +0000 (19:09 +0000)]
Standard conversion sequences now have a CopyConstructor field, to
cope with the case where a user-defined conversion is actually a copy
construction, and therefore can be compared against other standard
conversion sequences. While I called this a hack before, now I'm
convinced that it's the right way to go.

Compare overloads based on derived-to-base conversions that invoke
copy constructors.

Suppress user-defined conversions when attempting to call a
user-defined conversion.

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

16 years agoAdd implicitly-declared default and copy constructors to C++ classes,
Douglas Gregor [Mon, 3 Nov 2008 17:51:48 +0000 (17:51 +0000)]
Add implicitly-declared default and copy constructors to C++ classes,
when appropriate.

Conversions for class types now make use of copy constructors. I've
replaced the egregious hack allowing class-to-class conversions with a
slightly less egregious hack calling these conversions standard
conversions (for overloading reasons).

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

16 years agoEliminate header dependency ASTContext -> TargetInfo
Douglas Gregor [Mon, 3 Nov 2008 15:57:00 +0000 (15:57 +0000)]
Eliminate header dependency ASTContext -> TargetInfo

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

16 years agoImplement C++ DR 106 and C++ DR 540, both of which deal with
Douglas Gregor [Mon, 3 Nov 2008 15:51:28 +0000 (15:51 +0000)]
Implement C++ DR 106 and C++ DR 540, both of which deal with
reference-collapsing.

Implement diagnostic for formation of a reference to cv void.

Drop cv-qualifiers added to a reference type when the reference type
comes from a typedef.

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

16 years agoConnect ASTContext to TargetInfo when determining the size_t, ptrdiff_t, and wchar_t...
Douglas Gregor [Mon, 3 Nov 2008 14:12:49 +0000 (14:12 +0000)]
Connect ASTContext to TargetInfo when determining the size_t, ptrdiff_t, and wchar_t types. Fixes recent breakage on Linux.

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

16 years agoFix <rdar://problem/6336774> clang block rewriter: Assertion failed: Offset+NumBytes...
Steve Naroff [Mon, 3 Nov 2008 11:20:24 +0000 (11:20 +0000)]
Fix <rdar://problem/6336774> clang block rewriter: Assertion failed: Offset+NumBytes <= size() && "Invalid region to erase!", file c:\cygwin\home\Administrator\llvm\to ols\clang\include\clang/Rewrite/RewriteRope.h, line 219.

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

16 years agoFix PR3001: if we have an error parsing an initializer, make sure to remove
Chris Lattner [Mon, 3 Nov 2008 09:28:22 +0000 (09:28 +0000)]
Fix PR3001: if we have an error parsing an initializer, make sure to remove
the designator corresponding to it, otherwise Sema and later parsing will
get confused.

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

16 years agoprivatize some methods.
Chris Lattner [Mon, 3 Nov 2008 09:11:11 +0000 (09:11 +0000)]
privatize some methods.

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

16 years agoSimplify the functions HtmlEsape and ShellEscape. We now properly print out the...
Ted Kremenek [Mon, 3 Nov 2008 07:44:16 +0000 (07:44 +0000)]
Simplify the functions HtmlEsape and ShellEscape.  We now properly print out the following command line in the HTML output: scan-build gcc -x c /dev/null -c -Dfoo='"string abc"'

Fixes <rdar://problem/6338651>

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

16 years agoAdd some notes for SCA.
Zhongxing Xu [Mon, 3 Nov 2008 06:04:23 +0000 (06:04 +0000)]
Add some notes for SCA.

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

16 years agoFix 80-col violations.
Zhongxing Xu [Mon, 3 Nov 2008 05:18:34 +0000 (05:18 +0000)]
Fix 80-col violations.

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

16 years ago- Remove AnonTypedRegion, which is not to be used.
Zhongxing Xu [Mon, 3 Nov 2008 04:12:24 +0000 (04:12 +0000)]
- Remove AnonTypedRegion, which is not to be used.
- Prepare AnonPointeeRegioin for later use.

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

16 years agoSource ranges for named cast diagnostics.
Sebastian Redl [Sun, 2 Nov 2008 22:21:33 +0000 (22:21 +0000)]
Source ranges for named cast diagnostics.

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

16 years agoAdd header files to CMake build solution. It use globing so it doesn't need to be...
Cedric Venet [Sun, 2 Nov 2008 16:28:53 +0000 (16:28 +0000)]
Add header files to CMake build solution. It use globing so it doesn't need to be manually maintained, but it won't automatically detect a new header. I think this is a good compromise for the header files, since there presence in the solution is just an help for the user. Moreover, a new header is often introduced with a new cpp source file which need a makefile change, which will regenerate the solution and detect the new header.

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

16 years agoAdd function side-effect test cast.
Zhongxing Xu [Sun, 2 Nov 2008 13:17:44 +0000 (13:17 +0000)]
Add function side-effect test cast.

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

16 years ago1. When a pointer to struct is used as an argument, GRSimpleVals::EvalCall()
Zhongxing Xu [Sun, 2 Nov 2008 12:13:30 +0000 (12:13 +0000)]
1. When a pointer to struct is used as an argument, GRSimpleVals::EvalCall()
   sets the whole struct to Unknown. Then we cannot assume the V passed to
   BindStruct() is always a CompoundVal. When it is an UnknownVal, we call
   BindStructToVal(UnknownVal).

2. Change the signature of InitializeStructToUndefined() to BindStructToVal()
   to reuse the code.

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

16 years agoAdd defined in if().
Zhongxing Xu [Sun, 2 Nov 2008 10:58:16 +0000 (10:58 +0000)]
Add defined in if().

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

16 years agoMore fallout from r58501: primary fix is some more corrections to make
Eli Friedman [Sun, 2 Nov 2008 02:43:55 +0000 (02:43 +0000)]
More fallout from r58501: primary fix is some more corrections to make
the types for size_t and ptrdiff_t more accurate.  I think all of these
are correct, but please compare the defines for __PTRDIFF_TYPE__ and
__SIZE_TYPE__ to gcc to double-check; this particularly applies to
those on BSD variants, since I'm not sure what they do here; I assume
here that they're the same as on Linux.

Fixes wchar_t to be "int", not "unsigned int" (which I think is
correct on everything but Windows).

Fixes ptrdiff_t to be "int" rather than "short" on PIC16; "short" is an
somewhat strange choice because it normally gets promoted, and it's not
consistent with the choice for size_t.

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

16 years agoAdd 'alloca' test case for return-of-stack-address checker.
Ted Kremenek [Sun, 2 Nov 2008 00:37:31 +0000 (00:37 +0000)]
Add 'alloca' test case for return-of-stack-address checker.

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

16 years agoEnhance return-of-stack-address checker to recognize regions created by alloca().
Ted Kremenek [Sun, 2 Nov 2008 00:35:25 +0000 (00:35 +0000)]
Enhance return-of-stack-address checker to recognize regions created by alloca().

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

16 years agoAdd transfer function logic for alloca().
Ted Kremenek [Sun, 2 Nov 2008 00:35:01 +0000 (00:35 +0000)]
Add transfer function logic for alloca().

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

16 years agoAdded AllocaRegion, which represents regions created by calls to alloca().
Ted Kremenek [Sun, 2 Nov 2008 00:34:33 +0000 (00:34 +0000)]
Added AllocaRegion, which represents regions created by calls to alloca().

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

16 years agoFixed a horrible bug in HTMLDiagnostics.cpp where bugs referencing source ranges...
Ted Kremenek [Sun, 2 Nov 2008 00:33:58 +0000 (00:33 +0000)]
Fixed a horrible bug in HTMLDiagnostics.cpp where bugs referencing source ranges that occur within macros would not be emitted at all.

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

16 years agoMove IRBuilder type definition to common file.
Daniel Dunbar [Sat, 1 Nov 2008 01:53:16 +0000 (01:53 +0000)]
Move IRBuilder type definition to common file.
 - No functionality change.

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

16 years agominor tweaks.
Chris Lattner [Sat, 1 Nov 2008 01:46:51 +0000 (01:46 +0000)]
minor tweaks.

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

16 years agoGrammar tweaks.
Daniel Dunbar [Sat, 1 Nov 2008 01:24:31 +0000 (01:24 +0000)]
Grammar tweaks.

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

16 years agoAdd recent timing results to web page.
Daniel Dunbar [Sat, 1 Nov 2008 01:14:36 +0000 (01:14 +0000)]
Add recent timing results to web page.

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

16 years agoSemantic checking of constructor declarations and classification of default/copy...
Douglas Gregor [Fri, 31 Oct 2008 20:25:05 +0000 (20:25 +0000)]
Semantic checking of constructor declarations and classification of default/copy constructors

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

16 years agoImplement basic support for converting constructors in user-defined
Douglas Gregor [Fri, 31 Oct 2008 16:23:19 +0000 (16:23 +0000)]
Implement basic support for converting constructors in user-defined
conversions.

Notes:
  - Overload resolution for converting constructors need to prohibit
    user-defined conversions (hence, the test isn't -verify safe yet).
  - We still use hacks for conversions from a class type to itself.
    This will be the case until we start implicitly declaring the appropriate
    special member functions. (That's next on my list)

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

16 years agoFix a bug that was introduced in 58501. Ideally I think we should force all targets...
Anders Carlsson [Fri, 31 Oct 2008 16:05:19 +0000 (16:05 +0000)]
Fix a bug that was introduced in 58501. Ideally I think we should force all targets to set these values and not have defaults.

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

16 years agoComment out invalid assertion. I'm leaving it in the code for now as a reminder...
Ted Kremenek [Fri, 31 Oct 2008 15:33:11 +0000 (15:33 +0000)]
Comment out invalid assertion.  I'm leaving it in the code for now as a reminder to produce a test case.

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

16 years agoImplement semantic checking of static_cast and dynamic_cast.
Sebastian Redl [Fri, 31 Oct 2008 14:43:28 +0000 (14:43 +0000)]
Implement semantic checking of static_cast and dynamic_cast.

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

16 years agoSimplify interface. We can get canonical type from the base region directly. No need...
Zhongxing Xu [Fri, 31 Oct 2008 11:02:48 +0000 (11:02 +0000)]
Simplify interface. We can get canonical type from the base region directly. No need for an extra type argument.

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

16 years agoImplement struct initialization for SCA.
Zhongxing Xu [Fri, 31 Oct 2008 10:53:01 +0000 (10:53 +0000)]
Implement struct initialization for SCA.

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

16 years agoImplement array initialization for SCA.
Zhongxing Xu [Fri, 31 Oct 2008 10:24:47 +0000 (10:24 +0000)]
Implement array initialization for SCA.

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

16 years agoFixed build warning. No functionality change.
Sanjiv Gupta [Fri, 31 Oct 2008 10:24:31 +0000 (10:24 +0000)]
Fixed build warning. No functionality change.

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

16 years agoAdd test code for array initialization.
Zhongxing Xu [Fri, 31 Oct 2008 10:23:14 +0000 (10:23 +0000)]
Add test code for array initialization.

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

16 years agoMade the mechanism of defining preprocessor defs for maxint, ptrdiff_t, wchar
Sanjiv Gupta [Fri, 31 Oct 2008 09:52:39 +0000 (09:52 +0000)]
Made the mechanism of defining preprocessor defs for maxint, ptrdiff_t, wchar
etc more generic. For some targets, long may not be equal to pointer size. For
example: PIC16 has int as i16, ptr as i16 but long as i32.

Also fixed a few build warnings in assert() functions in CFRefCount.cpp,
CGDecl.cpp, SemaDeclCXX.cpp and ParseDeclCXX.cpp.

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

16 years agoTurn off module verification in Release-Asserts builds.
Daniel Dunbar [Fri, 31 Oct 2008 09:34:21 +0000 (09:34 +0000)]
Turn off module verification in Release-Asserts builds.

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

16 years agoAdd support for parsing and representing C++ constructor declarations.
Douglas Gregor [Fri, 31 Oct 2008 09:07:45 +0000 (09:07 +0000)]
Add support for parsing and representing C++ constructor declarations.

Notes:
  - Constructors are never found by name lookup, so they'll never get
    pushed into any scope. Instead, they are stored as an
    OverloadedFunctionDecl in CXXRecordDecl for easy overloading.
  - There's a new action isCurrentClassName that determines whether an
    identifier is the name of the innermost class currently being defined;
    we use this to identify the declarator-id grammar rule that refers to
    a type-name.
  - MinimalAction does *not* support parsing constructors.
  - We now handle virtual and explicit function specifiers.

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