Commit Graph

51132 Commits

Author SHA1 Message Date
Nick Lewycky f9e2394009 Fix typo, psuedo -> pseudo.
llvm-svn: 60651
2008-12-07 03:49:52 +00:00
Chris Lattner 7564a3b81b Some internal refactoring to make it easier to cache results.
llvm-svn: 60650
2008-12-07 02:56:57 +00:00
Chris Lattner 2faa2c724a Introduce a new MemDep::getNonLocalPointerDependency
method.  This will eventually take over load/store dep
queries from getNonLocalDependency.  For now it works
fine, but is incredibly slow because it does no caching.
Lets not switch GVN to use it until that is fixed :)

llvm-svn: 60649
2008-12-07 02:15:47 +00:00
Chris Lattner 5a78604e39 push the "pointer case" up the analysis stack a bit. This causes
duplication of logic (in 2 places) to determine what pointer a 
load/store touches.  This will be addressed in a future commit.

llvm-svn: 60648
2008-12-07 01:50:16 +00:00
Chris Lattner ed494f791e make clients have to know how to call getCallSiteDependencyFrom
instead of making getDependencyFrom do it.

llvm-svn: 60647
2008-12-07 01:21:14 +00:00
Chris Lattner b3582b939e a minor grammar fix
llvm-svn: 60646
2008-12-07 00:59:53 +00:00
Anders Carlsson a1a9c28d30 Pass the VLA size expr range to the VLA diags
llvm-svn: 60645
2008-12-07 00:49:48 +00:00
Chris Lattner ccb9c3370a rename some variables for consistency
llvm-svn: 60644
2008-12-07 00:39:19 +00:00
Chris Lattner e2069a6949 I love how using out of scope variables is not an error with GCC, no really I do.
llvm-svn: 60643
2008-12-07 00:38:27 +00:00
Chris Lattner 056c090c67 Rename getCallSiteDependency -> getCallSiteDependencyFrom to
emphasize the scanning and make it more similar to 
getDependencyFrom
 

llvm-svn: 60642
2008-12-07 00:35:51 +00:00
Chris Lattner d4d9588abc a memdep query on a volatile load/store will always return
clobber with the current implementation.  Instead of returning
a "precise clobber" just return a fuzzy one.  This doesn't 
matter to any clients anyway and should speed up analysis time
very very slightly.

llvm-svn: 60641
2008-12-07 00:28:02 +00:00
Chris Lattner 5df5b4cc2e don't bother touching volatile stores, they will just return clobber on
everything interesting anyway.

llvm-svn: 60640
2008-12-07 00:25:15 +00:00
Chris Lattner f5891941b4 remove the ability to get memdep info for vaarg. I don't think the
original impl was correct and noone actually makes the query anyway.

llvm-svn: 60639
2008-12-07 00:21:18 +00:00
Anders Carlsson 0d8f0ba6ed Improve VLA diagnostics/sema checking. Fixes PR2361 and PR2352.
llvm-svn: 60638
2008-12-07 00:20:55 +00:00
Chris Lattner b098a7883f make getDependencyFrom private.
llvm-svn: 60637
2008-12-07 00:16:50 +00:00
Chris Lattner a163568c03 improve a note.
llvm-svn: 60636
2008-12-07 00:15:10 +00:00
Fariborz Jahanian 06d0dd641b Setters returning a typedef of 'void' should not cause error.
Bug reported by Chris L.

llvm-svn: 60635
2008-12-06 23:12:49 +00:00
Fariborz Jahanian d2c2ad515e Use of properties declared in protocols in the category
via the category's protocol list1s, with appropriate
diagnsostics and a test case.

llvm-svn: 60634
2008-12-06 23:03:39 +00:00
Chris Lattner da93063acc some more PRE/GVN/DSE related notes.
llvm-svn: 60633
2008-12-06 22:52:12 +00:00
Chris Lattner 527dd60430 add a note
llvm-svn: 60632
2008-12-06 22:49:05 +00:00
Anders Carlsson 3bb1ffca94 Simplify test.
llvm-svn: 60631
2008-12-06 22:27:22 +00:00
Fariborz Jahanian ff83998e31 Improve error reporting of property and setter/getter
type mimatches.

llvm-svn: 60630
2008-12-06 21:48:16 +00:00
Fariborz Jahanian 8707e322cc Check for correct'void' return type for setter methods.
llvm-svn: 60629
2008-12-06 21:11:37 +00:00
Anders Carlsson 5df391e5c7 Add diagnostics for bitfields.
llvm-svn: 60628
2008-12-06 20:33:04 +00:00
Anders Carlsson 45f4b8c0f2 Fix invalid bit-field.
llvm-svn: 60627
2008-12-06 20:32:39 +00:00
Anders Carlsson 233a60d03e Simplify some diagnostics.
llvm-svn: 60626
2008-12-06 20:05:35 +00:00
Fariborz Jahanian 62293f4d97 Changed a 'FIXME' into new comment. Added a test case
testing declaration of properties in categories.

llvm-svn: 60625
2008-12-06 19:59:02 +00:00
Chris Lattner 543d6c65fa some random notes.
llvm-svn: 60624
2008-12-06 19:28:22 +00:00
Nick Lewycky 1f6a7b5002 Minor cleanup. Use dyn_cast, not isa/cast pairs. No functionality change.
llvm-svn: 60623
2008-12-06 17:57:05 +00:00
Ted Kremenek 69d78b9d98 Add bandaid transfer function support for assignments involving ObjCKVCRefExpr.
llvm-svn: 60622
2008-12-06 02:39:30 +00:00
Evan Cheng ab85feb91c Clean up some ARM GV asm printing out; minor fixes to match what gcc does.
llvm-svn: 60621
2008-12-06 02:00:55 +00:00
Fariborz Jahanian 5a3422f602 Patch to diagnose a variety of misuse of property
attributes. Example would be, readonly, assign or
assign, copy, etc.

llvm-svn: 60620
2008-12-06 01:12:43 +00:00
Chris Lattner 57e91eaf61 Reimplement the inner loop of DSE. It now uniformly uses getDependence(),
doesn't do its own local caching, and is slightly more aggressive about
free/store dse (see testcase).  This eliminates the last external client 
of MemDep::getDependenceFrom().

llvm-svn: 60619
2008-12-06 00:53:22 +00:00
Douglas Gregor b0846b0f51 Add support for calls to dependent names within templates, e.g.,
template<typename T> void f(T x) {
    g(x); // g is a dependent name, so don't even bother to look it up
    g(); // error: g is not a dependent name
  }

Note that when we see "g(", we build a CXXDependentNameExpr. However,
if none of the call arguments are type-dependent, we will force the
resolution of the name "g" and replace the CXXDependentNameExpr with
its result.

GCC actually produces a nice error message when you make this
mistake, and even offers to compile your code with -fpermissive. I'll
do the former next, but I don't plan to do the latter.

llvm-svn: 60618
2008-12-06 00:22:45 +00:00
Dan Gohman 35e2cfccaf Don't use plain %x to print pointer values. I had changed it from %p
since %p isn't formatted consistently, but obviously plain %x is wrong.
PRIxPTR with a cast to uintptr_t would work here, but that requires
inconvenient build-system changes. %lu works on all current and
foreseable future hosts.

llvm-svn: 60616
2008-12-05 23:39:24 +00:00
Douglas Gregor 4619e439b6 Introduce basic support for dependent types, type-dependent
expressions, and value-dependent expressions. This permits us to parse
some template definitions.

This is not a complete solution; we're missing type- and
value-dependent computations for most of the expression types, and
we're missing checks for dependent types and type-dependent
expressions throughout Sema.

llvm-svn: 60615
2008-12-05 23:32:09 +00:00
Dale Johannesen 0733759b5a Fix test to pass on Linux.
llvm-svn: 60614
2008-12-05 22:38:21 +00:00
Fariborz Jahanian 9c196795e6 Fixed a comment.
llvm-svn: 60611
2008-12-05 22:36:19 +00:00
Fariborz Jahanian fbbaf6afae This test checks for duplicate implementation of the same
property. It also checks for duplicate use of the same ivar
in two different iproperty implementations. It also caught
an error for a test case used in CodeGen :).

llvm-svn: 60610
2008-12-05 22:32:48 +00:00
Dale Johannesen b49d7cf19e Forgot a file.
llvm-svn: 60609
2008-12-05 21:55:35 +00:00
Dale Johannesen 9efd2ce55b Make LoopStrengthReduce smarter about hoisting things out of
loops when they can be subsumed into addressing modes.

Change X86 addressing mode check to realize that
some PIC references need an extra register.
(I believe this is correct for Linux, if not, I'm sure
someone will tell me.)

llvm-svn: 60608
2008-12-05 21:47:27 +00:00
Chris Lattner 0e3d6337c6 Make a few major changes to memdep and its clients:
1. Merge the 'None' result into 'Normal', making loads
   and stores return their dependencies on allocations as Normal.
2. Split the 'Normal' result into 'Clobber' and 'Def' to
   distinguish between the cases when memdep knows the value is
   produced from when we just know if may be changed.
3. Move some of the logic for determining whether readonly calls
   are CSEs into memdep instead of it being in GVN.  This still
   leaves verification that the arguments are hte same to GVN to
   let it know about value equivalences in different contexts.
4. Change memdep's call/call dependency analysis to use 
   getModRefInfo(CallSite,CallSite) instead of doing something 
   very weak.  This only really matters for things like DSA, but
   someday maybe we'll have some other decent context sensitive
   analyses :)
5. This reimplements the guts of memdep to handle the new results.
6. This simplifies GVN significantly:
   a) readonly call CSE is slightly simpler
   b) I eliminated the "getDependencyFrom" chaining for load 
      elimination and load CSE doesn't have to worry about 
      volatile (they are always clobbers) anymore.
   c) GVN no longer does any 'lastLoad' caching, leaving it to 
      memdep.
7. The logic in DSE is simplified a bit and sped up.  A potentially
   unsafe case was eliminated.

llvm-svn: 60607
2008-12-05 21:04:20 +00:00
Dan Gohman 7f079aabed Demangle and pretty-print symbols in internal backtraces. Patch by
Wesley Peck, with a few fixes by me.

llvm-svn: 60605
2008-12-05 20:12:48 +00:00
Anton Korobeynikov 24600bf05a Revert invalid r60393. It causes llvm-gcc bootstrap fails in release builds.
See PR3160 for details

llvm-svn: 60604
2008-12-05 19:38:49 +00:00
Evan Cheng 7a15646d69 This test also requires -mattr=+sse41.
llvm-svn: 60601
2008-12-05 19:26:37 +00:00
Chris Lattner eda6432beb Make it illegal to call getDependency* on non-memory instructions
like binary operators.

llvm-svn: 60600
2008-12-05 18:46:19 +00:00
Fariborz Jahanian 88909849bb Fixed a test case. Added a test case showing property setter's
type mismatch (related to my last patch).

llvm-svn: 60599
2008-12-05 18:38:31 +00:00
Fariborz Jahanian 7988d7dc3e (instance/class) Method type checking between class and its implementation.
(instance/class) Method type checking between category and its implementation.
And a test case for all.

llvm-svn: 60598
2008-12-05 18:18:52 +00:00
Douglas Gregor 5101c24f60 Representation of template type parameters and non-type template
parameters, with some semantic analysis:
  - Template parameters are introduced into template parameter scope
  - Complain about template parameter shadowing (except in Microsoft mode)

Note that we leak template parameter declarations like crazy, a
problem we'll remedy once we actually create proper declarations for
templates. 

Next up: dependent types and value-dependent/type-dependent
expressions.

llvm-svn: 60597
2008-12-05 18:15:24 +00:00
Evan Cheng 43c0891838 Reason #3 from 60595 doesn't hold true. If we can fold a PIC load from constpool into a use, the rewrite happens at time of spill (not in VirtRegMap). Later on, if the GlobalBaseReg is spilled, the spiller can see the use uses GlobalBaseReg and do the right thing.
llvm-svn: 60596
2008-12-05 17:41:31 +00:00