Commit Graph

42400 Commits

Author SHA1 Message Date
Chris Lattner 59a2594f3f rename Decl::CompatibleAlias -> ObjCCompatibleAlias.
Fix objc ivar lookup.  Ivar lookup should occur between lookup
of method-local values and lookup of globals.  Emulate this with
some logic in the handling of Sema::ActOnIdentifierExpr.

Two todo's left:
 1) sema shouldn't turn a bare reference to an ivar into "self->ivar"
    in the AST.  This is a hack.
 2) The new ScopedDecl::isDefinedOutsideFunctionOrMethod method does
    not correctly handle typedefs and enum constants yet.

llvm-svn: 48972
2008-03-31 00:36:02 +00:00
Nate Begeman f2b0b0eb17 Don't eliminate bitcast instructions that change the type of a pointer
llvm-svn: 48971
2008-03-31 00:22:16 +00:00
Chris Lattner c00c35a857 some cleanups on top of David's patch. There are still two
remaining open issues I've communicated to him:

1) self can be assigned to, and his patch didn't handle it correctly.
2) CollectObjCIvarTypes is N^2 (because each subclass reprocesses
   all parent class ivars) and flattens classes.  If A derives from B, 
   and both have an int, I'd expect to get { {i32}, i32}, not { i32, i32}.

David, please review.

llvm-svn: 48970
2008-03-30 23:25:33 +00:00
Chris Lattner 4bd5596d08 Add initial support for objc codegen for methods, ivars, and the
etoile runtime, patch by David Chisnall!

llvm-svn: 48969
2008-03-30 23:03:07 +00:00
Erick Tryzelaar dd0ace574b Tweak build system to allow for installing the tutorial and uninstalling the docs.
llvm-svn: 48968
2008-03-30 20:32:18 +00:00
Duncan Sands 7d6c8ae488 Fix comment typo.
llvm-svn: 48967
2008-03-30 19:38:55 +00:00
Erick Tryzelaar a2eba03db2 Fix some documentation for the tutorial.
llvm-svn: 48966
2008-03-30 19:14:31 +00:00
Nick Lewycky 9fb8908457 Moved from PR1570.
llvm-svn: 48965
2008-03-30 19:07:11 +00:00
Chris Lattner e950eee303 stop building llvmc.
llvm-svn: 48964
2008-03-30 18:58:05 +00:00
Chris Lattner 0f760dfe09 Fix "Control reaches the end of non-void function" warnings,
patch by David Chisnall.

llvm-svn: 48963
2008-03-30 18:22:13 +00:00
Chris Lattner 519a51a76f minor code cleanups, allow constant folding sinf/cosf.
llvm-svn: 48961
2008-03-30 18:02:00 +00:00
Chris Lattner a01203e047 fix typo, PR2181
llvm-svn: 48954
2008-03-30 16:59:21 +00:00
Erick Tryzelaar ca3c28bd58 Add chapter 3 and 4 of the ocaml/kaleidoscope tutorial.
llvm-svn: 48949
2008-03-30 09:57:12 +00:00
Evan Cheng 16d72072df Cosmetic changes.
llvm-svn: 48947
2008-03-29 18:34:22 +00:00
Anton Korobeynikov 08bae57469 Honour another bunch of parameter attributes in llvm2cpp
llvm-svn: 48942
2008-03-29 11:25:49 +00:00
Anton Korobeynikov a125be374e Honour ByVal parameter attribute in llvm2cpp
llvm-svn: 48941
2008-03-29 11:15:01 +00:00
Chris Lattner 4311ad2dae change iterator invalidation avoidance to just move the iterator backward
when something changes, instead of moving forward.  This allows us to 
simplify memset lowering, inserting the memset at the end of the range of 
stuff we're touching instead of at the start.

This, in turn, allows us to make use of the addressing instructions already
used in the function instead of inserting our own.  For example, we now
codegen:

	%tmp41 = getelementptr [8 x i8]* %ref_idx, i32 0, i32 0		; <i8*> [#uses=2]
	call void @llvm.memset.i64( i8* %tmp41, i8 -1, i64 8, i32 1 )

instead of:

	%tmp20 = getelementptr [8 x i8]* %ref_idx, i32 0, i32 7		; <i8*> [#uses=1]
	%ptroffset = getelementptr i8* %tmp20, i64 -7		; <i8*> [#uses=1]
	call void @llvm.memset.i64( i8* %ptroffset, i8 -1, i64 8, i32 1 )

llvm-svn: 48940
2008-03-29 05:15:47 +00:00
Chris Lattner ac95515741 make the common case of a single store (which clearly shouldn't be turned
into a memset!) faster by avoiding an allocation of an std::list node.

llvm-svn: 48939
2008-03-29 04:52:12 +00:00
Chris Lattner 28e7b57605 add a testcase for forming memset from noncontiguous stores.
llvm-svn: 48938
2008-03-29 04:51:35 +00:00
Chris Lattner d528b21a65 give form-memset a significantly more sane heuristic, enable it by default.
llvm-svn: 48937
2008-03-29 04:36:18 +00:00
Owen Anderson 8b22873bdd Remove some unneeded code for LiveInterval joining, and fix a bug in the Phi elimination algorithm where we were accidentally reasoning about
the source rather than the destination.

llvm-svn: 48936
2008-03-29 01:58:47 +00:00
Evan Cheng 1c76b558c4 Cosmetic change.
llvm-svn: 48935
2008-03-29 01:04:05 +00:00
Dan Gohman fd2eb00cc2 Fix a tokenfactor node to use the load chain rather than the
load value. This fixes PR2177.

llvm-svn: 48932
2008-03-28 23:45:16 +00:00
Steve Naroff f9e7c90129 Only have the rewriter produce a file when there are no errors.
llvm-svn: 48926
2008-03-28 22:26:09 +00:00
Steve Naroff 0de4199ca0 Make sure Sema::ActOnClassMessage() correctly diagnoses "super".
llvm-svn: 48924
2008-03-28 21:37:05 +00:00
Evan Cheng b8654202dd Backing out 48911 for now. It's breaking stuff.
llvm-svn: 48922
2008-03-28 17:49:06 +00:00
Ted Kremenek c719424caa Added skeleton checking for NSString's method initWithFormat: (do not pass nil). This won't be useful in most cases right now
because the analyzer isn't tracking expected types for an object, and [NSString alloc] just runs "id".

llvm-svn: 48917
2008-03-28 16:09:38 +00:00
Chris Lattner a148acdc82 ifdef out a dead function. Should this be removed?
llvm-svn: 48916
2008-03-28 15:36:27 +00:00
Duncan Sands 35c7cdac07 Rename getAnyLoad to getLoad is suggested by Evan.
llvm-svn: 48914
2008-03-28 09:45:24 +00:00
Evan Cheng 81e0c9a32c New entry.
llvm-svn: 48912
2008-03-28 07:07:06 +00:00
Evan Cheng 9ae4d7b719 Load from stub is already re-materializable.
llvm-svn: 48911
2008-03-28 06:49:25 +00:00
Nick Lewycky f88c84f690 Update example to new syntax.
llvm-svn: 48910
2008-03-28 06:46:51 +00:00
Chris Lattner d62964a7d8 make memset inference significantly more powerful: it can now handle
memsets that initialize "structs of arrays" and other store sequences
that are not sequential.  This is still only enabled if you pass 
-form-memset-from-stores.  The flag is not heavily tested and I haven't
analyzed the perf regressions when -form-memset-from-stores is passed
either, but this causes no make check regressions.

llvm-svn: 48909
2008-03-28 06:45:13 +00:00
Evan Cheng 87bac50d7b New entry.
llvm-svn: 48908
2008-03-28 06:34:23 +00:00
Bill Wendling a86fd1b214 Simplify the conversion from "0x" numbers to a single digit number.
llvm-svn: 48907
2008-03-28 06:22:23 +00:00
Steve Naroff 60a9ef67e2 Add some of Ted's recent work to the VC++ project file.
Fix a couple bozo bugs in the rewriter.

llvm-svn: 48903
2008-03-27 22:59:54 +00:00
Steve Naroff 00a317694b Collect all the preamble code and don't insert it until the end.
llvm-svn: 48899
2008-03-27 22:29:16 +00:00
Ted Kremenek 276278e5d2 Expanded NSString checking to check for nil for a few more methods.
llvm-svn: 48898
2008-03-27 22:05:32 +00:00
Ted Kremenek 2e4e7ccb22 Add line SourceLocation to NSString checks.
Added test case to test warning about passing 'nil' to NSString's compare: method.

llvm-svn: 48896
2008-03-27 21:23:57 +00:00
Ted Kremenek 27156c8c9f Hooked up initial NSString interface checking to GRSimpleVals.
llvm-svn: 48895
2008-03-27 21:15:17 +00:00
Duncan Sands f740509e58 Implement LegalizeTypes support for softfloat LOAD.
In order to handle indexed nodes I had to introduce
a new constructor, and since I was there I factorized
the code in the various load constructors.

llvm-svn: 48894
2008-03-27 20:23:40 +00:00
Dan Gohman cad51cb671 Avoid creating chain dependencies from CopyToReg nodes to load and store
nodes. This doesn't currently have much impact the generated code, but it
does produce simpler-looking SelectionDAGs, and consequently
simpler-looking ScheduleDAGs, because there are fewer spurious
dependencies.

In particular, CopyValueToVirtualRegister now uses the entry node as the
input chain dependency for new CopyToReg nodes instead of calling getRoot
and depending on the most recent memory reference.

Also, rename UnorderedChains to PendingExports and pull it up from being
a local variable in SelectionDAGISel::BuildSelectionDAG to being a
member variable of SelectionDAGISel, so that it doesn't have to be
passed around to all the places that need it.

llvm-svn: 48893
2008-03-27 19:56:19 +00:00
Ted Kremenek c8948c77f7 ProgramPoint is just a smart pointer; no reason to return a constant reference.
llvm-svn: 48891
2008-03-27 18:11:59 +00:00
Devang Patel eb1e3fcbe0 PHI->removeIncomingValue may remove PHInode.
Increment iterator in advance.

llvm-svn: 48890
2008-03-27 17:32:46 +00:00
Ted Kremenek 64b95a024e Minor CSS tweaking (smaller h1 tags).
Bug fix in EscapeText (for std::string) where spaces were not properly emitted.

llvm-svn: 48889
2008-03-27 17:28:58 +00:00
Ted Kremenek 30560caa3d For HTMLDiagnostics, when emitting the name of the directory, substitute the current working directory for "."
llvm-svn: 48888
2008-03-27 17:25:28 +00:00
Ted Kremenek 296b4c1bc6 Update Xcode project: add BasicObjCFoundationChecks.h
llvm-svn: 48887
2008-03-27 17:17:51 +00:00
Ted Kremenek a4d60b6de3 Add creation of BasicObjCFoundationChecks when running GRSimpleVals from the driver.
llvm-svn: 48886
2008-03-27 17:17:22 +00:00
Ted Kremenek f89469e392 Add default ctor implementation.
llvm-svn: 48885
2008-03-27 17:16:06 +00:00
Ted Kremenek 561dfe3153 Add html::EscapeText for std::string; use this function to escape text in message bubbles.
llvm-svn: 48884
2008-03-27 17:15:29 +00:00