Commit Graph

5498 Commits

Author SHA1 Message Date
Argyrios Kyrtzidis f4ebe9ea4f Handle unnamed bitfields when parsing C++ classes.
llvm-svn: 52855
2008-06-28 08:10:48 +00:00
Eli Friedman 4f89ccb1df Fix for PR2501; this patch makes usual arithmetic conversions for
integers which have the same width and different signedness work 
correctly. (The testcase in PR2501 uses a comparison between long and 
unsigned int).

llvm-svn: 52853
2008-06-28 06:23:08 +00:00
Argyrios Kyrtzidis 853fbea313 Replace CurFunctionDecl and CurMethodDecl with methods getCurFunctionDecl() and getCurMethodDecl() that return the appropriate Decl through CurContext.
llvm-svn: 52852
2008-06-28 06:07:14 +00:00
Ted Kremenek 62ea6e8b6a Updated checker build to checker-47.
llvm-svn: 52848
2008-06-28 00:13:07 +00:00
Chris Lattner e6c693d932 Fix a bug where we didn't promote 'const float' (or typedefs) to
double in some places.

llvm-svn: 52846
2008-06-27 22:48:56 +00:00
Chris Lattner acbc2d200d the 'mode' attribute is a decl attribute, not a type attribute. Move it to
SemaDeclAttr, and do some cleanups.

llvm-svn: 52844
2008-06-27 22:18:37 +00:00
Chris Lattner 0e7c7c9ee1 Nuno points out that my numbers were out of date
llvm-svn: 52840
2008-06-27 21:56:03 +00:00
Chris Lattner d9f8413402 making progress!
llvm-svn: 52833
2008-06-27 19:02:23 +00:00
Cedric Venet 3903908794 Add missing include file (due to a file splitting in llvm).
Add new file to Sema Project for VS.
this unbreak the build for VS2005 (with the associated patch on llvm).

llvm-svn: 52830
2008-06-27 17:53:02 +00:00
Ted Kremenek cf1ab19086 Added a simple static analysis check to look for improper uses of CFCreateNumber.
llvm-svn: 52799
2008-06-26 23:59:48 +00:00
Chris Lattner 2c6fcf5abb move decl attribute processing to a new SemaDeclAttr.cpp.
llvm-svn: 52792
2008-06-26 18:38:35 +00:00
Ted Kremenek a4c52a3366 Update Xcode project so that the clang target depends on LLVMAnalysis.a
llvm-svn: 52790
2008-06-26 17:53:57 +00:00
Chris Lattner d1224b2493 clang uses the llvm backend, so define __llvm__ like llvm-gcc.
Additionally, define __clang__ so clients can predicate based on
clang features.

llvm-svn: 52788
2008-06-26 17:26:01 +00:00
Cedric Venet 68cbee847e Another class -> struct in declaration to match definition.
llvm-svn: 52782
2008-06-26 12:50:52 +00:00
Matthijs Kooijman 0fb56e50b1 Make clang work on 32 bit powerpc linux.
Patch by Nick Lewycky!

llvm-svn: 52777
2008-06-26 08:39:30 +00:00
Matthijs Kooijman 70574af7d8 Link in LLVMAnalysis after LLVMCodeGen, since the latter depends on the former
since LLVM r52748.

llvm-svn: 52776
2008-06-26 08:37:29 +00:00
Chris Lattner cf31de3760 Make Declarator::getDeclSpec() return a const reference to avoid
cases where mutation can introduce bugs.  Propagate around 'const'.

llvm-svn: 52772
2008-06-26 06:49:43 +00:00
Chris Lattner 3e39fa365d add a comment about something that was surprising, at least to me.
llvm-svn: 52771
2008-06-26 06:39:41 +00:00
Chris Lattner 2239b7d3d2 rename some attr tests for consistency.
llvm-svn: 52770
2008-06-26 06:32:02 +00:00
Chris Lattner 4b413ea3bf fix a bug handling type attributes in the declspec. declspec processing
used to mutate the attribute list for declspecs when the type was 
converted, breaking the case where one declspec was shared by multiple
declarators.

This fixes rdar://6032532.

llvm-svn: 52769
2008-06-26 06:27:57 +00:00
Chris Lattner dd7c10227b another const correctness bug with declspec.
llvm-svn: 52768
2008-06-26 06:11:04 +00:00
Chris Lattner c8846a19d4 fix const correctness of accessor.
llvm-svn: 52767
2008-06-26 06:07:52 +00:00
Chris Lattner bf231a61fd refactor more objc codegen interfaces to pass around selectors so
we don't push strings into LLVM IR and then have to read them back out.

llvm-svn: 52765
2008-06-26 05:08:00 +00:00
Chris Lattner 882034dd99 indenting and other minor things.
llvm-svn: 52764
2008-06-26 04:52:29 +00:00
Chris Lattner da35bc8e53 refactor interface to GenerateClassStructure to avoid converting a
string to LLVM IR and then regenerating the string from IR.

llvm-svn: 52762
2008-06-26 04:47:04 +00:00
Chris Lattner d9b98863c4 remove the old getSelector implementation, which removes some
calls to getStringValue

llvm-svn: 52761
2008-06-26 04:44:19 +00:00
Chris Lattner 6cfec78e48 avoid a lot of unneeded selector processing work by passing around
selectors instead of Value*'s.

llvm-svn: 52760
2008-06-26 04:42:20 +00:00
Chris Lattner 9a05d04a0d use cheaper/simpler getselector call for @selector exprs.
llvm-svn: 52759
2008-06-26 04:38:58 +00:00
Chris Lattner 6d522c0133 start avoid doing lots of unneeded work handling selectors
llvm-svn: 52758
2008-06-26 04:37:12 +00:00
Chris Lattner 42587147d4 improve indentation, avoid thrashing on maps and recalculating strings as much.
llvm-svn: 52757
2008-06-26 04:24:57 +00:00
Chris Lattner 87ab27d42f give CreateObjCRuntime a full CGM so it can get whatever state it needs,
instead of passing in just a couple random things it currently 
happens to use.

llvm-svn: 52756
2008-06-26 04:19:03 +00:00
Chris Lattner 63dd337fc2 Fix 80 col violations, assert on assumptions.
llvm-svn: 52755
2008-06-26 04:10:42 +00:00
Chris Lattner 64d8d074a8 fix this testcase after Mon Ping's intrinsic rename.
llvm-svn: 52754
2008-06-26 04:06:27 +00:00
Chris Lattner d46944d639 a temporary minimal hack to get clang building after the getStringValue changes in llvm mainline.
llvm-svn: 52753
2008-06-26 04:05:20 +00:00
Ted Kremenek f7b72b6940 Updated latest checker build to checker-45.
llvm-svn: 52746
2008-06-26 00:04:08 +00:00
Ted Kremenek 3185c9c9cd CF ref checker:
Tracked objects now have their type information tracked with them.

Enhanced summaries for ObjC methods to include the type information of the receiver.

Used the enhanced summaries to support the idiom that NSWindow owns itself (it sends a release message to itself upon close).

Added some comments.

Did some cleanups with the checker logic using operator overloading (reduced redundant code which I was concerned about being the source of bugs).

llvm-svn: 52741
2008-06-25 21:21:56 +00:00
Ted Kremenek 0654d156b0 Add Profile method to QualType.
llvm-svn: 52735
2008-06-25 17:24:26 +00:00
Ted Kremenek c5d1e443ed Update VS project files.
llvm-svn: 52732
2008-06-25 17:14:52 +00:00
Ted Kremenek c9d1f45210 Update Xcode project.
llvm-svn: 52720
2008-06-25 15:15:35 +00:00
Argyrios Kyrtzidis 8a73d1f327 The assert at Sema::ObjCActOnStartOfMethodDef should check CurMethodDecl instead of CurFunctionDecl.
llvm-svn: 52719
2008-06-25 14:24:09 +00:00
Argyrios Kyrtzidis 90ba8b6de2 Set CXXClassVar to identifier namespace IDNS_Ordinary.
llvm-svn: 52718
2008-06-25 14:04:17 +00:00
Mon P Wang 28898b2888 Updated atomic intrinsic name from llvm r52706. Fixed dropped bit in shufps.
llvm-svn: 52707
2008-06-25 08:21:36 +00:00
Argyrios Kyrtzidis ac1b916441 'Educate' IdentifierResolver about the declaration context of CXXFieldDecls.
llvm-svn: 52698
2008-06-24 23:08:34 +00:00
Argyrios Kyrtzidis 1492538fd1 Set CXXMethod to identifier namespace IDNS_Ordinary.
llvm-svn: 52697
2008-06-24 22:56:42 +00:00
Argyrios Kyrtzidis a781452193 The only caller of this knows that the current token is l_brace, so this can be an assert; suggestion by Chris.
llvm-svn: 52696
2008-06-24 22:31:41 +00:00
Argyrios Kyrtzidis 7bbb20e338 Add parsing support for C++ classes.
Note that Parser::ParseCXXMemberSpecification is temporarily disabled until the Sema support is in place.
Once ParseCXXMemberSpecification is enabled, the Parser/cxx-class.cpp test will pass.

llvm-svn: 52694
2008-06-24 22:12:16 +00:00
Chris Lattner b1d329da07 "Support for Objective-C message sends which return structures. Also includes a small fix for constant string handling that should have been in the last patch (sorry!) and a hook for generating selectors (rest of this implementation to follow in the next patch)."
Patch by David Chisnall!

llvm-svn: 52681
2008-06-24 17:04:18 +00:00
Chris Lattner 6447ed3a1f "This is a small fix for a bug where static object instances were being incorrectly generated. The bug was caused by my inability to read the GNU libobjc source and is only apparent when JITing code (static compilation does not expose the bug due to the data layout of other globals)."
Patch by David Chisnall!

llvm-svn: 52680
2008-06-24 17:01:28 +00:00
Ted Kremenek 17ae57faa8 Update serialization for ObjCMessageExpr to handle additional bit-swizziling of receiver information.
llvm-svn: 52679
2008-06-24 17:00:08 +00:00
Ted Kremenek a3a37ae8c8 ObjCMessageExpr objects that represent messages to class methods now can contain the ObjCInterfaceDecl* of the target class if it was available when the ObjCMessageExpr object was constructed. The original interfaces of the class has been preserved (requiring no functionality changes from clients), but now a "getClasSInfo" method returns both the ObjCInterfaceDecl* and IdentifierInfo* of the target class.
llvm-svn: 52676
2008-06-24 15:50:53 +00:00
Argyrios Kyrtzidis f159b71bdf Move the namespace action declarations at the "C++ declarations" section.
llvm-svn: 52673
2008-06-24 11:23:36 +00:00
Cedric Venet 4bcc95de9b Test commit: changed the forward declaration of FieldDeclarator from class to struct to be coherent with its definition (DeclSpec.h)
llvm-svn: 52671
2008-06-24 09:09:38 +00:00
Ted Kremenek f8e0bbd6ad Fix comments: "class method" should be "instance method" and vis versa
llvm-svn: 52669
2008-06-24 04:44:10 +00:00
Ted Kremenek f890bfe0ff Remove unneeded method arguments.
llvm-svn: 52668
2008-06-24 03:56:45 +00:00
Ted Kremenek b1d1329ac7 Cache ObjC summaries by IdentifierInfo*, not by ObjCInterfaceDecl.
llvm-svn: 52667
2008-06-24 03:49:48 +00:00
Ted Kremenek 675a6e6dfa Patch by Anders Bergh:
'There's not much to say about this patch, it just adds the Arch Linux
gcc 4.3.1 header paths for i686 and amd64. The patch was generated
using "svn diff" with clang at revision 52660. The paths aren't
distribution-specific, so they should work for all Linux distributions
using the default(?) names like "i686-pc-linux-gnu".'

llvm-svn: 52665
2008-06-24 03:33:47 +00:00
Ted Kremenek 0cfc16100b Added ObjCSummaryCache, a new summary cache object to cache summaries for Objective-C methods. Instead of mapping from Selectors -> Summaries, we will now map from (ObjCInterfaceDecl*,Selectors) -> Summaries. This will allow more nuanced summary generation. This patch just swaps in the new data structure; the rest of the code works as before by allowing the ObjCInterfaceDecl* to be null.
llvm-svn: 52653
2008-06-23 23:30:29 +00:00
Ted Kremenek ea736c5d02 Rename summary methods for "instance methods" to "class methods" (the names got screwed up). No functionality change.
llvm-svn: 52650
2008-06-23 22:21:20 +00:00
Ted Kremenek 4c9e587db0 Updated latest checker build to checker-44.
llvm-svn: 52635
2008-06-23 18:32:25 +00:00
Ted Kremenek ab4a8b5213 The CF retain/release checker now assumes that allocations do not fail. Eventually we will add a flag to the driver to enable allocation failures (documented as a FIXME).
llvm-svn: 52632
2008-06-23 18:02:52 +00:00
Ted Kremenek 75c93eed9a Update VS project files. Patch by Cedric Venet!
llvm-svn: 52625
2008-06-23 16:18:59 +00:00
Chris Lattner 8a6274d745 add a new clang::APValue class at Eli's request. It is a discriminated
union between [potentially complex] APInt/APFloat.

llvm-svn: 52609
2008-06-22 05:45:53 +00:00
Chris Lattner 7fa2758b45 add a fixme back
llvm-svn: 52607
2008-06-21 22:44:51 +00:00
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
Argyrios Kyrtzidis d0c1df4c84 Make CodeGenFunction::EmitDecl() recognise CXXClass/CXXStruct/CXXUnion.
llvm-svn: 52162
2008-06-09 23:42:47 +00:00
Argyrios Kyrtzidis d8cb25ee90 Dump the name of CXXStruct/CXXUnion/CXXClass Decl subclasses.
llvm-svn: 52161
2008-06-09 23:36:53 +00:00
Argyrios Kyrtzidis 554a07bab3 -Changes to TagDecl:
Added TagKind enum.
  Added getTagKind() method.
  Added convenience methods: isEnum(), isStruct(), isUnion(), isClass().
-RecordDecl/CXXRecordDecl::Create() accept a TagKind enum instead of a DeclKind one.

llvm-svn: 52160
2008-06-09 23:19:58 +00:00
Argyrios Kyrtzidis 2951e14520 Added new C++ AST Decl subclasses.
llvm-svn: 52155
2008-06-09 21:05:31 +00:00
Eli Friedman 8233993fc6 Get -serialize working again, plus a bit of minor cleanup.
llvm-svn: 52152
2008-06-09 20:02:51 +00:00
Ted Kremenek 401ef2e426 Added link to Mac OS X builds. Provide instructions for those not using Mac OS X.
llvm-svn: 52148
2008-06-09 14:30:01 +00:00
Matthijs Kooijman 9c995757a9 Sprinkle some "-o -" clang options to make the examples work.
llvm-svn: 52145
2008-06-09 14:09:10 +00:00
Ted Kremenek 420f7e76c7 Add redirection page.
llvm-svn: 52143
2008-06-09 13:38:32 +00:00
Sanjiv Gupta 224e8ea2bb Generate debug descriptors for array types while generating the debug info.
llvm-svn: 52140
2008-06-09 10:47:41 +00:00
Eli Friedman e6e0f23a29 Add code to make test/CodeGen/struct-init.c work correctly without the
pointer cast hack currently in isIntegerConstantExpr 
(in lib/AST/Expr.cpp).  Also removes an odd test that even gcc doesn't accept.

The reason the pointer cast hack is relevant here is that it makes Sema 
end up misinterpreting the relevant expression as a null pointer constant.

The reason for this patch is that I plan to remove the pointer cast hack 
sometime soon because it causes strange issues, especially in its 
current form; see my recent email to cfe-dev
"[PATCH] add constant expression evaluation to the AST and fix PR2413".

llvm-svn: 52120
2008-06-09 05:05:07 +00:00
Eli Friedman 7567573926 For struct initialization, check compatibility with the unqualified
type; this isn't explicitly stated in the standard, but it doesn't 
really make sense for them to have an effect here.  Fixes the included 
testcase, sent to me by Steve Naroff.

llvm-svn: 52113
2008-06-09 03:52:40 +00:00
Chris Lattner e642fcd689 Since this isn't linked from anywhere yet, I'm taking the opportunity
to move it to a more stable URL.  If the S-A work grows, this will be
the entrypoint for the pages related to it.

llvm-svn: 52101
2008-06-08 21:55:32 +00:00
Nuno Lopes b6f7953818 implement the alias attirbute (in both Sema and Codegen)
llvm-svn: 52092
2008-06-08 15:45:52 +00:00
Nuno Lopes cc041ea68e fix compiler warnings
llvm-svn: 52089
2008-06-08 10:16:34 +00:00
Eli Friedman c98a7add43 Don't crash emitting an initializer for a static local with union type.
This fix just makes sure to construct the global with the appropriate 
type, and fixes up the one user this affects to compensate.

llvm-svn: 52084
2008-06-08 01:23:18 +00:00
Eli Friedman 69d721e071 Enable the rewriter tests on all platforms; there don't appear to
be any regressions from this on my machine, but please let me know if 
you run into issues.  (The idea here is that it's better to run all 
tests on all platforms if at all possible.)

llvm-svn: 52083
2008-06-07 23:20:33 +00:00
Eli Friedman 7e4f41ef3f Don't include objc.h, so the rewriter tests work on machines without it.
llvm-svn: 52082
2008-06-07 23:15:03 +00:00
Chris Lattner a5678ccd4a capture whether a CharacterLiteral was wide or not in the AST.
Patch by Mike Stump!

llvm-svn: 52081
2008-06-07 22:35:38 +00:00
Chris Lattner a0173131fa Fix ast dumping to work with long double literals, e.g. we dump:
long double X() { return 1.0L; }

as:

long double X()
(CompoundStmt 0xb06a00 <t.c:2:17, col:32>
  (ReturnStmt 0xb068d0 <col:19, col:26>
    (FloatingLiteral 0xb02cf0 <col:26> 'long double' 1.000000)))

llvm-svn: 52080
2008-06-07 22:13:43 +00:00
Chris Lattner 82333ccf39 Mark the right ctor explicit, patch by Cédric Venet
llvm-svn: 52078
2008-06-07 19:56:57 +00:00
Eli Friedman 3ce7b20590 Fix crash with conversion to an address-space-qualified pointer. Bug
reported on cfe-dev by Cédric Venet.

Note that I seriously doubt that this perticular construct is useful, 
though: it's a pointer in an alternate address space pointing into 
unqualified address space.

llvm-svn: 52076
2008-06-07 17:27:51 +00:00
Eli Friedman 7dbab8a6a1 Fix the line endings in the newly added DeclBase.cpp.
llvm-svn: 52075
2008-06-07 16:52:53 +00:00
Eli Friedman 445c73d19f Fix Visual Studio project files; patch by Cédric Venet.
llvm-svn: 52074
2008-06-07 16:34:27 +00:00
Sanjiv Gupta 1929242a94 Create debug type descriptors for aggregate/enum types.
llvm-svn: 52070
2008-06-07 04:46:53 +00:00
Ted Kremenek 92611db88f Use a common SourceManager when processing multiple files. This allows us to cache the contents of source files already loaded from disk.
llvm-svn: 52066
2008-06-06 22:42:39 +00:00
Ted Kremenek af44b83296 Updated Xcode project.
llvm-svn: 52065
2008-06-06 21:48:51 +00:00
Ted Kremenek ef17049bac Reclaim memory owned by ObjCForwardProtocolDecls.
llvm-svn: 52063
2008-06-06 21:05:33 +00:00
Eli Friedman fd1e32b1f3 Reorganize this loop a bit so it doesn't crash for empty unions. Fixes
PR2419.

llvm-svn: 52060
2008-06-06 20:12:37 +00:00
Ted Kremenek 71fff8b4de Implement "Destroy" and destructor for ObjCClassDecl, allowing us to reclaim its memory and the memory of the Decls it owns.
llvm-svn: 52059
2008-06-06 20:11:53 +00:00
Ted Kremenek 2e34af659a Implement "Destroy" and destructor for ObjCProtocolDecl, allowing us to reclaim its memory and the memory of the Decls it owns.
llvm-svn: 52055
2008-06-06 19:48:57 +00:00
Eli Friedman 01321c3b8c Clean up dead code from SemaInit landing.
llvm-svn: 52054
2008-06-06 19:40:52 +00:00
Ted Kremenek 5144fe2287 Because of a lack of a clear ownership role between ObjCInterfaceDecls and
ObjCPropertyDecls, have TranslationUnit destroy ObjCPropertyDecls. This is a
horrible hack, and must be removed eventually.

llvm-svn: 52051
2008-06-06 17:21:42 +00:00
Ted Kremenek 09a0d04ea0 Initial work on additional memory collection for ObjC AST objects. We now
have Destroy methods of ObjcMethodDecl and ObjCInterfaceDecl which recursively
destroy their owned Decls and Stmts.  There are a few cases where it is not
clear what to do (FIXMEs included in the patch).

llvm-svn: 52050
2008-06-06 16:45:15 +00:00
Nuno Lopes 9b07b7b099 implement constant expr. sub ptr ptr
llvm-svn: 52049
2008-06-06 16:41:08 +00:00
Devang Patel 8f5645cd51 During interface layout, don't forget super class.
llvm-svn: 52035
2008-06-06 02:14:01 +00:00
Devang Patel e1f10511ba Undo previous check-in.
llvm-svn: 52034
2008-06-06 02:00:35 +00:00
Devang Patel 1216b05d3d During interface layout, don't forget super class.
llvm-svn: 52033
2008-06-06 01:50:12 +00:00