Commit Graph

6520 Commits

Author SHA1 Message Date
Steve Naroff 92559af851 RewriteBlocks::RewriteBlockPointerDecl(): Handle TypedefDecl's and VarDecl's uniformly.
llvm-svn: 56500
2008-09-23 21:15:53 +00:00
Steve Naroff 87930ca38f Teach block rewriter to replace '^' with '*' in VarDecls.
Since we don't have DeclGroup's and location information for types, there is some fancy footwork to do this fairly reliably.

O.K...it's a kludge. One day, we can use this as motivation to do this more gracefully:-)

llvm-svn: 56499
2008-09-23 19:24:41 +00:00
Ted Kremenek 81ec48a1d5 Added test case.
llvm-svn: 56493
2008-09-23 18:05:01 +00:00
Ted Kremenek 577acbf5c2 Fix PR 2819: Compute dataflow values for all CFG blocks by not relying on having the "Exit" block being reachable by all (or any) of the blocks in the CFG.
llvm-svn: 56492
2008-09-23 18:02:10 +00:00
Daniel Dunbar d0921de8b0 Add x86_64 Linux target.
- PR2824

llvm-svn: 56491
2008-09-23 17:37:57 +00:00
Ted Kremenek 90b91de03b Updated checker build.
llvm-svn: 56484
2008-09-23 00:30:34 +00:00
Daniel Dunbar c6fdac260b Bug fix, result of isIntegerConstantExpr could be of incorrect width
for type.
  - PR2817

llvm-svn: 56482
2008-09-22 23:53:24 +00:00
Daniel Dunbar fd462af19e scan-view: Add header and "report bug" links to report pages.
llvm-svn: 56470
2008-09-22 21:43:43 +00:00
Daniel Dunbar d3b096bd5a scan-view: Add links to open files using default file handler.
llvm-svn: 56454
2008-09-22 18:44:46 +00:00
Ted Kremenek 0ed9c35b0e Yank out special CSS for button rendering (not very portable or well tested, and we were encountering race conditions with CSS loading).
llvm-svn: 56449
2008-09-22 18:14:23 +00:00
Daniel Dunbar 6c9bf7d92a scan-view: Update for "button" class change, drop magic resolution of
"scanview.css", start action for opening files.

llvm-svn: 56448
2008-09-22 18:05:49 +00:00
Ted Kremenek 9b5ba60ff3 Reintegrate Daniel's changes.
llvm-svn: 56447
2008-09-22 18:05:05 +00:00
Ted Kremenek 2c4a8f414b Removed scan-view's version of scanview.css.
llvm-svn: 56446
2008-09-22 17:55:14 +00:00
Ted Kremenek 85ea56ea84 Add "SUMMARYENDHEAD" tag.
llvm-svn: 56445
2008-09-22 17:52:58 +00:00
Ted Kremenek 620ca3d3c9 Don't embed CSS inside scan-build script; use external scanview.css.
llvm-svn: 56444
2008-09-22 17:50:47 +00:00
Ted Kremenek 8775b12c36 Don't emit link to source file.
llvm-svn: 56443
2008-09-22 17:42:31 +00:00
Ted Kremenek 2a56b23c3a Make "View Report" just a normal link again.
llvm-svn: 56442
2008-09-22 17:39:18 +00:00
Ted Kremenek a026fd3c01 Don't print out the path length.
llvm-svn: 56441
2008-09-22 17:38:23 +00:00
Ted Kremenek b76a3f44ec Output "REPORTHEADER" and "REPORTSUMMARYEXTRA" tags for use with scan-view.
llvm-svn: 56440
2008-09-22 17:33:32 +00:00
Nuno Lopes 47e46ed3da not executable
llvm-svn: 56439
2008-09-22 17:26:14 +00:00
Steve Naroff 25709eca44 Remove unused slot/reference and update Sema::ActOnIdentifierExpr().
llvm-svn: 56438
2008-09-22 15:31:56 +00:00
Steve Naroff cd5e782bce Fix http://llvm.org/bugs/show_bug.cgi?id=2816.
llvm-svn: 56433
2008-09-22 10:28:57 +00:00
Ted Kremenek a3fe93b688 Use scan-view to view reports. Opening index.html is deprecated.
llvm-svn: 56431
2008-09-22 06:47:01 +00:00
Ted Kremenek dd186c638e Updated checker build
llvm-svn: 56430
2008-09-22 06:11:08 +00:00
Daniel Dunbar ed4e3210da scan-view: Add links from bug reporting forms to report & summary pages.
llvm-svn: 56427
2008-09-22 03:08:32 +00:00
Daniel Dunbar 2ef3142b92 scan-view: Search for available port if default is unavailable.
llvm-svn: 56426
2008-09-22 02:53:12 +00:00
Daniel Dunbar 34525a91fa scan-view: Store bug reporter defaults in ~/.scanview.cfg
llvm-svn: 56424
2008-09-22 02:27:45 +00:00
Daniel Dunbar 4aed7dede7 scan-view tweak
- Require index.html in provided results directory.

llvm-svn: 56423
2008-09-22 01:42:08 +00:00
Daniel Dunbar 8d139d3d40 scan-view tweaks
- Use more correct HTTP error codes on (unexpected) errors.

 - Use onLoad to set ensure bug submission method gets set correctly.

llvm-svn: 56422
2008-09-22 01:40:14 +00:00
Ted Kremenek d01c408b71 Patch from Richard Godbee:
Improve scan-build results to include the user's host name, the working
directory of the analyzed project, and the date the analysis run took place.

llvm-svn: 56421
2008-09-22 01:35:58 +00:00
Daniel Dunbar 553fdc6bc7 Improve scan-view report bug (submitted) interface.
Give more meaningful error messages / fail gracefully on bad form
input or SMTP errors.

Use button for Report Bug link (where available).

llvm-svn: 56420
2008-09-22 01:21:30 +00:00
Daniel Dunbar 49351e7eb9 Improve scan-view report bug interface.
- Pulled css out into Resources/scanview.css

llvm-svn: 56416
2008-09-22 00:11:51 +00:00
Daniel Dunbar 19af4ea47b scan-view tweaks:
- Add simple favicon
 - Allow resolving source file paths (should be rethought)

llvm-svn: 56414
2008-09-21 23:02:25 +00:00
Daniel Dunbar daa26f879e scan-view tweaks:
- Update for scan-build table change.
 - Add --auto-reload option (for development, avoids need to restart
   server).
 - Always send Last-Modified, with a reasonable value for dynamic content.

llvm-svn: 56409
2008-09-21 20:34:58 +00:00
Ted Kremenek 0b7ae724a7 Add webkit styles using Javascript (detect for AppleWebKit)
llvm-svn: 56408
2008-09-21 20:10:46 +00:00
Ted Kremenek 23432d4c7b Unbreak using abs_path.
llvm-svn: 56407
2008-09-21 19:56:14 +00:00
Daniel Dunbar b9c42108d9 scan-view: Add more information to default bug description and use
iframe to embed bug view (for easy reference).

llvm-svn: 56406
2008-09-21 19:08:54 +00:00
Ted Kremenek 76f79ba890 Change casing of bug type.
llvm-svn: 56405
2008-09-21 19:08:31 +00:00
Daniel Dunbar a00b7a8240 Don't add Bugzilla reporter (not yet implemented)
llvm-svn: 56404
2008-09-21 19:06:51 +00:00
Ted Kremenek 638e280c32 The checks in BasicObjCFoundationChecks now have a category: "API Misuse (Apple)"
llvm-svn: 56403
2008-09-21 19:01:39 +00:00
Ted Kremenek ba9781dcfc The "unused ivar" check now has a category: "Optimization"
llvm-svn: 56402
2008-09-21 18:58:22 +00:00
Ted Kremenek 1b6997ed5e Built-in checks now have a category: "Logic Errors"
llvm-svn: 56401
2008-09-21 18:57:28 +00:00
Ted Kremenek 80b2b16540 Added experimental "intelligent-sizing" of HTML message bubbles based on the contents of the message.
llvm-svn: 56400
2008-09-21 18:52:59 +00:00
Ted Kremenek 9eca6af2f2 Remove debugging message.
llvm-svn: 56398
2008-09-21 18:26:58 +00:00
Ted Kremenek ca8ac081af Unbreak ccc-analyzer: getcwd is from package Cwd
llvm-svn: 56397
2008-09-21 18:26:19 +00:00
Ted Kremenek 32c1181468 Patch by Richard Godbee:
Output to .info files the absolute paths to files that were rejected by the
parser or crashed the analyzer.

llvm-svn: 56396
2008-09-21 18:04:49 +00:00
Ted Kremenek 172f04dfe6 scan-build now prints out bug categories.
llvm-svn: 56395
2008-09-21 06:58:09 +00:00
Ted Kremenek 33663885c3 Add a bug category for NSError** checks.
llvm-svn: 56394
2008-09-21 06:57:40 +00:00
Ted Kremenek ebb4245b84 Have ScanView.py generate a "<td></td>" pair in the output HTML instead of having scan-build output an empty (and possibly unused) <td>.
llvm-svn: 56393
2008-09-21 03:55:51 +00:00
Cedric Venet b074a21b08 Update VS projects.
llvm-svn: 56390
2008-09-20 18:03:16 +00:00
Ted Kremenek de195e2100 Add "category" to BugTypes, allowing bugs to be grouped.
Changed casing of many bug names.  The convention will be to have bug names (mostly) lower cased, and categories use some capitalization.

llvm-svn: 56385
2008-09-20 04:23:38 +00:00
Ted Kremenek bc15d8539d Add PostStore, a new ProgramPoint to distinguish between 'stores' and other PostStmts.
GRExprEngine:
  Use PostStore in EvalStore.
  Use a second version of EvalStore in EvalBinaryOperator to associate the store with the expression on the LHS.

llvm-svn: 56383
2008-09-20 01:50:34 +00:00
Daniel Dunbar 025b48dd6e Make scan-view more robust / friendly when bug reporting fails.
llvm-svn: 56382
2008-09-20 01:43:16 +00:00
Daniel Dunbar d4c2337ef5 Add initial implementation of scan-view
- Web based interface to static analyzer.

llvm-svn: 56375
2008-09-19 23:32:11 +00:00
Daniel Dunbar 669632bf9a Add REPORTBUG marker to scan-build.
llvm-svn: 56373
2008-09-19 23:18:44 +00:00
Ted Kremenek 8cdc71859c Test case for transfer function logic of const casts.
llvm-svn: 56369
2008-09-19 20:53:52 +00:00
Ted Kremenek 31a15f8ba2 Bug fix: for the base transfer function logic for casts, handle const casts as just propagating the value.
llvm-svn: 56368
2008-09-19 20:51:22 +00:00
Ted Kremenek 37202acdff Update checker build
llvm-svn: 56367
2008-09-19 20:20:09 +00:00
Ted Kremenek 34bfd8a490 Fixed logic error in BasicConstraintManager pointed out by Zhongxing Xu.
For checking if a symbol >= value, we need to check if symbol == value || symbol
> value. When checking symbol > value and we know that symbol != value, the path
is infeasible only if value == maximum integer.

For checking if a symbol <= value, we need to check if symbol == value || symbol
< value. When checking symbol < value and we know that symbol != value, the path
is infeasible only if value == minimum integer.

Updated test case exercising this logic: we only prune paths if the values are
unsigned.

llvm-svn: 56354
2008-09-19 18:00:36 +00:00
Chris Lattner a7b034463e Fix rdar://6222856: the receiver of a message expr is an
arbitrary expr, not just a assign expr.  The grammar comment
was right, the code was just wrong.

llvm-svn: 56353
2008-09-19 17:44:00 +00:00
Ted Kremenek a5bf9cb4be When we have a binary expression 'int operator symbol', properly rewrite this as
'symbol operator-reverse int'. This patch is a combination of code from
Zhongxing Xu and myself (Zhongxing noticed this bug for the cases of
relational operators).

llvm-svn: 56351
2008-09-19 17:31:13 +00:00
Zhongxing Xu a8e88ecda6 Add an omitted case for AssumeSymInt.
llvm-svn: 56334
2008-09-19 06:07:59 +00:00
Ted Kremenek 9a7e2efec0 Updated checker build.
llvm-svn: 56333
2008-09-19 05:14:13 +00:00
Ted Kremenek 55bec4d511 Added test case for PR 2600: proper use of NSError**
llvm-svn: 56332
2008-09-19 04:56:32 +00:00
Ted Kremenek a417c0e80a Add panic function "__assert_fail".
llvm-svn: 56327
2008-09-19 02:30:47 +00:00
Ted Kremenek 6a1a334b6c Register the implicit null-dereferenced object as a notable symbol.
llvm-svn: 56319
2008-09-18 23:23:19 +00:00
Ted Kremenek b42f482c91 Implement second part of PR 2600: NSError** parameter may be null, and should be checked before being dereferenced.
llvm-svn: 56318
2008-09-18 23:09:54 +00:00
Ted Kremenek c38b3fbc4c Update Xcode project.
llvm-svn: 56317
2008-09-18 23:08:24 +00:00
Ted Kremenek 6633871cb3 Analysis option -warn-objc-nserror-methods is no longer available. (check is done automatically with -checker-cfref)
llvm-svn: 56313
2008-09-18 21:25:58 +00:00
Ted Kremenek f0673e4eb6 Change implementation of NSError** coding-style check to be invoked at the end of the retain/release analysis.
llvm-svn: 56312
2008-09-18 21:25:13 +00:00
Steve Naroff 3405a73ab8 Finish pushing blocks attribute through the clang attribute machinery.
Also added a couple simple tests from the "gcc.apple" test suite.

llvm-svn: 56309
2008-09-18 16:44:58 +00:00
Steve Naroff 9779e92fa4 Add driver support for invoking block rewriter.
Also tweaked the create function to take an explicit output file.

llvm-svn: 56305
2008-09-18 14:10:13 +00:00
Ted Kremenek be061e2a19 Enable '-warn-objc-nserror-methods' by default.
llvm-svn: 56298
2008-09-18 06:34:16 +00:00
Ted Kremenek fc3abeb1e5 Implemented one of the checks requested in PR 2600:
"Method accepting NSError** argument should have non-void return value to indicate that an error occurred."

Test case written, but the header needs to be delta-debugged reduced.  Will commit shortly.

llvm-svn: 56297
2008-09-18 06:33:41 +00:00
Ted Kremenek 137fc0ea01 Added CFNumberCreate test case to illustrate a 32-bit/64-bit arch issue.
llvm-svn: 56295
2008-09-18 00:28:23 +00:00
Ted Kremenek 24bef31597 Add path-sensitivity test case.
llvm-svn: 56294
2008-09-17 22:24:13 +00:00
Daniel Dunbar 86d97c7985 Improve x86 ABI compatibility.
- Enables use of ABIArgInfo::Expand when needed. This greatly
   improves our x86 ABI compatibility.

 - As the infrastructure for target specific ABI handling isn't built
   yet, this change means ABI compatibility on other platforms is once
   again broken in a different way than before.

 - Upcoming: Figure out how to refactor ABI handling into
   targets. More documentation.

llvm-svn: 56293
2008-09-17 21:22:33 +00:00
Daniel Dunbar d9d1f5f522 Print current function on verification failures.
llvm-svn: 56291
2008-09-17 21:13:22 +00:00
Daniel Dunbar d34d6dc458 Drop CodeGenTypes parameter to classifyArgumentType.
Ensure that ABIArgInfo::Default implementation for aggregrate types
is sensible (StructRet on return and ByVal on arguments).

No functionality change.

llvm-svn: 56289
2008-09-17 20:11:04 +00:00
Steve Naroff 43bafa78b3 Remove BlockStmtExpr.
Block literals are now represented by the concrete BlockExpr class.
This is cleanup (removes a FIXME).
No functionality change.

llvm-svn: 56288
2008-09-17 18:37:59 +00:00
Daniel Dunbar 6ff95305e6 Another attempt to make test/Makefile return correct error code.
llvm-svn: 56285
2008-09-17 18:08:07 +00:00
Steve Naroff a5629376e8 Fix http://llvm.org/bugs/show_bug.cgi?id=2760.
llvm-svn: 56280
2008-09-17 14:05:40 +00:00
Ted Kremenek 45a928b956 Updated checker build.
llvm-svn: 56274
2008-09-17 04:22:09 +00:00
Zhongxing Xu 7b7394c8ec Fix comment typo.
llvm-svn: 56271
2008-09-17 02:35:50 +00:00
Daniel Dunbar 8fc81b02e2 Add support for ABIArgInfo::Expand
- No functionality change.

llvm-svn: 56269
2008-09-17 00:51:38 +00:00
Steve Naroff 2da868e9c2 Add support for rewriting blocks...
llvm-svn: 56266
2008-09-17 00:13:27 +00:00
Daniel Dunbar 86169d6d0d Ignore XFAIL tests when checking for make failure in test/
llvm-svn: 56262
2008-09-16 23:43:13 +00:00
Ted Kremenek 025f83534c Fix copy-paste error in test case.
llvm-svn: 56261
2008-09-16 23:25:28 +00:00
Ted Kremenek 8782716c4a Minor pass-sensitivity improvement:
if we know that 'len != 0' and know that 'i == 0' then we know that
  'i < len' must evaluate to true and cannot evaluate to false

llvm-svn: 56260
2008-09-16 23:24:45 +00:00
Ted Kremenek 2b4b3b13a9 Update Xcode project.
llvm-svn: 56259
2008-09-16 23:21:45 +00:00
Steve Naroff 7a147c6a3c Remove support for BlockExprExpr. For example...
^(expression) or ^(int arg1, float arg2)(expression)
...is no longer supported. 
All block literals now require a compound statement.

llvm-svn: 56257
2008-09-16 23:11:46 +00:00
Steve Naroff 3b1e172d7e Sema::ActOnBlockReturnStmt(): Need to perform the UsualUnaryConversions on the return type.
Sema::CheckReturnStackAddr(): Make sure we skip over implicit casts.
Added some more test cases...

llvm-svn: 56254
2008-09-16 22:25:10 +00:00
Ted Kremenek 0ecb53a421 ProgramPoint now takes the space of two pointers instead of one. This change was
motivated because it became clear that the number of subclasses of ProgramPoint
would expand and we ran out of bits to represent a pointer variant. As a plus of
this change, BlockEdge program points can now be represented explicitly without
using a cache of CFGBlock* pairs in CFG.

llvm-svn: 56245
2008-09-16 18:44:52 +00:00
Zhongxing Xu 5912c6e6f0 Fixed an offset calculation error.
llvm-svn: 56242
2008-09-16 07:58:21 +00:00
Ted Kremenek 2d470fc0ba Patch by Csaba Hruska!
"Here is a patch what replaces std::ostream with llvm::raw_ostream. This patch
covers the AST library, but ignores Analysis lib."

llvm-svn: 56185
2008-09-13 05:16:45 +00:00
Ted Kremenek 5f09b1dece Updated checker build.
llvm-svn: 56177
2008-09-13 00:23:41 +00:00
Ted Kremenek 907921f753 Include links to stderr output of clang in the table of files that clang rejects.
llvm-svn: 56173
2008-09-12 22:49:36 +00:00
Daniel Dunbar 2880158a20 Add ccc support for -e and -sectorder.
- llvmc2, save me!

llvm-svn: 56169
2008-09-12 19:42:28 +00:00
Daniel Dunbar da41a14ce0 Round out object size checking builtins (fprintf ones disabled as we
have no mapping to FILE*). We are also missing printf format
attributes for the printf style ones.

llvm-svn: 56168
2008-09-12 18:39:42 +00:00
Daniel Dunbar 229121df87 Add website links to testing coverage & specification references.
llvm-svn: 56167
2008-09-12 18:33:44 +00:00
Ted Kremenek ef2b3a71bb Add missing spaces in path diagnostics.
llvm-svn: 56166
2008-09-12 18:17:46 +00:00
Daniel Dunbar be12fd1f4f Teach FindSpecRefs how to link to C++ spec.
llvm-svn: 56164
2008-09-12 18:10:49 +00:00
Daniel Dunbar 84b70f7f0f Add --suppress-system-warnings (on by default, use =0 to disable)
- For investigating warnings in system headers / builtins.
 - Currently also enables the behavior that allows silent redefinition
   of types in system headers. Conceptually these are separate but I
   didn't feel it was worth two options (or changing LangOptions).

llvm-svn: 56163
2008-09-12 18:10:20 +00:00
Ted Kremenek d3f0d9b07c Updated checker build.
llvm-svn: 56142
2008-09-12 04:56:58 +00:00
Douglas Gregor aa1e21dcbd Give string literals const element typesin C++, and cope with the deprecated C++ conversion from a string literal to a pointer-to-non-const-character
llvm-svn: 56137
2008-09-12 00:47:35 +00:00
Daniel Dunbar 484603be40 Iterate on sema for :? in Objective-C:
- Follow C99 behavior of using other operand type when one of
   operands is a null pointer constant.
 - Fix overenthusiastic devolving of any Objective-C types to id:
   o If either operand has an Objective-C object type then:
     - If both operands are interfaces and either operand can be
       assigned to the other, use that type as the composite type.
     - Otherwise, if either type is id, use id as the composite type.
     - Otherwise, warn about incompatible types and use id as the
       composite type.
 - Return handling of qualified idea to separate test following
   general pointer type checking.
   o Upgraded from old code to allow devolving to id (without warning,
     which matches GCC).
 - <rdar://problem/6212771>

Add test case for issues fixed above, XFAIL though because it exposed
a new issue in property handling.

llvm-svn: 56135
2008-09-11 23:12:46 +00:00
Argyrios Kyrtzidis 47f9865182 Add comments about C++ clause 3.3.2p4 that mentions that the condition declaration should be local to an if/switch/while/for statement.
llvm-svn: 56134
2008-09-11 23:08:39 +00:00
Ted Kremenek 4ab81cbe2f Echo stderr/stdout from clang subprocess to both the stderr of ccc-analyzer and
to an output file. This way users can both see the output of 'clang' as well as
enable background logging of files that clang encounters problems on.

llvm-svn: 56130
2008-09-11 23:05:26 +00:00
Ted Kremenek 28d1dc50b8 Bug fix: <rdar://problem/6164367>
scan-build now correctly processes path prefixes that contain multiple '+'
characters or other regex control characters.

llvm-svn: 56121
2008-09-11 21:15:10 +00:00
Mon P Wang 08fedcbcbb Added SSE41 pminsd, pmaxsd, roundps and a few others
llvm-svn: 56114
2008-09-11 19:22:31 +00:00
Ted Kremenek 81ced5c472 Check if the environment variable TERM is defined before using it.
This fixes: <rdar://problem/6164279> scan-build gives error when invoked without TERM variable

llvm-svn: 56110
2008-09-11 18:17:51 +00:00
Ted Kremenek c4488441da Update Xcode project.
llvm-svn: 56109
2008-09-11 18:14:22 +00:00
Steve Naroff 4adbe3116e Fix <rdar://problem/6210791> clang ObjC rewriter: @try / @catch block with no @finally does not call objc_exception_try_exit.
Need a couple tweaks to RewriteObjCTryStmt(). Need to deal with implicit finally clauses (to make sure objc_exception_try_exit is called). Also fixed a related bug where we need to generate an implicit @catch else clause (to again make sure objc_exception_try_exit is called).

llvm-svn: 56104
2008-09-11 15:29:03 +00:00
Douglas Gregor 27a907eb8c bool is not an extension in C++
llvm-svn: 56103
2008-09-11 12:06:59 +00:00
Anders Carlsson 9396a89899 Make sure to store the exception in the catch parameter.
llvm-svn: 56102
2008-09-11 09:15:33 +00:00
Anders Carlsson b5130d8588 Make sure to emit the catch parameter as well as the catch body.
llvm-svn: 56101
2008-09-11 08:21:54 +00:00
Anders Carlsson 3a3c2444d6 Fix stupid mistake I made in the exception handling code
llvm-svn: 56100
2008-09-11 06:35:14 +00:00
Argyrios Kyrtzidis 176edb5490 Do implicit conversion to bool for the condition in a do-while statement.
llvm-svn: 56096
2008-09-11 05:16:22 +00:00
Argyrios Kyrtzidis fea38016a9 Fix do-while scoping in C++.
llvm-svn: 56095
2008-09-11 04:46:46 +00:00
Argyrios Kyrtzidis 9321c74bd0 Allow array-to-pointer conversion for rvalues.
llvm-svn: 56094
2008-09-11 04:25:59 +00:00
Argyrios Kyrtzidis 0fdbd6cf25 CXXConditionDeclExpr expression node is an lvalue.
llvm-svn: 56093
2008-09-11 04:22:26 +00:00
Argyrios Kyrtzidis e7092bafc2 LangOptions.C99 should be false in C++.
llvm-svn: 56092
2008-09-11 04:21:06 +00:00
Argyrios Kyrtzidis 504bb844ba Revert r56078, getLang().C99 being true in C++ is a bug that will be fixed.
llvm-svn: 56090
2008-09-11 03:06:46 +00:00
Douglas Gregor e972aa471d Add support for expected-note to Clang's -verify option
llvm-svn: 56089
2008-09-11 02:46:36 +00:00
Daniel Dunbar d3674e6f40 Use ABIArgInfo for decisions about function arguments (not just return
value).
 - Added ABIArgInfo::ByVal (mostly supported) and ABIArgInfo::Expand
   (asserted out).

 - Added classifyArgumentType which currently just uses
   ABIArgInfo::Default or ByVal. This nearly matches old behavior, but
   we now set ByVal in a few situations we may have left it off before
   (on complex, for example).

llvm-svn: 56086
2008-09-11 01:48:57 +00:00
Daniel Dunbar ce05c8eb49 Fix two bugs exposed by array passing assert:
(1) Additional arguments to variadic methods should have default
promotions applied.

(2) Additional arguments to non-variadic methods were allowed.

llvm-svn: 56084
2008-09-11 00:50:25 +00:00
Daniel Dunbar 16211a2cc7 Add ObjCMethodDecl::getSourceRange.
llvm-svn: 56083
2008-09-11 00:47:15 +00:00
Argyrios Kyrtzidis f01fa82423 Fold Parser::ParseTag into Parser::ParseEnumSpecifier, as suggested in this post:
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2008-September/002721.html

llvm-svn: 56081
2008-09-11 00:21:41 +00:00
Daniel Dunbar 83876b4594 Bug fix, apply default argument promotion in message sends for which
no method declaration was found.
 - This was allowing arrays to pass "by value" among other things.

Add assert in CodeGen that arguments cannot have array type.

llvm-svn: 56080
2008-09-11 00:04:36 +00:00
Daniel Dunbar aa9326c7e2 Refactor common Obj-C message send checking code into
CheckMessageArgumentTypes.
 - No functionality change.

llvm-svn: 56079
2008-09-11 00:01:56 +00:00
Argyrios Kyrtzidis 48dea3b9f5 -getLang().C99 is true in C++ too, remove the use of the C99orCXX variable.
-Scoping in C99 works good for C++ too, remove the C++-specific comments.

If someone thinks that the C++-specific comments are necessary for clarification, let me know and I'll put them back on.

llvm-svn: 56078
2008-09-10 23:46:08 +00:00
Argyrios Kyrtzidis 996677e12d In the 'condition.cpp' test case, make sure that condition declarations are local to the statement.
llvm-svn: 56077
2008-09-10 23:34:50 +00:00
Daniel Dunbar b034bc71d4 Add XFAIL test case for:
<rdar://problem/6211479> [sema] array type invalid for Obj-C property

llvm-svn: 56075
2008-09-10 23:11:23 +00:00
Steve Naroff 2752a17a00 More semantic analysis for blocks...
llvm-svn: 56064
2008-09-10 19:17:48 +00:00
Steve Naroff 3ef15b5c2a Sema::ActOnIdentifierExpr(): Lookup block arguments.
llvm-svn: 56063
2008-09-10 18:33:00 +00:00
Argyrios Kyrtzidis eece3fe4fd Add some C++-specific comments in the parsing methods of if/switch/while/for.
llvm-svn: 56060
2008-09-10 17:38:35 +00:00
Daniel Dunbar 573884eaf7 Implement ABIArgType::Coerce support.
- As a test, enable basic usage for some common x86-32 cases. This
    increases our x86-32 compliance (on other targets our compliance
    will just be broken in a different way).

llvm-svn: 56051
2008-09-10 07:04:09 +00:00
Daniel Dunbar b8b4759462 Add CodeGenTypes::GetFunctionType overload for getting the effective
type of a call.

Change NeXT runtime to use this instead of trying to bitcasting
internally (which doesn't respect the ABI).

Fix subtle bug, use of ConvertTypeRecursive instead of ConvertType is
bad inside GetFunctionType.

llvm-svn: 56050
2008-09-10 07:00:50 +00:00
Daniel Dunbar 7a95ca3197 Move FunctionType conversion into CGCall.cpp:
- Added CodeGenTypes::GetFunctionType, taking a CGFunctionInfo.
 - Updated Obj-C runtimes to use this instead of rolling the
   llvm::FunctionType by hand.
 - Killed CodeGenTypes::{ConvertReturnType, DecodeArgumentTypes}.

Add ABIArgInfo class to encapsulate ABI decision of how to lower types
to LLVM.
 - Will move to target sometime soon.

llvm-svn: 56047
2008-09-10 04:01:49 +00:00
Daniel Dunbar a72d4aece6 Add ABIArgInfo class to encapsulate ABI decision of how to lower types
to LLVM.
 - Will move to target sometime soon.

llvm-svn: 56046
2008-09-10 02:41:04 +00:00
Argyrios Kyrtzidis 07052350f0 Implement CodeGen support for the 'CXXConditionDeclExpr' expression node, which represents a 'condition' declaration, e.g: "if (int x=0) {...}".
llvm-svn: 56045
2008-09-10 02:36:38 +00:00
Argyrios Kyrtzidis 7620ee4550 Implement Sema support for the 'condition' part of C++ selection-statements and iteration-statements (if/switch/while/for).
llvm-svn: 56044
2008-09-10 02:17:11 +00:00
Argyrios Kyrtzidis 791dc3cd4e Change line endings: CRLF -> LF
llvm-svn: 56043
2008-09-10 02:14:49 +00:00
Argyrios Kyrtzidis ac1f2abd93 Use Sema::isDeclInScope instead of IdentifierResolver::isDeclInScope.
llvm-svn: 56042
2008-09-10 02:11:07 +00:00
Daniel Dunbar c68897d2c3 Tweak CGCall functions again:
- Realized these functions will eventually need access to more data,
   moved to CodeGenModule. Eventually they should probably live
   together in some other helper class.

llvm-svn: 56039
2008-09-10 00:41:16 +00:00
Daniel Dunbar 76c8eb75b1 Tweak CGCall functions:
- Move actual param attr list creation to
   CodeGenFunction::ConstructParamAttrList.
 - Make ReturnTypeUsesSret static.

llvm-svn: 56038
2008-09-10 00:32:18 +00:00
Daniel Dunbar 81cf67fa0b Add CodeGenFunction::ReturnTypeUsesSret
- Hook so NeXT runtime doesn't depend on ABI.

llvm-svn: 56034
2008-09-09 23:48:28 +00:00
Argyrios Kyrtzidis aa479138ea Add new 'CXXConditionDeclExpr' expression node used for a 'condition' declaration, e.g: "if (int x=0) {...}".
It is a subclass of DeclRefExpr and the main difference is that CXXConditionDeclExpr owns the declaration that it references.

llvm-svn: 56033
2008-09-09 23:47:53 +00:00
Daniel Dunbar 613855c8af Move ABI specific code for functions / calls to CGCall.cpp:
- Factor out EmitFunction{Pro,Epi}log

llvm-svn: 56031
2008-09-09 23:27:19 +00:00
Daniel Dunbar bc915f4025 Factor CodeGenFunction::StartFunction out of GenerateCode and
StartObjCMethod.

llvm-svn: 56030
2008-09-09 23:14:03 +00:00