Commit Graph

7175 Commits

Author SHA1 Message Date
Ted Kremenek
0cbd963817 Add path diagnostics client for emitting path reports using Plists.
llvm-svn: 58647
2008-11-03 22:33:57 +00:00
Ted Kremenek
e868c00d5a Rename 'HTMLDiagnostics.h' to 'PathDiagnosticClients.h'
llvm-svn: 58646
2008-11-03 22:31:48 +00:00
Douglas Gregor
c28b57d703 Implicit support for direct initialization of objects of class type, e.g.,
X x(5, 7);

llvm-svn: 58641
2008-11-03 20:45:27 +00:00
Daniel Dunbar
925dc26d51 Clarify performance experiments description based on feedback from
Eric C, thanks!

llvm-svn: 58634
2008-11-03 20:03:58 +00:00
Douglas Gregor
2fe9883a96 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.

llvm-svn: 58629
2008-11-03 19:09:14 +00:00
Douglas Gregor
0537942f3c 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).

llvm-svn: 58622
2008-11-03 17:51:48 +00:00
Douglas Gregor
ab13857072 Eliminate header dependency ASTContext -> TargetInfo
llvm-svn: 58613
2008-11-03 15:57:00 +00:00
Douglas Gregor
66583c5ff3 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.

llvm-svn: 58612
2008-11-03 15:51:28 +00:00
Douglas Gregor
8af6e6d415 Connect ASTContext to TargetInfo when determining the size_t, ptrdiff_t, and wchar_t types. Fixes recent breakage on Linux.
llvm-svn: 58609
2008-11-03 14:12:49 +00:00
Steve Naroff
3e7ced125b 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.
llvm-svn: 58607
2008-11-03 11:20:24 +00:00
Chris Lattner
8cc7be369c 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.

llvm-svn: 58603
2008-11-03 09:28:22 +00:00
Chris Lattner
7d7fff2303 privatize some methods.
llvm-svn: 58602
2008-11-03 09:11:11 +00:00
Ted Kremenek
3a5d515a82 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>

llvm-svn: 58600
2008-11-03 07:44:16 +00:00
Zhongxing Xu
c8c71979a6 Add some notes for SCA.
llvm-svn: 58597
2008-11-03 06:04:23 +00:00
Zhongxing Xu
8ea09cc542 Fix 80-col violations.
llvm-svn: 58596
2008-11-03 05:18:34 +00:00
Zhongxing Xu
2d330ef8fa - Remove AnonTypedRegion, which is not to be used.
- Prepare AnonPointeeRegioin for later use.

llvm-svn: 58595
2008-11-03 04:12:24 +00:00
Sebastian Redl
1384553cbe Source ranges for named cast diagnostics.
llvm-svn: 58570
2008-11-02 22:21:33 +00:00
Cedric Venet
1bb549685b 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.
llvm-svn: 58566
2008-11-02 16:28:53 +00:00
Zhongxing Xu
de297f8198 Add function side-effect test cast.
llvm-svn: 58565
2008-11-02 13:17:44 +00:00
Zhongxing Xu
2e8e604704 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.

llvm-svn: 58564
2008-11-02 12:13:30 +00:00
Zhongxing Xu
72cf861fba Add defined in if().
llvm-svn: 58562
2008-11-02 10:58:16 +00:00
Eli Friedman
d50881c6a9 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.

llvm-svn: 58556
2008-11-02 02:43:55 +00:00
Ted Kremenek
f3d9f805c7 Add 'alloca' test case for return-of-stack-address checker.
llvm-svn: 58554
2008-11-02 00:37:31 +00:00
Ted Kremenek
b9b794d60b Enhance return-of-stack-address checker to recognize regions created by alloca().
llvm-svn: 58553
2008-11-02 00:35:25 +00:00
Ted Kremenek
9bf363979d Add transfer function logic for alloca().
llvm-svn: 58552
2008-11-02 00:35:01 +00:00
Ted Kremenek
16783cfc31 Added AllocaRegion, which represents regions created by calls to alloca().
llvm-svn: 58551
2008-11-02 00:34:33 +00:00
Ted Kremenek
29925c8ea2 Fixed a horrible bug in HTMLDiagnostics.cpp where bugs referencing source ranges that occur within macros would not be emitted at all.
llvm-svn: 58550
2008-11-02 00:33:58 +00:00
Daniel Dunbar
cb4638599c Move IRBuilder type definition to common file.
- No functionality change.

llvm-svn: 58546
2008-11-01 01:53:16 +00:00
Chris Lattner
ce149def9d minor tweaks.
llvm-svn: 58545
2008-11-01 01:46:51 +00:00
Daniel Dunbar
05f13bcc2c Grammar tweaks.
llvm-svn: 58544
2008-11-01 01:24:31 +00:00
Daniel Dunbar
13569f8dd6 Add recent timing results to web page.
llvm-svn: 58542
2008-11-01 01:14:36 +00:00
Douglas Gregor
eebb5c10aa Semantic checking of constructor declarations and classification of default/copy constructors
llvm-svn: 58538
2008-10-31 20:25:05 +00:00
Douglas Gregor
26bee0b326 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)

llvm-svn: 58513
2008-10-31 16:23:19 +00:00
Anders Carlsson
2a79a90430 Fix a bug that was introduced in 58501. Ideally I think we should force all targets to set these values and not have defaults.
llvm-svn: 58511
2008-10-31 16:05:19 +00:00
Ted Kremenek
59ae7c0fd5 Comment out invalid assertion. I'm leaving it in the code for now as a reminder to produce a test case.
llvm-svn: 58510
2008-10-31 15:33:11 +00:00
Sebastian Redl
72b8aef613 Implement semantic checking of static_cast and dynamic_cast.
llvm-svn: 58509
2008-10-31 14:43:28 +00:00
Zhongxing Xu
73f006e800 Simplify interface. We can get canonical type from the base region directly. No need for an extra type argument.
llvm-svn: 58507
2008-10-31 11:02:48 +00:00
Zhongxing Xu
b393b5080c Implement struct initialization for SCA.
llvm-svn: 58506
2008-10-31 10:53:01 +00:00
Zhongxing Xu
98bb1fa69e Implement array initialization for SCA.
llvm-svn: 58504
2008-10-31 10:24:47 +00:00
Sanjiv Gupta
83b95cc60c Fixed build warning. No functionality change.
llvm-svn: 58503
2008-10-31 10:24:31 +00:00
Zhongxing Xu
87bfa4340c Add test code for array initialization.
llvm-svn: 58502
2008-10-31 10:23:14 +00:00
Sanjiv Gupta
d79592448b 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.

llvm-svn: 58501
2008-10-31 09:52:39 +00:00
Daniel Dunbar
ada702ef45 Turn off module verification in Release-Asserts builds.
llvm-svn: 58500
2008-10-31 09:34:21 +00:00
Douglas Gregor
61956c460a 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.

llvm-svn: 58499
2008-10-31 09:07:45 +00:00
Daniel Dunbar
f8362f9e5d "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.

llvm-svn: 58498
2008-10-31 08:56:51 +00:00
Daniel Dunbar
0c248e7ed8 Debug info: Bug fix, function types should always include the return
type.

llvm-svn: 58497
2008-10-31 08:12:03 +00:00
Zhongxing Xu
ce71638c0d Implement BindStruct and fix a bug in RetriveStruct.
llvm-svn: 58496
2008-10-31 08:10:01 +00:00
Zhongxing Xu
4de1c851d3 Fix 80-col violations.
llvm-svn: 58495
2008-10-31 07:26:14 +00:00
Zhongxing Xu
6c0d588942 Implement load from struct region. Instead of returning an UnknownVal(), we create a CompoundVal by loading from each field of the struct.
llvm-svn: 58494
2008-10-31 07:16:08 +00:00
Zhongxing Xu
5e23c5bf49 Make CompoundLiteralRegion a subclass of TypedRegiion.
llvm-svn: 58493
2008-10-31 06:30:35 +00:00