Commit Graph

5335 Commits

Author SHA1 Message Date
Chris Lattner 091f698d29 "this patch adds code generation hooks for Objective-C constant strings. It also modifies Sema so that Objective-C constant strings are treated as untyped objects if the interface for the constant string class can not be found. This is consistent with Apple GCC. I thought it was consistent with GNU GCC, since this was causing failures when trying to compile GNUstep with (GNU) GCC, but it appears that this is not the case when attempting to produce a simple test case to demonstrate it. Possibly there is a way of making the error go away, but I haven't found out what it is yet."
Patch by David Chisnall!

llvm-svn: 52599
2008-06-21 21:44:18 +00:00
Chris Lattner 0f2b471730 Implement printing for ObjCClassDecl's, patch by Jean-Daniel Dupas!
llvm-svn: 52598
2008-06-21 21:40:20 +00:00
Chris Lattner c4f38851e6 Don't add isa with @defs only to work around it in the code generator, patch
by David Chisnall. 

llvm-svn: 52597
2008-06-21 21:37:25 +00:00
Chris Lattner 5a92bab4f0 "This moves built-in Objective-C types up the scope chains to where they can be replaced by versions included from the runtime library's headers."
This makes it ok to use @"foo" without a declaration for NSConstantString.

Patch by David Chisnall!

llvm-svn: 52593
2008-06-21 20:20:39 +00:00
Chris Lattner 535b830449 add parser and sema support for the funny ObjC '@defs' thing.
Patch by David Chisnall!

llvm-svn: 52586
2008-06-21 19:39:06 +00:00
Chris Lattner 5d20a70d01 remove dead enums.
llvm-svn: 52581
2008-06-21 18:06:44 +00:00
Chris Lattner a9b3cae8fd Switch 'super' from being a weird cast thing to being a predefined expr node.
Patch by David Chisnall with objc rewriter and stmtdumper updates from me.

llvm-svn: 52580
2008-06-21 18:04:54 +00:00
Chris Lattner 552b52f49d "This maps the -pthread option to -lpthread - this isn't 100% correct,
since handling this correctly is quite complex, and on some platforms  
requires additional -D options and on some implies linking against a  
different libc, but this works better than just ignoring the option.

The other change passes the -x option across to clang, which allows  
compiling .c files as Objective-C and so on.  For some reason a lot of  
configure scripts seem to be under the misguided impression that this  
is a sensible thing to do."

Patch by David Chisnall!

llvm-svn: 52579
2008-06-21 17:46:11 +00:00
Ted Kremenek 68d2368064 Include stdint.h instead of stdio.h.
llvm-svn: 52578
2008-06-21 17:20:55 +00:00
Argyrios Kyrtzidis e6aff3db25 K&R-style functions not allowed in C++.
llvm-svn: 52575
2008-06-21 10:00:56 +00:00
Ted Kremenek 9f9aefdc89 Updated latest static analyzer builder to checker-43.
llvm-svn: 52569
2008-06-20 23:22:15 +00:00
Ted Kremenek 22cf89d9cd Test the dead-store checker using both -warn-dead-stores and -checker-simple.
llvm-svn: 52568
2008-06-20 23:14:52 +00:00
Ted Kremenek c9cea053ba When using the dead-stores checker with the BugReporter class, properly capture the diagnostic associated with a specific warning and emit it.
llvm-svn: 52565
2008-06-20 23:13:39 +00:00
Ted Kremenek ec93f25a9c Updated latest checker build.
llvm-svn: 52563
2008-06-20 21:56:47 +00:00
Ted Kremenek c64511152a Updated call to dead stores to use proper arguments.
llvm-svn: 52560
2008-06-20 21:55:29 +00:00
Ted Kremenek 837d967fe8 Updated latest static analyzer build to checker-41.
llvm-svn: 52559
2008-06-20 21:54:57 +00:00
Ted Kremenek b0ead8520c Updated Xcode project.
llvm-svn: 52556
2008-06-20 21:46:17 +00:00
Ted Kremenek 34a691734e Modified the dead stores checker to...
1) Check if a dead store appears as a subexpression.  For such cases, we emit
   a verbose diagnostic so that users aren't confused.  This addresses:
   
   <rdar://problem/5968508> checker gives misleading report for dead store in loop
   
2) Don't emit a dead store warning when assigning a null value to a pointer.
   This is a common form of defensive programming.  We may wish to make
   this an option to the the checker one day.
   
   This addresses the feature request in the following email:
   
   http://lists.cs.uiuc.edu/pipermail/cfe-dev/2008-June/001978.html

llvm-svn: 52555
2008-06-20 21:45:25 +00:00
Ted Kremenek 99ecdd175d Added ParentMap, a class to represent a lazily constructed mapping from child to parents.
llvm-svn: 52553
2008-06-20 21:40:36 +00:00
Ted Kremenek d50c7a4b0d Added "Decl::getCodyBody()", a virtual method that returns the root AST node (Stmt*) that the Decl wraps (if any). Currently this only returns a non-null value for FunctionDecl and ObjCMethodDecl.
llvm-svn: 52552
2008-06-20 21:39:47 +00:00
Ted Kremenek e562289a0f Updated latest static analysis build.
llvm-svn: 52512
2008-06-19 23:20:00 +00:00
Ted Kremenek 940a738e77 Add DTD information.
llvm-svn: 52511
2008-06-19 23:14:24 +00:00
Mike Stump d7667bd8e0 Remove tabs.
llvm-svn: 52507
2008-06-19 20:57:50 +00:00
Mike Stump 65643c6480 One more test checkin.
Remove an extra space at the end of a line.

llvm-svn: 52504
2008-06-19 19:52:46 +00:00
Mike Stump 01e07653d4 Test commit to see if new account works.
I choose to remove extraneous whitespace at end of lines as a semantic
nop for the test.

llvm-svn: 52503
2008-06-19 19:28:49 +00:00
Ted Kremenek 46c82ab994 Introduce initial transfer function support for __imag__ and __real__. We don't
have complex RValues yet, so this logic is only fully implemented when __imag__
and __real__ are used on non-complex types.

llvm-svn: 52501
2008-06-19 17:55:38 +00:00
Ted Kremenek 1ce19b9941 Updated static analyzer build to checker-39.
llvm-svn: 52446
2008-06-18 05:43:24 +00:00
Ted Kremenek 9a935fbdeb Added a new ProgramPoint: PostPurgeDeadSymbols. This new program point distinguishes between the cases when we just evaluated the transfer function of a Stmt* (PostStmt) or performed a load (PostLoad). This solves a caching bug observed in a recent bug report.
llvm-svn: 52443
2008-06-18 05:34:07 +00:00
Ted Kremenek e157b265b7 Update website link to latest checker build.
llvm-svn: 52429
2008-06-17 19:23:54 +00:00
Ted Kremenek 3802fedfe4 Fix non-termination bug reported by Thomas Clement!
llvm-svn: 52426
2008-06-17 19:14:06 +00:00
Chris Lattner 5696e7badf Change self/_cmd to be instances of ImplicitParamDecl instead of ParmVarDecl.
Patch by David Chisnall!

llvm-svn: 52422
2008-06-17 18:05:57 +00:00
Nuno Lopes a02e2f991b handle -arch and -isysroot correctly (like ccc-analyszer do).
Patch by Filipe Cabecinhas

llvm-svn: 52417
2008-06-17 17:23:14 +00:00
Ted Kremenek 1cc38e71b3 Added link to Developer Meeting.
llvm-svn: 52403
2008-06-17 14:02:30 +00:00
Ted Kremenek bacb584c8b Flush bullets in <ul>
llvm-svn: 52402
2008-06-17 13:55:34 +00:00
Ted Kremenek 77251e9f54 Convert <h4> to <h3>.
llvm-svn: 52400
2008-06-17 13:48:36 +00:00
Ted Kremenek 3c02064b05 Tighten <h2> padding.
llvm-svn: 52399
2008-06-17 13:48:17 +00:00
Ted Kremenek 473b3fb519 Simplify anchor.
llvm-svn: 52398
2008-06-17 13:47:52 +00:00
Ted Kremenek c07d000356 Remove margin above <h1>.
llvm-svn: 52389
2008-06-17 07:05:45 +00:00
Ted Kremenek deba2fbfa4 Make "important notes" more succinct.
llvm-svn: 52388
2008-06-17 06:47:58 +00:00
Ted Kremenek 9eb18aa82b Include the "latest build" checker link using SSI.
llvm-svn: 52387
2008-06-17 06:43:11 +00:00
Ted Kremenek 2d93ec7eca Split static analysis page into two pages: a high-level information page (with quick download links) and a usage page.
llvm-svn: 52386
2008-06-17 06:38:07 +00:00
Ted Kremenek 7d14f86f4a Tweak font sizes.
Color <h3> light blue, <h2> a dark grey.

llvm-svn: 52385
2008-06-17 06:36:13 +00:00
Ted Kremenek cbcfe6c693 Convert <h2> -> <h3>. <h1> -> <h2> (more consistent with other pages)
llvm-svn: 52384
2008-06-17 06:35:36 +00:00
Eli Friedman fd4c32164c Make this test actually pass, in addition to the previous patch
which made it work.

llvm-svn: 52382
2008-06-17 05:36:46 +00:00
Ted Kremenek c6501dbc10 Fix more strict-aliasing warnings.
Fix indentation of class declarations in ExprCXX.h

llvm-svn: 52380
2008-06-17 03:11:08 +00:00
Ted Kremenek 3dd7724711 Only use colored output when the environment variable SCAN_BUILD_COLOR is set.
llvm-svn: 52379
2008-06-17 03:06:59 +00:00
Ted Kremenek 08e171183f This patch is motivated by numerous strict-aliasing warnings when compiling
clang as a Release build.

The big change is that all AST nodes (subclasses of Stmt) whose children are
Expr* store their children as Stmt* or arrays of Stmt*. This is to remove
strict-aliasing warnings when using StmtIterator. None of the interfaces of any
of the classes have changed (except those with arg_iterators, see below), as the
accessor methods introduce the needed casts (via cast<>). While this extra
casting may seem cumbersome, it actually adds some important sanity checks
throughout the codebase, as clients using StmtIterator can potentially overwrite
children that are expected to be Expr* with Stmt* (that aren't Expr*). The casts
provide extra sanity checks that are operational in debug builds to catch
invariant violations such as these.

For classes that have arg_iterators (e.g., CallExpr), the definition of
arg_iterator has been replaced. Instead of it being Expr**, it is an actual
class (called ExprIterator) that wraps a Stmt**, and provides the necessary
operators for iteration. The nice thing about this class is that it also uses
cast<> to type-checking, which introduces extra sanity checks throughout the
codebase that are useful for debugging.

A few of the CodeGen functions that use arg_iterator (especially from
OverloadExpr) have been modified to take begin and end iterators instead of a
base Expr** and the number of arguments. This matches more with the abstraction
of iteration. This still needs to be cleaned up a little bit, as clients expect
that ExprIterator is a RandomAccessIterator (which we may or may not wish to
allow for efficiency of representation).

This is a fairly large patch. It passes the tests (except CodeGen/bitfield.c,
which was already broken) on both a Debug and Release build, but it should
obviously be reviewed.

llvm-svn: 52378
2008-06-17 02:43:46 +00:00
Ted Kremenek 1c77e8f26b Silence uninitialized value warning in Release build.
llvm-svn: 52376
2008-06-16 23:46:27 +00:00
Ted Kremenek bba87243aa Silence uninitialized value warning during Release build.
llvm-svn: 52375
2008-06-16 23:45:12 +00:00
Ted Kremenek 51ca6fa512 Remove debugging message in ccc-analyzer.
Add color diagnostics from scan-build, and indicate the number of bugs found (if any).

llvm-svn: 52372
2008-06-16 22:40:14 +00:00
Ted Kremenek c9904b61af Latest release is checker-37.
llvm-svn: 52370
2008-06-16 21:46:12 +00:00
Ted Kremenek c17ec3e27f Re-enable the analyzer.
llvm-svn: 52367
2008-06-16 21:41:07 +00:00
Ted Kremenek 6bed7d6b1e Remove Analysis-Apple.
llvm-svn: 52366
2008-06-16 21:21:48 +00:00
Ted Kremenek f3c8650502 Move test case "uninit-msg-expr.m" from Analysis-Apple to Analysis (now works on all platforms).
llvm-svn: 52362
2008-06-16 21:15:29 +00:00
Ted Kremenek 2eed4d7a25 Moved test case NoReturn.m from Analysis-Apple to Analysis (now works on all platforms).
llvm-svn: 52359
2008-06-16 21:05:04 +00:00
Ted Kremenek bbe6111cc3 Move NSString.m test case from Analysis-Apple to Analysis. The test case now works on all platforms.
llvm-svn: 52354
2008-06-16 20:37:30 +00:00
Ted Kremenek ccafce3d4c Update test case to use -pedantic (makes the test case more clear).
llvm-svn: 52349
2008-06-16 19:53:46 +00:00
Ted Kremenek 5935a17daf Fix misspelling of "svelte".
llvm-svn: 52348
2008-06-16 19:51:41 +00:00
Ted Kremenek 951bc67096 Move Analysis-Apple/CFString.c to Analysis (the test case now works on all platforms).
llvm-svn: 52346
2008-06-16 19:35:31 +00:00
Ted Kremenek 107f13971f Move CFDateGC.m test case from Analysis-Apple to Analysis (it now runs on all platforms).
llvm-svn: 52344
2008-06-16 18:46:17 +00:00
Ted Kremenek 7056bb1f21 Moved CFDate.m from test/Analysis-Apple to test/Analysis, and added the necessary declarations from Foundation.h to CFDate.m so that the test case can be exercised on all platforms.
llvm-svn: 52343
2008-06-16 18:34:22 +00:00
Ted Kremenek 87c760af36 Add test case for NSString format-string checking.
llvm-svn: 52337
2008-06-16 18:01:05 +00:00
Ted Kremenek 34f664d443 Introduce preliminary support for NSString format-string checking.
Patch by Nikita Zhuk!

llvm-svn: 52336
2008-06-16 18:00:42 +00:00
Chris Lattner 22b9ff4131 force size of alloca to i32, which is currently required by LLVM IR.
This fixes use of alloca on 64-bit systems.

llvm-svn: 52334
2008-06-16 17:15:14 +00:00
Eli Friedman 327944b343 Basic support for volatile loads and stores. Stores the volatile
qualifier in the lvalue, and changes lvalue loads/stores to honor 
the volatile flag.  Places which need some further attention are marked 
with FIXMEs.

Patch by Cédric Venet.

llvm-svn: 52264
2008-06-13 23:01:12 +00:00
Ted Kremenek 871fcb57e7 Tweak h1 line-height to avoid text overlay issues in the headers.
llvm-svn: 52256
2008-06-13 21:09:07 +00:00
Ted Kremenek 54aba504be CSS tweaks with the menu to help resolve some menu/content overlap issues.
llvm-svn: 52255
2008-06-13 21:06:53 +00:00
Argyrios Kyrtzidis 351008da17 Allow -parse-noop -verify options to be used together.
llvm-svn: 52249
2008-06-13 12:15:34 +00:00
Ted Kremenek b7aa2cc416 Grammo.
llvm-svn: 52241
2008-06-12 19:14:13 +00:00
Ted Kremenek 05e2f6006c Added an "important notes" section. Tweaked formatting.
llvm-svn: 52239
2008-06-12 18:39:02 +00:00
Argyrios Kyrtzidis caec17eab9 Fix broken test.
llvm-svn: 52232
2008-06-12 12:44:52 +00:00
Argyrios Kyrtzidis 351763e156 Multiple tests in a single test file must be linked with '&&'.
Otherwise, failing tests other than the last one will not be reported.

llvm-svn: 52231
2008-06-12 12:40:02 +00:00
Argyrios Kyrtzidis de794aadae Fix "copy & paste" error.
llvm-svn: 52227
2008-06-11 23:15:56 +00:00
Ted Kremenek 3715385cf0 Added direct link to latest analyzer build on Mac OS X.
llvm-svn: 52222
2008-06-11 16:16:41 +00:00
Ted Kremenek 690f46fd20 Added a disclaimer about running time, and provided an executive summary of the tool's interface.
llvm-svn: 52221
2008-06-11 16:09:34 +00:00
Ted Kremenek 9f25c1d219 Use relative links that start with "/" so the menu works from different subdirectories.
llvm-svn: 52210
2008-06-11 06:22:05 +00:00
Eli Friedman 61b529f466 Don't crash if we can't find FileEntry info for a typedef, since one
isn't guaranteed to exist. This fixes a crash with conflicting typedefs
coming from stdin.

This also fixes the crash in PR2406, but doesn't completely fix the 
issue; it appears there's something strange about the physical location 
for the definition of int64_t in stdlib.h.

llvm-svn: 52209
2008-06-11 06:20:39 +00:00
Ted Kremenek d2c8970a9a Use same CSS as the rest of the clang website.
llvm-svn: 52208
2008-06-11 06:19:49 +00:00
Ted Kremenek 1d920583e5 Fix menu/content overlap.
llvm-svn: 52207
2008-06-11 06:15:58 +00:00
Ted Kremenek 56847a7249 More padding adjustments.
llvm-svn: 52206
2008-06-11 06:14:37 +00:00
Ted Kremenek 7d4955d842 Shorten menu item name.
llvm-svn: 52205
2008-06-11 06:13:36 +00:00
Ted Kremenek 9c682c000a Add some padding to the right of "content" to balance out.
llvm-svn: 52204
2008-06-11 06:08:58 +00:00
Ted Kremenek 3ec4889258 Less padding... (difficult to preview without commits)
llvm-svn: 52203
2008-06-11 06:08:05 +00:00
Ted Kremenek a32374a768 More padding...
llvm-svn: 52202
2008-06-11 06:07:21 +00:00
Ted Kremenek 909ce26888 Expand padding of content.
llvm-svn: 52201
2008-06-11 06:06:43 +00:00
Ted Kremenek 91f223a587 Added static analysis link.
llvm-svn: 52200
2008-06-11 06:04:56 +00:00
Ted Kremenek 2a10380f99 Make default text a little darker. Shorten title in Static Analysis page.
llvm-svn: 52199
2008-06-11 06:01:28 +00:00
Ted Kremenek 2fc9d272a0 More CSS refinements.
llvm-svn: 52198
2008-06-11 05:55:39 +00:00
Ted Kremenek e368a8cb02 Use Arial as default font.
llvm-svn: 52197
2008-06-11 05:32:48 +00:00
Ted Kremenek 39da888759 Use sans-serif font.
llvm-svn: 52196
2008-06-11 05:29:48 +00:00
Ted Kremenek 567d28c20d Included page-specific formatting for tables.
llvm-svn: 52195
2008-06-11 05:28:36 +00:00
Ted Kremenek 9b9fe9799c Include side-menu.
llvm-svn: 52194
2008-06-11 05:26:52 +00:00
Ted Kremenek c2144e73a1 Minor tweaks/grammar/formatting.
llvm-svn: 52193
2008-06-11 05:25:12 +00:00
Ted Kremenek 2f7a88ddf6 Skip a few more files and linker options.
llvm-svn: 52189
2008-06-10 18:56:59 +00:00
Argyrios Kyrtzidis 34fe86cd9c Fix the setup of CodeGen/bitfield.c test.
Due to the broken setup it was passing the test while it should have failed.

llvm-svn: 52181
2008-06-10 15:48:26 +00:00
Eli Friedman 940a7c0cf8 Fix the run line for this test.
llvm-svn: 52169
2008-06-10 05:18:06 +00:00
Eli Friedman 4f64def9ee Make this test C instead of C++; making it C++ causes a failure on Linux
because clang can't parse stdio.h in C++ mode yet.

llvm-svn: 52168
2008-06-10 05:14:31 +00:00
Eli Friedman d5b11a3adc Don't include complex.h or tgmath.h for this test; they aren't needed,
and including tgmath.h causes the test to fail for no good reason.

llvm-svn: 52167
2008-06-10 05:09:36 +00:00
Eli Friedman d48188e8e0 Fix getTrueExpr for ConditionalOperator to actually work. No testcase
because it's currently unused.

llvm-svn: 52166
2008-06-10 05:00:13 +00:00
Argyrios Kyrtzidis 406fb231f8 -Add DeclChain member to DeclContext.
-ScopedDecls get chained to their DeclContext.
-DeclContext's DeclChain replaces FunctionDecl's DeclChain and EnumDecl's ElementList.

llvm-svn: 52164
2008-06-10 01:32:09 +00:00