Commit Graph

21953 Commits

Author SHA1 Message Date
Chris Lattner 6033be79b3 avoid double negatives
llvm-svn: 100976
2010-04-11 18:53:08 +00:00
Ted Kremenek 5868ec6e3d Fix CFG bug where bases of member expressions were not always evaluated in a lvalue context. Fixes <rdar://problem/7813989>.
llvm-svn: 100966
2010-04-11 17:02:10 +00:00
Ted Kremenek 66de60376c Fix bug in AddStmtChoice:asLValue() where 'AsLValueNotAlwaysAdd' would not be treated as indicating an lvalue.
llvm-svn: 100965
2010-04-11 17:02:04 +00:00
Ted Kremenek d2ba1f9ff0 Sort visitor methods. No functionality change.
llvm-svn: 100964
2010-04-11 17:01:59 +00:00
Benjamin Kramer 249f50ca04 Fix run line so this test actually tests something.
llvm-svn: 100962
2010-04-11 09:39:39 +00:00
Chris Lattner a36ec4243b fix PR6811 by not parsing 'super' as a magic expression in
LookupInObjCMethod.  Doing so allows all sorts of invalid code
to slip through to codegen.  This patch does not change the 
AST representation of super, though that would now be a natural
thing to do since it can only be in the receiver position and
in the base of a ObjCPropertyRefExpr.

There are still several ugly areas handling super in the parser,
but this is definitely a step in the right direction.

llvm-svn: 100959
2010-04-11 08:28:14 +00:00
Chris Lattner 90c58faea6 actually the interface grossness in the previous patch was due to
typo correction.  However, now that the code has been factored out
of LookupMemberExpr, it can recurse to itself instead of to 
LookupMemberExpr!  Remove grossness.

llvm-svn: 100958
2010-04-11 07:51:10 +00:00
Chris Lattner 2b1ca5fb8a factor the code that handles "expr.field" when expr is a
pointer to an objc interface out to a method in SemaExprObjC.
This is *much* uglier than it should be due to grossness in
LookupMemberExpr :(

llvm-svn: 100957
2010-04-11 07:45:24 +00:00
Chris Lattner 00dcffded1 fix a problem causing us to lose the ''s around objc interface names
in a diagnostic.

llvm-svn: 100956
2010-04-11 07:04:01 +00:00
Daniel Dunbar 2131f9ba8c Simplify test, in the hopes of making linux happy.
llvm-svn: 100955
2010-04-11 01:10:44 +00:00
Anders Carlsson 0b5522114e Enable an assert and remove a now unnecessary assert.
llvm-svn: 100953
2010-04-10 21:50:08 +00:00
Anders Carlsson 7a148f7141 Fix another vbase layout bug.
llvm-svn: 100952
2010-04-10 21:35:33 +00:00
Anders Carlsson 5b441d73b7 Add a simple debug-only verification pass to the record layout builder.
llvm-svn: 100951
2010-04-10 21:24:48 +00:00
Anders Carlsson 88cf34f2b4 Fix a bug where we would add the same function twice in a vtable.
llvm-svn: 100949
2010-04-10 20:39:29 +00:00
Chris Lattner bd7b0a8d55 revert 100942, pending discussion.
llvm-svn: 100946
2010-04-10 19:33:39 +00:00
Anders Carlsson be1b9cbc63 Rename VtableComponent and VtableBuilder.
llvm-svn: 100945
2010-04-10 19:13:06 +00:00
Anders Carlsson 6a75ebb137 Rename -dump-record-layouts to -fdump-record-layouts now that the option behaves like aa flag.
llvm-svn: 100943
2010-04-10 19:09:13 +00:00
David Chisnall 916fb83f39 Fix for PR6811.
llvm-svn: 100942
2010-04-10 19:06:38 +00:00
Anders Carlsson 291279e3a6 Simplify the virtual base layout code and fix a bug where we wouldn't store the offset for a virtual base.
llvm-svn: 100940
2010-04-10 18:42:27 +00:00
Chris Lattner bc3be65d2e fix PR6805: llvm.objectsize changed to take an i1 instead of an i32.
llvm-svn: 100938
2010-04-10 18:34:14 +00:00
Daniel Dunbar 06ef31c8b1 Driver: Only add extra -L paths on darwin if they exist. Unfortunately, this
means it isn't really possible to write the test case for this code, but this is
the kind of thing that really requires testing against the installed compiler
anyway.

llvm-svn: 100935
2010-04-10 18:18:57 +00:00
Daniel Dunbar 6e444c07b7 Tweak test for portability.
llvm-svn: 100931
2010-04-10 17:45:01 +00:00
Daniel Dunbar 16334e143f Driver: Ignore -fobjc-gc and -fobjc-gc-only for platforms which don't support them.
llvm-svn: 100930
2010-04-10 16:20:23 +00:00
Benjamin Kramer 1554e4a4bb A bunch of string-related microoptimizations in Mangler.
llvm-svn: 100928
2010-04-10 16:03:31 +00:00
Benjamin Kramer 2e8ca0b86d Fix use after free. Incrementing an use_iterator after its user is erased is unsafe.
llvm-svn: 100926
2010-04-10 11:02:40 +00:00
Sebastian Redl c72350ea9f When a member pointer is dereferenced, the class it points into must be complete. Enforce this.
llvm-svn: 100925
2010-04-10 10:14:54 +00:00
John McCall e2f3524f83 Doug pointed out that we have a perfectly reasonable expression here to
serve as a source of source locations for the can't-yet-mangle diagnostic.

llvm-svn: 100924
2010-04-10 09:39:25 +00:00
John McCall 23eebd9c1e Diagnose more cases of initializing distinct members of an anonymous union
member.  Use a better diagnostic for this case.  Also fix a bug with nested
anonymous structs/unions for -Wreorder;  this last was PR6575.

llvm-svn: 100923
2010-04-10 09:28:51 +00:00
John McCall bb7b658ab5 Diagnose misordered initializers in constructor templates immediately instead of
when they're instantiated.  Merge the note into the -Wreorder warning;  it
doesn't really contribute much, and it was splitting a thought across diagnostics
anyway.  Don't crash in the parser when a constructor's initializers end in a
comma and there's no body;  the recovery here is still terrible, but anything's
better than a crash.

llvm-svn: 100922
2010-04-10 07:37:23 +00:00
Gabor Greif d394aec87d rely even less on CallInst internals
llvm-svn: 100919
2010-04-10 03:45:50 +00:00
Gabor Greif d0ef1346f3 do not rely on CallInst interna, use CallSite to access arguments
llvm-svn: 100918
2010-04-10 02:56:12 +00:00
Daniel Dunbar 4364558956 Driver/Darwin/x86: When linking, incorporate -L paths based on the path where
Clang is installed. This is designed to match gcc, and is important when
installed in a non-standard location.
 - This is gross, but no worse than ever. It will die when we finally move to
   the compiler-rt based toolchain, any day now.

llvm-svn: 100915
2010-04-10 01:24:22 +00:00
Daniel Dunbar 584344f2ec Disable diag::err_file_modified on Win32 completely, until someone cares to fix
it. PR6812.
 - This is another attempt at silencing annoying buildbot failures.

llvm-svn: 100914
2010-04-10 01:17:16 +00:00
John McCall e8917e0fd2 Mangle some expressions with codegen implications but no mangling "overhead".
llvm-svn: 100909
2010-04-09 22:54:09 +00:00
John McCall 6936c863b0 Provide an extremely unsatisfactory diagnostic (instead of crashing) when
mangling an unknown expression kind.  Also conveniently tells the user what
kind of expression they should add to the mangler!

llvm-svn: 100907
2010-04-09 22:26:14 +00:00
John McCall 09277542f2 Provide manglings for bool and character literal expressions. These are
just integer-literal expressions with special case implementations in the AST.

Fixes rdar://problem/7825453.

llvm-svn: 100905
2010-04-09 21:48:08 +00:00
Douglas Gregor 530805711f When upgrading an Objective-C class from a forward declaration to a
full-fledged @interface, be sure that the declaration has the right
lexical context. <rdar://problem/7827709>

llvm-svn: 100903
2010-04-09 21:30:38 +00:00
Douglas Gregor 06aa50417d Only complain about explicit instantiations following explicit
specializations when the explicit instantiation was... explicitly
written, i.e., not the product of an explicit instantiation of an
enclosing class. Fixes this spurious warning when Clang builds LLVM:

/Volumes/Data/dgregor/Projects/llvm/lib/CodeGen/MachineDominators.cpp:22:1:
warning: explicit instantiation of 'addRoot' that occurs after an
explicit specialization will be ignored (C++0x extension) [-pedantic]

llvm-svn: 100900
2010-04-09 21:02:29 +00:00
Ted Kremenek 26984fb4eb Remove copy of 'Optional' in Clang tree, and convert clients to use the one now in the LLVM tree.
llvm-svn: 100891
2010-04-09 20:26:58 +00:00
Ted Kremenek 800b66be9d Remove fixit for string literal comparison. Telling the user to use 'strcmp' is bad, and
we don't have enough information to tell them how to use 'strncmp'.  Instead, change the
diagnostic to indicate they should use 'strncmp'.

llvm-svn: 100890
2010-04-09 20:26:53 +00:00
Benjamin Kramer 41ef2a6b32 Fix typo.
llvm-svn: 100887
2010-04-09 19:40:47 +00:00
John McCall dfea9989ef Turn access control on by default in the driver.
llvm-svn: 100882
2010-04-09 19:12:06 +00:00
John McCall b684a545fa Argh, I modified the .inc file locally, not the .td.
llvm-svn: 100881
2010-04-09 19:09:08 +00:00
John McCall 3155f573f5 Turn access control on by default in -cc1.
Remove -faccess-control from -cc1; add -fno-access-control.
Make the driver pass -fno-access-control by default.
Update a bunch of tests to be correct under access control.

llvm-svn: 100880
2010-04-09 19:03:51 +00:00
John McCall da6841bade Suppress access control diagnostics when looking up a base or member name
fails to find a type.  There are no cases where it's valid for this to produce
an error.

llvm-svn: 100878
2010-04-09 19:01:14 +00:00
Douglas Gregor b10646d4ce Improve diagnostics like "initializing <type> from an expression of
type..." with "initializing <type> with an expression of type...",
which reads better. Thanks to John for the improved wording.

llvm-svn: 100873
2010-04-09 17:53:29 +00:00
Douglas Gregor fb8b27d530 Remove all "used" static functions *after* we have performed all of
the implicit template instantiations we need to perform. Otherwise, we
end up erroneously diagnosing static functions as used if they were
only used within an implicit template instantiation. Fixes a bunch of
spurious failures when building Clang with Clang.

llvm-svn: 100872
2010-04-09 17:41:13 +00:00
John McCall b29f78fb9e Instantiate default argument expressions even if their associated parameter
type isn't dependent.  Fixes rdar://problem/7838962.

llvm-svn: 100871
2010-04-09 17:38:44 +00:00
Chris Lattner 8a651c7116 Don't warn about unused static functions if they are marked with
attr constructor or destructor.  Patch by Jean-Daniel Dupas!

llvm-svn: 100870
2010-04-09 17:25:05 +00:00
Douglas Gregor 08288f2846 On Windows, disable the modification-time check for files used in
precompiled headers and/or when reading the contents of the file into
memory. These checks seem to be causing spurious regression-test
failures on Windows.

llvm-svn: 100866
2010-04-09 15:54:22 +00:00