Граф коммитов

20800 Коммитов

Автор SHA1 Сообщение Дата
Anders Carlsson af6ddf2071 Fix a bug where we were adding too many vcall offsets in some cases.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100985 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-11 20:04:11 +00:00
Chris Lattner 86ed3a3263 add haiku support, patch by Paul Davey!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100982 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-11 19:29:39 +00:00
Chris Lattner b9342fb79b avoid double negatives
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100976 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-11 18:53:08 +00:00
Ted Kremenek 115c1b9cc7 Fix CFG bug where bases of member expressions were not always evaluated in a lvalue context. Fixes <rdar://problem/7813989>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100966 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-11 17:02:10 +00:00
Ted Kremenek 431ac2d9c2 Fix bug in AddStmtChoice:asLValue() where 'AsLValueNotAlwaysAdd' would not be treated as indicating an lvalue.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100965 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-11 17:02:04 +00:00
Ted Kremenek 7ea2136685 Sort visitor methods. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100964 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-11 17:01:59 +00:00
Benjamin Kramer e6da20fcd8 Fix run line so this test actually tests something.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100962 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-11 09:39:39 +00:00
Chris Lattner eb483eb3ee 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100959 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-11 08:28:14 +00:00
Chris Lattner b9d4fc1f54 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100958 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-11 07:51:10 +00:00
Chris Lattner 7f81652f97 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 :(


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100957 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-11 07:45:24 +00:00
Chris Lattner 0784fcddb4 fix a problem causing us to lose the ''s around objc interface names
in a diagnostic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100956 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-11 07:04:01 +00:00
Daniel Dunbar 5f6480dbe7 Simplify test, in the hopes of making linux happy.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100955 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-11 01:10:44 +00:00
Anders Carlsson 4995997eb3 Enable an assert and remove a now unnecessary assert.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100953 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-10 21:50:08 +00:00
Anders Carlsson 573021fc10 Fix another vbase layout bug.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100952 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-10 21:35:33 +00:00
Anders Carlsson a1e87162d3 Add a simple debug-only verification pass to the record layout builder.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100951 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-10 21:24:48 +00:00
Anders Carlsson f622b450d7 Fix a bug where we would add the same function twice in a vtable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100949 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-10 20:39:29 +00:00
Chris Lattner c603d09980 revert 100942, pending discussion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100946 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-10 19:33:39 +00:00
Anders Carlsson 9446481d4a Rename VtableComponent and VtableBuilder.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100945 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-10 19:13:06 +00:00
Anders Carlsson 46116ce06a Rename -dump-record-layouts to -fdump-record-layouts now that the option behaves like aa flag.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100943 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-10 19:09:13 +00:00
David Chisnall d281915e49 Fix for PR6811.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100942 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-10 19:06:38 +00:00
Anders Carlsson bdda6c1788 Simplify the virtual base layout code and fix a bug where we wouldn't store the offset for a virtual base.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100940 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-10 18:42:27 +00:00
Chris Lattner c24b9c4655 fix PR6805: llvm.objectsize changed to take an i1 instead of an i32.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100938 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-10 18:34:14 +00:00
Daniel Dunbar e3c153a88a 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100935 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-10 18:18:57 +00:00
Daniel Dunbar 467ebc935e Tweak test for portability.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100931 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-10 17:45:01 +00:00
Daniel Dunbar 43a9b3263c Driver: Ignore -fobjc-gc and -fobjc-gc-only for platforms which don't support them.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100930 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-10 16:20:23 +00:00
Benjamin Kramer 35f59b64b4 A bunch of string-related microoptimizations in Mangler.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100928 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-10 16:03:31 +00:00
Benjamin Kramer dbf02bccc9 Fix use after free. Incrementing an use_iterator after its user is erased is unsafe.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100926 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-10 11:02:40 +00:00
Sebastian Redl 59fc2690e6 When a member pointer is dereferenced, the class it points into must be complete. Enforce this.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100925 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-10 10:14:54 +00:00
John McCall 739bf09fc6 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100924 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-10 09:39:25 +00:00
John McCall 3c3ccdbe73 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100923 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-10 09:28:51 +00:00
John McCall d6ca8da0f5 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100922 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-10 07:37:23 +00:00
Gabor Greif 35db3b9aad rely even less on CallInst internals
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100919 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-10 03:45:50 +00:00
Gabor Greif 6ba728d968 do not rely on CallInst interna, use CallSite to access arguments
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100918 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-10 02:56:12 +00:00
Daniel Dunbar 8bc9c55012 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100915 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-10 01:24:22 +00:00
Daniel Dunbar 0b3c773bdc Disable diag::err_file_modified on Win32 completely, until someone cares to fix
it. PR6812.
 - This is another attempt at silencing annoying buildbot failures.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100914 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-10 01:17:16 +00:00
John McCall d93076038a Mangle some expressions with codegen implications but no mangling "overhead".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100909 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 22:54:09 +00:00
John McCall 6ae1f35ced 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!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100907 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 22:26:14 +00:00
John McCall de81063acd 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100905 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 21:48:08 +00:00
Douglas Gregor 78713d86fa 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>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100903 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 21:30:38 +00:00
Douglas Gregor c42b6520b6 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]



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100900 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 21:02:29 +00:00
Ted Kremenek 66d5142ab5 Remove copy of 'Optional' in Clang tree, and convert clients to use the one now in the LLVM tree.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100891 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 20:26:58 +00:00
Ted Kremenek 03a4bee558 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'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100890 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 20:26:53 +00:00
Benjamin Kramer c53e3658e6 Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100887 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 19:40:47 +00:00
John McCall 32579cf507 Turn access control on by default in the driver.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100882 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 19:12:06 +00:00
John McCall 380509aa10 Argh, I modified the .inc file locally, not the .td.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100881 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 19:09:08 +00:00
John McCall 7002f4c03c 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100880 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 19:03:51 +00:00
John McCall fd2254405d 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100878 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 19:01:14 +00:00
Douglas Gregor 08a41901e1 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100873 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 17:53:29 +00:00
Douglas Gregor 47268a3f28 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100872 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 17:41:13 +00:00
John McCall 6cd3b9fb8a Instantiate default argument expressions even if their associated parameter
type isn't dependent.  Fixes rdar://problem/7838962.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100871 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 17:38:44 +00:00