Commit Graph

3405 Commits

Author SHA1 Message Date
Ted Kremenek 94acc6ac9a Cleaned up comment.
llvm-svn: 45969
2008-01-14 18:41:42 +00:00
Ted Kremenek a018a2c0f4 When serializing CompoundLiteralExpr, serialize out the file scope flag before
serializing the subexpression (Init), as this results in a more efficient
encoding in the bitstream.

llvm-svn: 45967
2008-01-14 18:29:39 +00:00
Steve Naroff d32419de0d Record if a compound literal expression is @ file scope. This allows us to implement C99 6.5.2.5p6. This could have been done without modifying the AST (by checking the decl type and passing the info down to isContextExpr), however we concluded this is more desirable.
Bug/patch by Eli Friedman!

llvm-svn: 45966
2008-01-14 18:19:28 +00:00
Ted Kremenek d065a790d9 Removed 'inline' keywords from methods now defined in ExplodedGraph.cpp.
llvm-svn: 45965
2008-01-14 18:11:35 +00:00
Ted Kremenek a0a3e9bb07 Change uses of std::cerr/std::cout to llvm::Lcerr/llvm::cout, and remove
#include<iostream>.

Patch provided by Sam Bishop.

llvm-svn: 45962
2008-01-14 16:44:48 +00:00
Steve Naroff 4871fe0b8f Revert r45951, Chris says it violates the C99 spec.
llvm-svn: 45961
2008-01-14 16:10:57 +00:00
Anders Carlsson a1afcab6f9 _asm is another valid alias for asm.
llvm-svn: 45957
2008-01-14 07:46:40 +00:00
Anders Carlsson 1ba25ca171 Add codegen upport for implicit casts to aggregate exprs.
llvm-svn: 45954
2008-01-14 06:28:57 +00:00
Chris Lattner f14ba63620 add a note
llvm-svn: 45953
2008-01-14 06:27:57 +00:00
Chris Lattner fd65291aa3 Fix ASTContext::typesAreCompatible when analyzing a function type with
proto and function type without proto.  It would never call 
'functionTypesAreCompatible' because they have different type classes.

llvm-svn: 45952
2008-01-14 05:45:46 +00:00
Steve Naroff 090353191c Rewrite Expr::isNullPointerConstant() to deal with multiple levels of explicit casts.
Now, isNullPointerConstant() will return true for the following: "(void*)(double*)0"

llvm-svn: 45951
2008-01-14 02:53:34 +00:00
Steve Naroff 826e91ae04 Change Sema::CheckAddressOfOperation() to respect C99-only addressof rules.
Remove diagnostics from Sema::CheckIndirectionOperand(). C89/C99 allow dereferencing an incomplete type. clang appears to be emulating some incorrect gcc behavior (see below).

void
foo (void)
{
 struct b;
 struct b* x = 0;
 struct b* y = &*x; // gcc produces an error ("dereferencing pointer to incomplete type")
}

With this patch, the above is now allowed.

Bug/Patch by Eli Friedman!

llvm-svn: 45933
2008-01-13 17:10:08 +00:00
Ted Kremenek d122bbdb06 Moved destructor logic of templated class ExplodedGraph to non-templated
parent class ExplodedGraphImpl.

llvm-svn: 45930
2008-01-13 05:33:04 +00:00
Ted Kremenek 6d7aee6edd Added node cleanup to dstor of ExplodedGraph.
llvm-svn: 45929
2008-01-13 05:03:01 +00:00
Ted Kremenek eb370bc386 Created ExplodedGraph.cpp and moved most method implementations of
ExplodedNodeImpl::NodeGroup from being defined inline to being defined
"out-of-line" in ExplodedGraph.cpp. This removes a dependence on including
<vector> in ExplodedGraph.h, and will hopefully result in smaller generated code
with negligible performance impact.

llvm-svn: 45928
2008-01-13 04:56:13 +00:00
Ted Kremenek 49bbee0b1d Moved 'ExplodedNodeGroup' into class 'ExplodedNode' as the nested class
'NodeGroup.'

llvm-svn: 45927
2008-01-13 04:20:10 +00:00
Ted Kremenek 39dfeadd93 Fixed lines preventing compilation.
llvm-svn: 45926
2008-01-13 04:18:40 +00:00
Ted Kremenek 2ae51a5d27 Now include "CFG.h" because the inline methods of "BlockEntrance" accessor
the methods of CFGBlock.

llvm-svn: 45925
2008-01-13 04:08:45 +00:00
Ted Kremenek 990d7d5205 Fixed some comments.
llvm-svn: 45924
2008-01-13 04:03:38 +00:00
Ted Kremenek 76245f3ed0 Removed ExplodedNode.h, since its contents are now in ExplodedGraph.h
llvm-svn: 45923
2008-01-13 04:00:44 +00:00
Ted Kremenek 8f13ec74c4 Merged ExplodedNode.h into ExplodedGraph.h, since the ExplodedNode class will
only be used in the context of the ExplodedGraph class.

llvm-svn: 45922
2008-01-13 04:00:16 +00:00
Ted Kremenek cfe8235fa1 Changed implementation of successor and predecessor sets for ExplodedNode
to optimize for the common case of having a single predecessor and a single
successor.

llvm-svn: 45921
2008-01-13 03:55:50 +00:00
Chris Lattner 0a8c2325fc allow __func__ in objc methods.
llvm-svn: 45915
2008-01-12 19:32:28 +00:00
Chris Lattner 317e6ba07f Tighten up handling of __func__ and friends: it should be an array
of const char, and it should error if it occurs outside a function.

Is it valid in an objc method?  If so we should handle that too.

llvm-svn: 45910
2008-01-12 18:39:25 +00:00
Chris Lattner a81a0279cc Fix the type of predefined identifiers like __func__. Patch by
Eli Friedman!

llvm-svn: 45906
2008-01-12 08:14:25 +00:00
Chris Lattner 65531e8fb7 Fix a fixme, by only parsing extern "C" in C++ mode.
llvm-svn: 45905
2008-01-12 07:08:43 +00:00
Chris Lattner 38376f1595 Add first pieces of support for parsing and representing
extern "C" in C++ mode.  Patch by Mike Stump!

llvm-svn: 45904
2008-01-12 07:05:38 +00:00
Chris Lattner 177977ac19 When forming the squigly underline for a diagnostic, make sure to
verify that the source range corresponds to the current file, not
just the current line.  This allows us to emit:

a.c:1:44: error: invalid operands to binary expression ('double' and 'int *')
double a; int *b; void f(void) { int c = a +
                                         ~ ^

instead of:

a.c:1:44: error: invalid operands to binary expression ('double' and 'int *')
double a; int *b; void f(void) { int c = a +
~                                        ~ ^

for PR1906 (note the leading ~).

Thanks to Neil for noticing this.

llvm-svn: 45901
2008-01-12 06:43:35 +00:00
Ted Kremenek 8d71e25590 Fix misspelling of "existent".
Do not use std::cerr; use llvm::cerr instead.

Patch provided by Sam Bishop!

llvm-svn: 45880
2008-01-11 20:42:05 +00:00
Ted Kremenek 5906b9e79a Added ProgramPoint.cpp, which implements several methods of the subclasses
of ProgramPoint.

llvm-svn: 45866
2008-01-11 16:36:20 +00:00
Ted Kremenek b1dec454bb Renamed ProgramEdge.h to ProgramPoint.h
llvm-svn: 45847
2008-01-11 00:43:12 +00:00
Ted Kremenek e5ccf9a96c Renamed ProgramEdge to ProgramPoint and changed subclasses of ProgramEdge
to have a much simpler, cleaner interpretation of what is a "location"
in a function (as encoded by a CFG).

llvm-svn: 45846
2008-01-11 00:40:29 +00:00
Ted Kremenek d7a7abed62 Fixed 80-col violation.
llvm-svn: 45845
2008-01-11 00:18:40 +00:00
Fariborz Jahanian af5d80cba5 Avoid redefinition of __objcFastEnumerationState
llvm-svn: 45842
2008-01-10 23:04:06 +00:00
Steve Naroff 98f7203680 - Teach Expr::isConstantExpr() about InitListExpr's (and offsetof, since I noticed it was missing).
- Rename CheckInitializer() to CheckInitializerTypes().
- Removed the isStatic argument to CheckInitializerTypes() and all of it's subroutines. Checking for constant expressions is now done separately.
- Added CheckForConstantInitializer().

llvm-svn: 45840
2008-01-10 22:15:12 +00:00
Fariborz Jahanian 939776756f Recover from user typo not having proper @interface decl and a bad foreach decl.
llvm-svn: 45839
2008-01-10 20:33:58 +00:00
Fariborz Jahanian 2de9a0be09 Remove non-ascii chaaracter from diagnostic
llvm-svn: 45836
2008-01-10 18:10:31 +00:00
Ted Kremenek e67952fcd9 Fixed non-ASCII quote.
llvm-svn: 45835
2008-01-10 18:08:55 +00:00
Fariborz Jahanian c644ee4992 Warn (as gcc does) when @end does not close anything.
llvm-svn: 45834
2008-01-10 17:58:07 +00:00
Ted Kremenek aa8c904dfc Added some text about the ccc script provided by Sanghyeon Seo.
llvm-svn: 45820
2008-01-10 04:59:05 +00:00
Chris Lattner 2cbf2f39ee add support for the GCC -include option.
llvm-svn: 45810
2008-01-10 01:53:41 +00:00
Seo Sanghyeon 77133e6d30 Compiler driver
llvm-svn: 45809
2008-01-10 01:43:47 +00:00
Chris Lattner bceeefdc9c Fix some 80 col violations
llvm-svn: 45808
2008-01-10 01:43:14 +00:00
Chris Lattner d2cdb97747 Ted apparently likes crazy whitespace at the end of line. Crush his spirit by
removing them, fitting the file into 80 columns. :)

llvm-svn: 45807
2008-01-10 01:41:55 +00:00
Fariborz Jahanian 7262fca0a6 Put return type of synthesize method on same line as method declaration, space after method declaration header.
llvm-svn: 45806
2008-01-10 01:39:52 +00:00
Ted Kremenek 3d55c84c99 Added "InfeasibleEdge" to represent an infeasible state transition.
llvm-svn: 45802
2008-01-10 00:58:25 +00:00
Fariborz Jahanian db701b47d2 Pass rewritten output to 'clang' for verification.
llvm-svn: 45794
2008-01-10 00:30:24 +00:00
Fariborz Jahanian 82ae0152a7 Allow messaging expression as foreach's collection expression.
llvm-svn: 45793
2008-01-10 00:24:29 +00:00
Steve Naroff a385fb8c2e Add a FIXME to commit r45784. Thanks mrs!
llvm-svn: 45790
2008-01-09 23:44:05 +00:00
Steve Naroff e6b0ec8b5e Fix Sema::ActOnDeclarator() to call MergeFunctionDecl for function decls that aren't in scope. Since C functions are in a flat namespace, we need to give them special treatment (when compared with variables and typedefs).
llvm-svn: 45789
2008-01-09 23:34:55 +00:00
Ted Kremenek 24ea11d4e0 Renamed various traits and classes. Added "Infeasible" bit to ExplodedNodeImpl
so that nodes can be marked as representing an infeasible program point. This
flag lets the path-sensitive solver know that no successors should be generated
for such nodes.

llvm-svn: 45788
2008-01-09 23:11:36 +00:00
Ted Kremenek 84ab850e46 Renamed Stmt***Edge and ***StmtEdge (where *** = "Stmt" or "Blk") classes to
BExpr*** and ***BExpr respectively. These edges represent program locations
between the entrance/exit of a block and Block-level Expressions.

Also added ***SExpr and SExpr*** ProgramEdges to represent the locations in the
program between the evaluation of subexpressions and block-level expressions.

llvm-svn: 45786
2008-01-09 22:52:38 +00:00
Ted Kremenek fed4cce0cc Removed some files related to the path-sensitive solver as part of some
code restructuring.  (new files will be introduced shortly)

llvm-svn: 45785
2008-01-09 22:49:37 +00:00
Steve Naroff c6edcbdb5d Fix ASTContext::typesAreCompatible to allow for int/enum compatibility (C99 6.7.2.2p4).
Fix Sema::MergeFunctionDecl to allow for function type compatibility (by using the predicate on ASTContext). Function types don't have to be identical to be compatible...

llvm-svn: 45784
2008-01-09 22:43:08 +00:00
Steve Naroff 08ddb8c55c Teach Sema::ActOnCompoundLiteral about constraint C99 6.5.2.5p3.
llvm-svn: 45782
2008-01-09 20:58:06 +00:00
Chris Lattner 119d81a4f4 Fix isIntegerConstantExpr to compare against zero for casts to bool instead of
truncating.  This allows us to compile:
 void foo() {
  static _Bool foo = 4;
}

into:
@foo1 = internal global i8 1
instead of:
@foo1 = internal global i8 4

llvm-svn: 45779
2008-01-09 18:59:34 +00:00
Chris Lattner 41a1ef0dfe implement proper support for _Bool in memory, which is usually i8, not i1.
This fixes a crash reported by Seo Sanghyeon

llvm-svn: 45778
2008-01-09 18:47:25 +00:00
Fariborz Jahanian 6fa7516bc9 Type-cast RHS of assignment to prevent warning compiling rewritten foreach code.
llvm-svn: 45777
2008-01-09 18:15:42 +00:00
Fariborz Jahanian 22f2347791 Fixed a bug whereby a parethesized collection expression was not being rewritten correctly.
llvm-svn: 45776
2008-01-09 17:50:00 +00:00
Fariborz Jahanian b7e7ee9ff3 Typo fixed.
llvm-svn: 45771
2008-01-09 01:25:54 +00:00
Fariborz Jahanian 05d2876ec3 Another test case for testing rewriteing of nested foreach-statement.
llvm-svn: 45769
2008-01-09 00:47:02 +00:00
Fariborz Jahanian a305a5609e Remove dependency on objc.h
llvm-svn: 45767
2008-01-09 00:33:05 +00:00
Steve Naroff 66a26044f8 Teach Expr::isConstantExpr() about CompoundLiterals.
llvm-svn: 45764
2008-01-09 00:05:37 +00:00
Chris Lattner 82bebb2432 Fix a typo, patch by Mike Stump!
llvm-svn: 45763
2008-01-09 00:00:15 +00:00
Fariborz Jahanian 965a8961c7 Patch to rewrite ObjC2's foreach-stmt.
llvm-svn: 45760
2008-01-08 22:06:28 +00:00
Ted Kremenek 96b1ce4f0a Added VISIBILITY_HIDDEN to classes/structs in anonymous namespaces.
llvm-svn: 45750
2008-01-08 18:19:08 +00:00
Ted Kremenek 83ebcef8ae Added VISIBILITY_HIDDEN to classes/structs in anonymous namespace.
llvm-svn: 45749
2008-01-08 18:15:10 +00:00
Ted Kremenek 7e41c29a86 Added most of the boilerplate to the driver needed to run the graph-reachability
constant propagation analysis.

llvm-svn: 45747
2008-01-08 18:04:06 +00:00
Chris Lattner e3e358c317 readability improvement suggested by Sam Bishop, thanks!
llvm-svn: 45735
2008-01-08 04:13:21 +00:00
Steve Naroff 039ad3cf90 Fix Sema::CheckConditionalOperands(). The null pointer constant checks need to precede the check for two pointer operands.
llvm-svn: 45732
2008-01-08 01:11:38 +00:00
Ted Kremenek 9384343c11 Added nodes_iterator to the GraphTrait for ExplodedNode<>.
llvm-svn: 45730
2008-01-08 00:46:00 +00:00
Ted Kremenek a3da232ce7 Added GraphTraits<> partial specializations for ExplodedNode<> classes.
llvm-svn: 45729
2008-01-08 00:26:05 +00:00
Ted Kremenek 551e4ce74e Relocated comment in header.
llvm-svn: 45728
2008-01-08 00:07:06 +00:00
Ted Kremenek 35ff5b0ee6 Added more boilerplate for processing end-of-paths.
llvm-svn: 45724
2008-01-07 22:22:13 +00:00
Ted Kremenek 8569309bca Added ownership of "checker state" within the ExplodedGraph. Moved code that
creates the initial root node from the constructor of ReachabilityEngine to
ReachabilityEngine::ExecuteWorklist.

llvm-svn: 45722
2008-01-07 21:56:52 +00:00
Fariborz Jahanian dc917b9e07 Patch to start rewriting of ObjC2's foreach statement (work in progress).
llvm-svn: 45721
2008-01-07 21:40:22 +00:00
Fariborz Jahanian 6917870be5 Verify/add code to make sure types passed to interfaceTypesAreCompatible
are canonical. Asst in interfaceTypesAreCompatible if they are not.

llvm-svn: 45717
2008-01-07 20:12:21 +00:00
Chris Lattner a30be59fa2 Fix a nasty corner case that Neil noticed in PR1900, where we would
incorrectly apply the multiple include optimization to files with 
guards like:

#if !defined(x) MACRO

where MACRO could expand to different things in different contexts.
Thanks Neil!

llvm-svn: 45716
2008-01-07 19:50:27 +00:00
Ted Kremenek 1b0ea82459 Substituted all instances of the string "Objc" for "ObjC". This fixes
some naming inconsistencies in the names of classes pertaining to Objective-C
support in clang.

llvm-svn: 45715
2008-01-07 19:49:32 +00:00
Fariborz Jahanian 699e638e4f Make interfaceTypesAreCompatible a private method.
llvm-svn: 45713
2008-01-07 19:13:39 +00:00
Ted Kremenek 9dbf8a93a7 Renamed SimulVertex, SimulGraph, and SimulEngine to:
ExplodedNode, ExplodedGraph  (to match the vocabulary in the RHS paper)
  ReachabilityEngine
  
The implementation of the core of the path-sensitive dataflow solver has
been de-templatized and places in ReachabilityEngine.cpp.

The solver is still incomplete.

llvm-svn: 45711
2008-01-07 19:08:42 +00:00
Ted Kremenek dabea046f6 Minor tweak to serialization of ObjcForCollectionStmt: the three owned pointers
are now emitted in a batch, which reduces the metadata overhead in the
serialized bitcode.

llvm-svn: 45710
2008-01-07 18:35:04 +00:00
Fariborz Jahanian d5450b7f07 Limit type of foreach's element and collection to be a pointer to
objc object type.

llvm-svn: 45709
2008-01-07 18:14:04 +00:00
Fariborz Jahanian fef287cb67 Issue diagnostics if more than one declaration in objectove-c's foreach-stmt header.
llvm-svn: 45708
2008-01-07 17:52:35 +00:00
Chris Lattner f5c973d061 minor cleanup.
llvm-svn: 45706
2008-01-07 17:51:46 +00:00
Nate Begeman f7c3ff6f80 Fix typo
llvm-svn: 45682
2008-01-07 04:01:26 +00:00
Chris Lattner 4d3b0f579c rearrange some code.
llvm-svn: 45666
2008-01-06 22:50:31 +00:00
Chris Lattner e2949f42d3 some simplifications/cleanups to ?: sema.
llvm-svn: 45665
2008-01-06 22:42:25 +00:00
Chris Lattner cfb6f430b6 Emit warnings like "dereferencing void pointer" instead of trying to
pretty print the type name for void.

llvm-svn: 45664
2008-01-06 22:21:46 +00:00
Fariborz Jahanian 7b1b947ca1 twiks based on Chris's comment. No need to iterate thru a list of declarations
in a foreach-statement which is illegal (but not yet caught) .

llvm-svn: 45615
2008-01-05 01:40:08 +00:00
Ted Kremenek e84b32e506 Moved serialization code for ObjcForCollectionStmt to be in alphabetical order
with the rest of the Objective-C serialization code.

llvm-svn: 45609
2008-01-05 00:57:49 +00:00
Fariborz Jahanian bad3218954 Minor refactoring of foreach's semantics code per Chris's suggetion.
llvm-svn: 45604
2008-01-04 23:59:09 +00:00
Chris Lattner 881a212a70 unnest vector handling again.
llvm-svn: 45602
2008-01-04 23:32:24 +00:00
Fariborz Jahanian e908cab389 Added a comment, minor refactoring of foreach parsing code per Chris's suggestion.
llvm-svn: 45601
2008-01-04 23:23:46 +00:00
Chris Lattner f735409e11 we already test for exact type matches early, so we don't have to do
it explicitly for vectors.  This allows us to unnest some code.

llvm-svn: 45600
2008-01-04 23:20:56 +00:00
Chris Lattner a52c2f2e3e simplify some of this code by removing the else/if chain and by
stripping down to canonical types early.

llvm-svn: 45599
2008-01-04 23:18:45 +00:00
Fariborz Jahanian 3622e5954b Minor changes as suggested by Chris L.
llvm-svn: 45598
2008-01-04 23:04:08 +00:00
Chris Lattner a3fc41d616 move objc expr sema to its own file.
llvm-svn: 45597
2008-01-04 22:32:30 +00:00
Chris Lattner 4899a6aa6a Fix PR1897, patch by Wilhansen Li
llvm-svn: 45593
2008-01-04 19:12:28 +00:00
Chris Lattner 940cfebf90 add comments for the various AssignConvertType's, and split int->pointer from pointer->int.
llvm-svn: 45591
2008-01-04 18:22:42 +00:00
Chris Lattner 9bad62c72a Merge all the 'assignment' diagnostic code into one routine, decloning
it from several places.  This merges the diagnostics, making them more
uniform and fewer in number. This also simplifies and cleans up the code.

Some highlights:
1. This removes a bunch of very-similar diagnostics.
2. This renames AssignmentCheckResult -> AssignConvertType
3. This merges PointerFromInt + IntFromPointer which were always treated the same.
4. This updates a bunch of test cases that have minor changes to the produced diagnostics.

llvm-svn: 45589
2008-01-04 18:04:52 +00:00
Chris Lattner 94cf8061e7 fix a build problem where NULL isn't implicitly defined by the headers this file includes.
llvm-svn: 45587
2008-01-04 16:27:03 +00:00
Fariborz Jahanian 775d5d02af Patch to add semantics check for ObjC2's foreacn statement.
llvm-svn: 45561
2008-01-04 00:27:46 +00:00
Chris Lattner 816dea2fc5 generalize some of the conversion warnings.
llvm-svn: 45560
2008-01-03 23:38:43 +00:00
Chris Lattner 166ae81be1 update for changes in diagnostic strings.
llvm-svn: 45559
2008-01-03 23:36:08 +00:00
Chris Lattner 874e024f10 regroup assignment-related diagnostics, fix a mistake in one.
llvm-svn: 45558
2008-01-03 23:13:36 +00:00
Chris Lattner 0a788433eb give better diagnostics for converting between function pointer and void*.
llvm-svn: 45556
2008-01-03 22:56:36 +00:00
Ted Kremenek 739d350369 renamed class "GRCP" (Graph Reachabilty Constant Propagation) to
"GREngine" (Graph Reachability Engine).  The idea is to provide a separation
of concerns between the constant prop. details and the core analysis engine.

llvm-svn: 45555
2008-01-03 22:46:25 +00:00
Ted Kremenek 7c54e520e7 Implemented End-Of-Path processing.
llvm-svn: 45554
2008-01-03 22:29:38 +00:00
Ted Kremenek 0044908de0 Initial checking of GRConstantPropagation.cpp, which implements a constant
propagation analysis via graph reachability. This analysis (which is incomplete)
will be the basis for later developments on the core engine for path-sensitive
analysis analysis.

llvm-svn: 45552
2008-01-03 22:12:28 +00:00
Ted Kremenek fde239df06 Fixed misuse of pointer within SimulVertex::addPredecessor()
llvm-svn: 45551
2008-01-03 22:09:27 +00:00
Ted Kremenek 9d375282cf SimulGraph::getVertex() now also returns a bool indicating if the returned
vertex was freshly created.

llvm-svn: 45550
2008-01-03 22:08:52 +00:00
Ted Kremenek 6abe02ada6 Constified methods front() and back() in CFGBlock.
llvm-svn: 45549
2008-01-03 22:07:58 +00:00
Ted Kremenek d6c30e58e2 De-constified the pointers returned by the Dst() and Src() methods of
the various ProgramEdge classes.

llvm-svn: 45548
2008-01-03 22:07:01 +00:00
Fariborz Jahanian c89ea091a2 Couple more uninitialized before use warning elimination.
llvm-svn: 45547
2008-01-03 20:04:58 +00:00
Fariborz Jahanian 243c611a05 Remove cause of misc. "variable might be used uninitialized in this function" warnings.
llvm-svn: 45546
2008-01-03 20:01:35 +00:00
Fariborz Jahanian 5cc21a7e02 Fixed a bug reported by Chris, involving assiging 0 to a qualified object type.
llvm-svn: 45542
2008-01-03 18:46:52 +00:00
Chris Lattner 2b15cf705b simplify the lexer a bit, pulling stuff out of the default case.
llvm-svn: 45540
2008-01-03 17:58:54 +00:00
Fariborz Jahanian 732b8c2dc5 Patch to parse/build AST ObjC2's foreach statement.
llvm-svn: 45539
2008-01-03 17:55:25 +00:00
Chris Lattner 1800c18ebd fix long lines.
llvm-svn: 45531
2008-01-03 07:05:49 +00:00
Chris Lattner 20455f204f Fix a crash reported by Seo Sanghyeon.
llvm-svn: 45530
2008-01-03 06:36:51 +00:00
Fariborz Jahanian 8361552af9 New declarations/defs for Objc2's foreach-statement. This is work in progress.
llvm-svn: 45511
2008-01-02 22:54:34 +00:00
Chris Lattner 4f20351142 When promoting array to pointer for argument, don't lose type qualifiers.
llvm-svn: 45510
2008-01-02 22:50:48 +00:00
Ted Kremenek 161807f8d1 SimulVertex: Inverted argument order when calling the Profile method of StateTy.
SimulGraph: Inverted argument order when calling the Profile method of VertexTy
  (plus minor cleanups)
llvm-svn: 45508
2008-01-02 22:20:20 +00:00
Chris Lattner 7977cca8e8 Fix PR1895: a crash on an ugly gcc extension.
llvm-svn: 45505
2008-01-02 21:54:09 +00:00
Chris Lattner 266a2ff3ac Compute the proper sourcerange for an CompoundLiteralExpr.
llvm-svn: 45504
2008-01-02 21:46:24 +00:00
Ted Kremenek c7523bcaaa Converted state reference within SimulVertex from StateTy* to StateTy.
This is more flexible.

llvm-svn: 45502
2008-01-02 21:31:13 +00:00
Chris Lattner 54bb810997 Refactor the decl printer, patch by Mike Stump!
llvm-svn: 45497
2008-01-02 21:04:16 +00:00
Fariborz Jahanian 056e3a4e90 Issue diagnostic when objective-c's @interface is preceeded by a type specifier.
llvm-svn: 45491
2008-01-02 19:17:38 +00:00
Ted Kremenek 796b64337b Added/fixed some comments.
llvm-svn: 45490
2008-01-02 18:31:49 +00:00
Fariborz Jahanian 5e57e1890d Prevent crash on incorrect objc messaging expression.
llvm-svn: 45489
2008-01-02 18:09:46 +00:00
Ted Kremenek dc8ebe5022 Sprinkled 'typename' and fixed a few typos and type declaration errors to
make these headers compile.

llvm-svn: 45488
2008-01-02 17:45:00 +00:00
Ted Kremenek 2290828271 Added fixme.
llvm-svn: 45487
2008-01-02 17:05:47 +00:00
Ted Kremenek 032cb4433e Allocate vertices using a BumpPtrAllocator.
llvm-svn: 45486
2008-01-02 17:00:32 +00:00
Nate Begeman 330aaa79e0 Allow implicit casts during arithmetic for OCUVector operations
Add codegen support and test for said casts.

llvm-svn: 45443
2007-12-30 02:59:45 +00:00
Nate Begeman 627daba0fd Allow splat casts for OCU vector assignments & add some comments.
llvm-svn: 45442
2007-12-30 01:45:55 +00:00
Nate Begeman 16a3a9d5f9 Rename stats to print-stats to avoid conflicting with llvm's
stats statistic when clang is built as a dylib.

llvm-svn: 45441
2007-12-30 01:38:50 +00:00
Nate Begeman 628028bd27 Allow codegen of vector fdiv
llvm-svn: 45440
2007-12-30 01:28:16 +00:00
Chris Lattner a77acbdcae implement codegen support for most unary operators when
initializing a global.  This handles important cases like:
float foo3 = -0.01f;

llvm-svn: 45427
2007-12-29 23:43:37 +00:00
Chris Lattner 7429581c33 remove attributions from .def files.
llvm-svn: 45413
2007-12-29 20:03:32 +00:00
Chris Lattner 5926c0ebfb remove attribution from makefiles.
llvm-svn: 45412
2007-12-29 20:02:25 +00:00
Chris Lattner 5b12ab8c93 Don't attribute in file headers anymore. See llvmdev for the
discussion of this change.

llvm-svn: 45410
2007-12-29 19:59:25 +00:00
Christopher Lamb c5fafa211a Fix OCUVector case in struct layout code.
llvm-svn: 45396
2007-12-29 05:10:55 +00:00
Christopher Lamb d91c3d4926 Enable CodeGen for member expressions based on call expressions returning aggregate types. This enables expressions like 'foo().member.submember'.
llvm-svn: 45395
2007-12-29 05:02:41 +00:00
Christopher Lamb fd9af54ad1 Make MemberExpr code safe w.r.t. address spaces.
llvm-svn: 45394
2007-12-29 04:06:57 +00:00
Christopher Lamb ad66035921 Fix an error in the base/idx accessors for ArraySubscriptExpr's that crops up with vector element access.
llvm-svn: 45390
2007-12-28 23:43:03 +00:00
Chris Lattner 7ef31d3c53 various cleanups. Use IgnoreParenCasts instead of inlined versions.
llvm-svn: 45382
2007-12-28 05:38:24 +00:00
Chris Lattner 934edb210a unindent cases in a switch stmt, no functionality change.
llvm-svn: 45381
2007-12-28 05:31:15 +00:00
Chris Lattner 0846494750 Change Sema::ActOnCallExpr to construct the CallExpr early and put it into
and OwningPtr instead of constructing only after all of sema is done.  This
has a couple of effects:
1. it fixes memory leaks from all the error cases in sema
2. it simplifies the code significantly.

The cost of this is that the error case now new's and delete's an expr where
it did not before, but we don't care about the perf of the error case.

llvm-svn: 45380
2007-12-28 05:29:59 +00:00
Chris Lattner 6420345a34 move file to proper place in project.
llvm-svn: 45379
2007-12-28 05:27:01 +00:00