]> granicus.if.org Git - clang/log
clang
15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 years ago"One" line fix for -parse-noop failure, "id" and several other things
Daniel Dunbar [Fri, 31 Oct 2008 08:56:51 +0000 (08:56 +0000)]
"One" line fix for -parse-noop failure, "id" and several other things
were being treated as type names for non-Objective-C files.
 - Other lines are just because MinimalAction didn't have access to
   the LangOptions.

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

15 years agoDebug info: Bug fix, function types should always include the return
Daniel Dunbar [Fri, 31 Oct 2008 08:12:03 +0000 (08:12 +0000)]
Debug info: Bug fix, function types should always include the return
type.

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

15 years agoImplement BindStruct and fix a bug in RetriveStruct.
Zhongxing Xu [Fri, 31 Oct 2008 08:10:01 +0000 (08:10 +0000)]
Implement BindStruct and fix a bug in RetriveStruct.

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

15 years agoFix 80-col violations.
Zhongxing Xu [Fri, 31 Oct 2008 07:26:14 +0000 (07:26 +0000)]
Fix 80-col violations.

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

15 years agoImplement load from struct region. Instead of returning an UnknownVal(), we create...
Zhongxing Xu [Fri, 31 Oct 2008 07:16:08 +0000 (07:16 +0000)]
Implement load from struct region. Instead of returning an UnknownVal(), we create a CompoundVal by loading from each field of the struct.

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

15 years agoMake CompoundLiteralRegion a subclass of TypedRegiion.
Zhongxing Xu [Fri, 31 Oct 2008 06:30:35 +0000 (06:30 +0000)]
Make CompoundLiteralRegion a subclass of TypedRegiion.

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

15 years agoAdd a tentative assertion.
Zhongxing Xu [Fri, 31 Oct 2008 06:05:32 +0000 (06:05 +0000)]
Add a tentative assertion.

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

15 years agoOn Mac OS X, use TMPDIR as the default location to place analysis results. This...
Ted Kremenek [Fri, 31 Oct 2008 05:48:42 +0000 (05:48 +0000)]
On Mac OS X, use TMPDIR as the default location to place analysis results.  This is a more secure location for such files, and addresses <rdar://problem/6334220>.

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

15 years agoQuick fix for PR2950, infinite loop generating debug info for
Daniel Dunbar [Fri, 31 Oct 2008 04:04:54 +0000 (04:04 +0000)]
Quick fix for PR2950, infinite loop generating debug info for
recursive types.
 - Style will be clean up in further patches.

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

15 years agoFormatting tweaks.
Daniel Dunbar [Fri, 31 Oct 2008 03:54:29 +0000 (03:54 +0000)]
Formatting tweaks.
 - No functionality change.

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

15 years agoFix a comment.
Zhongxing Xu [Fri, 31 Oct 2008 03:01:26 +0000 (03:01 +0000)]
Fix a comment.

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

15 years agoAdded missing 'expected-warning'
Ted Kremenek [Fri, 31 Oct 2008 00:20:13 +0000 (00:20 +0000)]
Added missing 'expected-warning'

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

15 years agoEnhance compound literal test case.
Ted Kremenek [Fri, 31 Oct 2008 00:19:42 +0000 (00:19 +0000)]
Enhance compound literal test case.

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

15 years agoUse llvm::raw_string_ostream instead of std::ostringstream.
Ted Kremenek [Fri, 31 Oct 2008 00:18:30 +0000 (00:18 +0000)]
Use llvm::raw_string_ostream instead of std::ostringstream.

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

15 years agoEnhance path-sensitive return-of-stack-address check to print out the line number...
Ted Kremenek [Fri, 31 Oct 2008 00:13:20 +0000 (00:13 +0000)]
Enhance path-sensitive return-of-stack-address check to print out the line number of a compound literal (whose address is being returned) instead of printing out the hex representation of the pointer address of the CompoundLiteralExpr.

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

15 years agoAdd accessor method to CompoundLiteralRegion to retrieve the CompoundLiteralExpr.
Ted Kremenek [Fri, 31 Oct 2008 00:04:54 +0000 (00:04 +0000)]
Add accessor method to CompoundLiteralRegion to retrieve the CompoundLiteralExpr.

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

15 years agoUpdated checker build.
Ted Kremenek [Thu, 30 Oct 2008 23:41:37 +0000 (23:41 +0000)]
Updated checker build.

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

15 years agoAdd missing "expected warning".
Ted Kremenek [Thu, 30 Oct 2008 23:17:05 +0000 (23:17 +0000)]
Add missing "expected warning".
Add compound literal with empty initializer (just to test the analyzer handles it).

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

15 years agoExtend "followsFundamentalRule" to ignore prefix '_' characters.
Ted Kremenek [Thu, 30 Oct 2008 23:14:58 +0000 (23:14 +0000)]
Extend "followsFundamentalRule" to ignore prefix '_' characters.

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

15 years agoHandle the case in VisitInitListExprs where there are no initializers in the compound...
Ted Kremenek [Thu, 30 Oct 2008 23:14:36 +0000 (23:14 +0000)]
Handle the case in VisitInitListExprs where there are no initializers in the compound literal.

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

15 years agoAdd method that will be invoked using the dot-syntax just to test that the missing...
Ted Kremenek [Thu, 30 Oct 2008 23:00:13 +0000 (23:00 +0000)]
Add method that will be invoked using the dot-syntax just to test that the missing -dealloc checker handles it.

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

15 years agoDistinguish between self.X = ... where self.X is a property reference and self.X...
Ted Kremenek [Thu, 30 Oct 2008 22:28:48 +0000 (22:28 +0000)]
Distinguish between self.X = ... where self.X is a property reference and self.X is an implicit call to setX.

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

15 years agoImprove compound literal test case.
Ted Kremenek [Thu, 30 Oct 2008 18:46:50 +0000 (18:46 +0000)]
Improve compound literal test case.

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

15 years agoUse the correct predecessor node.
Ted Kremenek [Thu, 30 Oct 2008 18:37:08 +0000 (18:37 +0000)]
Use the correct predecessor node.

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

15 years agoPretty-printing for SVals now mainly uses llvm::raw_ostream. We have an adapter...
Ted Kremenek [Thu, 30 Oct 2008 18:35:10 +0000 (18:35 +0000)]
Pretty-printing for SVals now mainly uses llvm::raw_ostream.  We have an adapter for std::ostream, but this will be removed in the future.

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

15 years agoAdd missing return statement.
Ted Kremenek [Thu, 30 Oct 2008 18:34:31 +0000 (18:34 +0000)]
Add missing return statement.

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

15 years agoAdded iterators to nonloc::CompoundSVal.
Ted Kremenek [Thu, 30 Oct 2008 18:01:28 +0000 (18:01 +0000)]
Added iterators to nonloc::CompoundSVal.
Added pretty-printing for nonloc::CompoundSVal.

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

15 years ago80 col violation.
Ted Kremenek [Thu, 30 Oct 2008 17:53:23 +0000 (17:53 +0000)]
80 col violation.

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

15 years agoUse a worklist in GRExprEngine::VisitInitListExpr to process subexpressions.
Ted Kremenek [Thu, 30 Oct 2008 17:47:32 +0000 (17:47 +0000)]
Use a worklist in GRExprEngine::VisitInitListExpr to process subexpressions.

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

15 years agoUpdate #includes since SVals.h no longer includes BasicValueFactory.h.
Ted Kremenek [Thu, 30 Oct 2008 17:46:51 +0000 (17:46 +0000)]
Update #includes since SVals.h no longer includes BasicValueFactory.h.

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

15 years agoAdd iterator/reverse_iterator to InitListExpr for iteration over the subexpressions...
Ted Kremenek [Thu, 30 Oct 2008 17:45:53 +0000 (17:45 +0000)]
Add iterator/reverse_iterator to InitListExpr for iteration over the subexpressions of an initializer list.  This is basically the same as child_iterator except reverse iteration is possible (which will be used by GRExprEngine::VisitInitListExpr).

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

15 years agoCompoundVal now uses an ImmutableList<SVal> to store its set of SVals. This change...
Ted Kremenek [Thu, 30 Oct 2008 17:44:46 +0000 (17:44 +0000)]
CompoundVal now uses an ImmutableList<SVal> to store its set of SVals.  This change was motivated by the need to allow state-splitting in GRExprEngine::VisitInitListExpr.  As a side-benefit, we no longer need to perform any copies of SVals when creating a CompoundSVal, and the profiling of CompoundSVal is now constant time.

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

15 years ago"missing ivar release" is a performance bug.
Ted Kremenek [Thu, 30 Oct 2008 17:29:54 +0000 (17:29 +0000)]
"missing ivar release" is a performance bug.

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

15 years agoPatch by Nikita Zhuk: test case for fix for false positive reported in PR2978.
Ted Kremenek [Thu, 30 Oct 2008 15:19:43 +0000 (15:19 +0000)]
Patch by Nikita Zhuk: test case for fix for false positive reported in PR2978.

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

15 years agoPatch by Nikita Zhuk:
Ted Kremenek [Thu, 30 Oct 2008 15:13:43 +0000 (15:13 +0000)]
Patch by Nikita Zhuk:

Fix PR 2978 false positive for missing release in -dealloc of an ivar retained via a property and then released by assigning nil to that property:

  http://llvm.org/bugs/show_bug.cgi?id=2978

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

15 years agoMake sure RewriteObjCMethodDecl() does a block pointer rewrite.
Steve Naroff [Thu, 30 Oct 2008 14:45:29 +0000 (14:45 +0000)]
Make sure RewriteObjCMethodDecl() does a block pointer rewrite.

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

15 years agoFix arithmetic type check
Douglas Gregor [Thu, 30 Oct 2008 13:47:07 +0000 (13:47 +0000)]
Fix arithmetic type check

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

15 years agoAdd a couple fixes for rewriting ivars/methods that use/contain blocks.
Steve Naroff [Thu, 30 Oct 2008 12:09:33 +0000 (12:09 +0000)]
Add a couple fixes for rewriting ivars/methods that use/contain blocks.

Now this:

@interface Test
{
  void (^ivar)(void);
}
- (void)name;
@end

@implementation Test
- (void)name {
  ivar = ^{ printf("hello\n"); }; // ((struct Test_IMPL *)self)->ivar = (void (*)(void))&__name_block_impl_0((void *)__name_block_func_0);
  ivar(); // ((void (*)(struct __block_impl *))((struct __block_impl *)((struct Test_IMPL *)self)->ivar)->FuncPtr)((struct __block_impl *)((struct Test_IMPL *)self)->ivar);
}

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

15 years agoConvert SynthesizeBlockCall() from test->AST based implementation.
Steve Naroff [Thu, 30 Oct 2008 10:07:53 +0000 (10:07 +0000)]
Convert SynthesizeBlockCall() from test->AST based implementation.

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

15 years agoMerge the array and struct case. They are essentially the same.
Zhongxing Xu [Thu, 30 Oct 2008 05:35:59 +0000 (05:35 +0000)]
Merge the array and struct case. They are essentially the same.

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

15 years agoRename:
Zhongxing Xu [Thu, 30 Oct 2008 05:33:54 +0000 (05:33 +0000)]
Rename:
 - SetSVal(GRState*, Loc, SVal) => BindLoc
 - SetSVal(GRState*, Expr*, SVal) => BindExpr

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