]> granicus.if.org Git - clang/log
clang
14 years agoImplement C++ [temp.local]p4, which specifies how we eliminate
Douglas Gregor [Mon, 12 Apr 2010 20:54:26 +0000 (20:54 +0000)]
Implement C++ [temp.local]p4, which specifies how we eliminate
name-lookup ambiguities when there are multiple base classes that are
all specializations of the same class template. This is part of a
general cleanup for ambiguities in template-name lookup. Fixes
PR6717.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101065 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix null dereference in 'WriteSourceLocation' when the FileEntry is null.
Ted Kremenek [Mon, 12 Apr 2010 19:54:17 +0000 (19:54 +0000)]
Fix null dereference in 'WriteSourceLocation' when the FileEntry is null.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101060 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoPrune includes.
Benjamin Kramer [Mon, 12 Apr 2010 19:45:50 +0000 (19:45 +0000)]
Prune includes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101059 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUpdate doxygen comments about lifetime requirements of CXUnsaveFile data arguments.
Ted Kremenek [Mon, 12 Apr 2010 18:47:26 +0000 (18:47 +0000)]
Update doxygen comments about lifetime requirements of CXUnsaveFile data arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101054 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd some API code for future work.
Fariborz Jahanian [Mon, 12 Apr 2010 18:18:10 +0000 (18:18 +0000)]
Add some API code for future work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101052 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIRgen: Add CGRecordLayout::dump, and dump (irgen) record layouts as part of -fdump...
Daniel Dunbar [Mon, 12 Apr 2010 18:14:18 +0000 (18:14 +0000)]
IRgen: Add CGRecordLayout::dump, and dump (irgen) record layouts as part of -fdump-record-layouts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101051 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofix PR6819
Chris Lattner [Mon, 12 Apr 2010 17:25:51 +0000 (17:25 +0000)]
fix PR6819

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101050 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agotighten the check for cast of super to avoid rejecting valid code,
Chris Lattner [Mon, 12 Apr 2010 17:09:27 +0000 (17:09 +0000)]
tighten the check for cast of super to avoid rejecting valid code,
rdar://7853261

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101048 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen creating the implicitly-declared special member functions, be
Douglas Gregor [Mon, 12 Apr 2010 17:09:20 +0000 (17:09 +0000)]
When creating the implicitly-declared special member functions, be
sure to introduce them into the current Scope (when we have one) in
addition to the DeclContext for the class, so that they can be found
by name lookup for inline members of the class. Fixes PR6570.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101047 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofix rdar://7852959 - Use of super within a block is actually ok.
Chris Lattner [Mon, 12 Apr 2010 17:03:29 +0000 (17:03 +0000)]
fix rdar://7852959 - Use of super within a block is actually ok.
(aka, Fariborz was right ;-)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101046 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIssue warning when 'weak_import' attribute is applied on a class only
Fariborz Jahanian [Mon, 12 Apr 2010 16:57:31 +0000 (16:57 +0000)]
Issue warning when 'weak_import' attribute is applied on a class only
when it is not supported in versions of MacOs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101044 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove the blanket statement about Clang not supporting access control. It does now
Douglas Gregor [Mon, 12 Apr 2010 16:01:38 +0000 (16:01 +0000)]
Remove the blanket statement about Clang not supporting access control. It does now

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101041 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix a crash-on-invalid involving name lookup of tag names, where we
Douglas Gregor [Mon, 12 Apr 2010 16:00:01 +0000 (16:00 +0000)]
Fix a crash-on-invalid involving name lookup of tag names, where we
ended up finding a function template that we didn't expect. Recover
more gracefully, and fix a similar issue for class templates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101040 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd another test case for r101029, which verifies that we now
Douglas Gregor [Mon, 12 Apr 2010 07:51:13 +0000 (07:51 +0000)]
Add another test case for r101029, which verifies that we now
correctly diagnose instantiation of a function parameter with Objective-C
class type (since Objective-C classes can't be passed by value).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101031 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoBe sure to instantiate the parameters of a function, even when the
Douglas Gregor [Mon, 12 Apr 2010 07:48:19 +0000 (07:48 +0000)]
Be sure to instantiate the parameters of a function, even when the
function's type is (strictly speaking) non-dependent. This ensures
that, e.g., default function arguments get instantiated properly.

And, since I couldn't resist, collapse the two implementations of
function-parameter instantiation into calls to a single, new function
(Sema::SubstParmVarDecl), since the two had nearly identical code (and
each had bugs the other didn't!). More importantly, factored out the
semantic analysis of a parameter declaration into
Sema::CheckParameter, which is called both by
Sema::ActOnParamDeclarator (when parameters are parsed) and when a
parameter is instantiated. Previously, we were missing some
Objective-C and address-space checks on instantiated function
parameters.

Fixes PR6733.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101029 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofix a bug I noticed by inspection, correcting two reject-valid bugs.
Chris Lattner [Mon, 12 Apr 2010 06:36:00 +0000 (06:36 +0000)]
fix a bug I noticed by inspection, correcting two reject-valid bugs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101026 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofix a rejects-valid bug that I introduced, pointed out
Chris Lattner [Mon, 12 Apr 2010 06:27:57 +0000 (06:27 +0000)]
fix a rejects-valid bug that I introduced, pointed out
by David Chisnall

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101024 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agouse pointer comparison instead of isStr
Chris Lattner [Mon, 12 Apr 2010 06:22:50 +0000 (06:22 +0000)]
use pointer comparison instead of isStr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101022 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofix a rejects-valid testcase involving super that I dreamt up.
Chris Lattner [Mon, 12 Apr 2010 06:20:33 +0000 (06:20 +0000)]
fix a rejects-valid testcase involving super that I dreamt up.
This also fixes cases where super is used in a block in a
method which isn't valid.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101021 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agochange Scope::WithinElse to be a normal scope flag, widen the
Chris Lattner [Mon, 12 Apr 2010 06:12:50 +0000 (06:12 +0000)]
change Scope::WithinElse to be a normal scope flag, widen the
fields to two 16-bit values instead of using bitfields.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101020 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofix this test.
Chris Lattner [Mon, 12 Apr 2010 05:47:20 +0000 (05:47 +0000)]
fix this test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101019 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoxfail this test for now.
Chris Lattner [Mon, 12 Apr 2010 05:44:13 +0000 (05:44 +0000)]
xfail this test for now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101018 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofix an invalid use of super, you can't use super like this in a block!
Chris Lattner [Mon, 12 Apr 2010 05:43:31 +0000 (05:43 +0000)]
fix an invalid use of super, you can't use super like this in a block!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101017 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoHave the parser decide whether a message to super is a variable or
Chris Lattner [Mon, 12 Apr 2010 05:38:43 +0000 (05:38 +0000)]
Have the parser decide whether a message to super is a variable or
type, instead of having sema do it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101016 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTypo.
Nick Lewycky [Mon, 12 Apr 2010 05:32:01 +0000 (05:32 +0000)]
Typo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101015 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofix a fixme, stop evaluating getCurMethodDecl() repeatedly
Chris Lattner [Mon, 12 Apr 2010 05:10:17 +0000 (05:10 +0000)]
fix a fixme, stop evaluating getCurMethodDecl() repeatedly
in "LookupInObjCMethod".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101014 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoother half of r101005
Chris Lattner [Mon, 12 Apr 2010 02:18:49 +0000 (02:18 +0000)]
other half of r101005

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101006 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofix PR6287 by accepting and ignoring the returns_twice attribute.
Chris Lattner [Mon, 12 Apr 2010 02:18:38 +0000 (02:18 +0000)]
fix PR6287 by accepting and ignoring the returns_twice attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101005 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoHave the CXXBaseOrMemberInitializer keep track of whether an initializer initializes...
Anders Carlsson [Mon, 12 Apr 2010 00:51:03 +0000 (00:51 +0000)]
Have the CXXBaseOrMemberInitializer keep track of whether an initializer initializes a virtual base or not.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101004 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUnbreak test on windows.
Ted Kremenek [Sun, 11 Apr 2010 22:25:18 +0000 (22:25 +0000)]
Unbreak test on windows.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100999 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix another bug where we wouldn't generate secondary vtables for construction vtables...
Anders Carlsson [Sun, 11 Apr 2010 22:20:36 +0000 (22:20 +0000)]
Fix another bug where we wouldn't generate secondary vtables for construction vtables in some cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100998 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd initial USR support for macro definitions.
Ted Kremenek [Sun, 11 Apr 2010 22:20:34 +0000 (22:20 +0000)]
Add initial USR support for macro definitions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100997 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAugment clang_getCursorUSR() to not always expect that clang_getCursorDecl() does...
Ted Kremenek [Sun, 11 Apr 2010 22:20:26 +0000 (22:20 +0000)]
Augment clang_getCursorUSR() to not always expect that clang_getCursorDecl() does the right
thing if the cursor is not a decl (such as in the case of macros).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100996 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMore renames.
Anders Carlsson [Sun, 11 Apr 2010 22:07:06 +0000 (22:07 +0000)]
More renames.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100991 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRename a function parameter.
Anders Carlsson [Sun, 11 Apr 2010 22:03:57 +0000 (22:03 +0000)]
Rename a function parameter.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100990 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd CIndex support for blocks.
Ted Kremenek [Sun, 11 Apr 2010 21:47:37 +0000 (21:47 +0000)]
Add CIndex support for blocks.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100989 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUpdate checker build.
Ted Kremenek [Sun, 11 Apr 2010 21:02:52 +0000 (21:02 +0000)]
Update checker build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100987 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoClarify an assertion.
Anders Carlsson [Sun, 11 Apr 2010 20:23:06 +0000 (20:23 +0000)]
Clarify an assertion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100986 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix a bug where we were adding too many vcall offsets in some cases.
Anders Carlsson [Sun, 11 Apr 2010 20:04:11 +0000 (20:04 +0000)]
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

14 years agoadd haiku support, patch by Paul Davey!
Chris Lattner [Sun, 11 Apr 2010 19:29:39 +0000 (19:29 +0000)]
add haiku support, patch by Paul Davey!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100982 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoavoid double negatives
Chris Lattner [Sun, 11 Apr 2010 18:53:08 +0000 (18:53 +0000)]
avoid double negatives

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100976 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix CFG bug where bases of member expressions were not always evaluated in a lvalue...
Ted Kremenek [Sun, 11 Apr 2010 17:02:10 +0000 (17:02 +0000)]
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

14 years agoFix bug in AddStmtChoice:asLValue() where 'AsLValueNotAlwaysAdd' would not be treated...
Ted Kremenek [Sun, 11 Apr 2010 17:02:04 +0000 (17:02 +0000)]
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

14 years agoSort visitor methods. No functionality change.
Ted Kremenek [Sun, 11 Apr 2010 17:01:59 +0000 (17:01 +0000)]
Sort visitor methods.  No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100964 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix run line so this test actually tests something.
Benjamin Kramer [Sun, 11 Apr 2010 09:39:39 +0000 (09:39 +0000)]
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

14 years agofix PR6811 by not parsing 'super' as a magic expression in
Chris Lattner [Sun, 11 Apr 2010 08:28:14 +0000 (08:28 +0000)]
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

14 years agoactually the interface grossness in the previous patch was due to
Chris Lattner [Sun, 11 Apr 2010 07:51:10 +0000 (07:51 +0000)]
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

14 years agofactor the code that handles "expr.field" when expr is a
Chris Lattner [Sun, 11 Apr 2010 07:45:24 +0000 (07:45 +0000)]
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

14 years agofix a problem causing us to lose the ''s around objc interface names
Chris Lattner [Sun, 11 Apr 2010 07:04:01 +0000 (07:04 +0000)]
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

14 years agoSimplify test, in the hopes of making linux happy.
Daniel Dunbar [Sun, 11 Apr 2010 01:10:44 +0000 (01:10 +0000)]
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

14 years agoEnable an assert and remove a now unnecessary assert.
Anders Carlsson [Sat, 10 Apr 2010 21:50:08 +0000 (21:50 +0000)]
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

14 years agoFix another vbase layout bug.
Anders Carlsson [Sat, 10 Apr 2010 21:35:33 +0000 (21:35 +0000)]
Fix another vbase layout bug.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100952 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd a simple debug-only verification pass to the record layout builder.
Anders Carlsson [Sat, 10 Apr 2010 21:24:48 +0000 (21:24 +0000)]
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

14 years agoFix a bug where we would add the same function twice in a vtable.
Anders Carlsson [Sat, 10 Apr 2010 20:39:29 +0000 (20:39 +0000)]
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

14 years agorevert 100942, pending discussion.
Chris Lattner [Sat, 10 Apr 2010 19:33:39 +0000 (19:33 +0000)]
revert 100942, pending discussion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100946 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRename VtableComponent and VtableBuilder.
Anders Carlsson [Sat, 10 Apr 2010 19:13:06 +0000 (19:13 +0000)]
Rename VtableComponent and VtableBuilder.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100945 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRename -dump-record-layouts to -fdump-record-layouts now that the option behaves...
Anders Carlsson [Sat, 10 Apr 2010 19:09:13 +0000 (19:09 +0000)]
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

14 years agoFix for PR6811.
David Chisnall [Sat, 10 Apr 2010 19:06:38 +0000 (19:06 +0000)]
Fix for PR6811.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100942 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSimplify the virtual base layout code and fix a bug where we wouldn't store the offse...
Anders Carlsson [Sat, 10 Apr 2010 18:42:27 +0000 (18:42 +0000)]
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

14 years agofix PR6805: llvm.objectsize changed to take an i1 instead of an i32.
Chris Lattner [Sat, 10 Apr 2010 18:34:14 +0000 (18:34 +0000)]
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

14 years agoDriver: Only add extra -L paths on darwin if they exist. Unfortunately, this
Daniel Dunbar [Sat, 10 Apr 2010 18:18:57 +0000 (18:18 +0000)]
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

14 years agoTweak test for portability.
Daniel Dunbar [Sat, 10 Apr 2010 17:45:01 +0000 (17:45 +0000)]
Tweak test for portability.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100931 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDriver: Ignore -fobjc-gc and -fobjc-gc-only for platforms which don't support them.
Daniel Dunbar [Sat, 10 Apr 2010 16:20:23 +0000 (16:20 +0000)]
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

14 years agoA bunch of string-related microoptimizations in Mangler.
Benjamin Kramer [Sat, 10 Apr 2010 16:03:31 +0000 (16:03 +0000)]
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

14 years agoFix use after free. Incrementing an use_iterator after its user is erased is unsafe.
Benjamin Kramer [Sat, 10 Apr 2010 11:02:40 +0000 (11:02 +0000)]
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

14 years agoWhen a member pointer is dereferenced, the class it points into must be complete...
Sebastian Redl [Sat, 10 Apr 2010 10:14:54 +0000 (10:14 +0000)]
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

14 years agoDoug pointed out that we have a perfectly reasonable expression here to
John McCall [Sat, 10 Apr 2010 09:39:25 +0000 (09:39 +0000)]
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

14 years agoDiagnose more cases of initializing distinct members of an anonymous union
John McCall [Sat, 10 Apr 2010 09:28:51 +0000 (09:28 +0000)]
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

14 years agoDiagnose misordered initializers in constructor templates immediately instead of
John McCall [Sat, 10 Apr 2010 07:37:23 +0000 (07:37 +0000)]
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

14 years agorely even less on CallInst internals
Gabor Greif [Sat, 10 Apr 2010 03:45:50 +0000 (03:45 +0000)]
rely even less on CallInst internals

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100919 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agodo not rely on CallInst interna, use CallSite to access arguments
Gabor Greif [Sat, 10 Apr 2010 02:56:12 +0000 (02:56 +0000)]
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

14 years agoDriver/Darwin/x86: When linking, incorporate -L paths based on the path where
Daniel Dunbar [Sat, 10 Apr 2010 01:24:22 +0000 (01:24 +0000)]
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

14 years agoDisable diag::err_file_modified on Win32 completely, until someone cares to fix
Daniel Dunbar [Sat, 10 Apr 2010 01:17:16 +0000 (01:17 +0000)]
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

14 years agoMangle some expressions with codegen implications but no mangling "overhead".
John McCall [Fri, 9 Apr 2010 22:54:09 +0000 (22:54 +0000)]
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

14 years agoProvide an extremely unsatisfactory diagnostic (instead of crashing) when
John McCall [Fri, 9 Apr 2010 22:26:14 +0000 (22:26 +0000)]
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

14 years agoProvide manglings for bool and character literal expressions. These are
John McCall [Fri, 9 Apr 2010 21:48:08 +0000 (21:48 +0000)]
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

14 years agoWhen upgrading an Objective-C class from a forward declaration to a
Douglas Gregor [Fri, 9 Apr 2010 21:30:38 +0000 (21:30 +0000)]
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

14 years agoOnly complain about explicit instantiations following explicit
Douglas Gregor [Fri, 9 Apr 2010 21:02:29 +0000 (21:02 +0000)]
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

14 years agoRemove copy of 'Optional' in Clang tree, and convert clients to use the one now in...
Ted Kremenek [Fri, 9 Apr 2010 20:26:58 +0000 (20:26 +0000)]
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

14 years agoRemove fixit for string literal comparison. Telling the user to use 'strcmp' is...
Ted Kremenek [Fri, 9 Apr 2010 20:26:53 +0000 (20:26 +0000)]
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

14 years agoFix typo.
Benjamin Kramer [Fri, 9 Apr 2010 19:40:47 +0000 (19:40 +0000)]
Fix typo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100887 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTurn access control on by default in the driver.
John McCall [Fri, 9 Apr 2010 19:12:06 +0000 (19:12 +0000)]
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

14 years agoArgh, I modified the .inc file locally, not the .td.
John McCall [Fri, 9 Apr 2010 19:09:08 +0000 (19:09 +0000)]
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

14 years agoTurn access control on by default in -cc1.
John McCall [Fri, 9 Apr 2010 19:03:51 +0000 (19:03 +0000)]
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

14 years agoSuppress access control diagnostics when looking up a base or member name
John McCall [Fri, 9 Apr 2010 19:01:14 +0000 (19:01 +0000)]
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

14 years agoImprove diagnostics like "initializing <type> from an expression of
Douglas Gregor [Fri, 9 Apr 2010 17:53:29 +0000 (17:53 +0000)]
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

14 years agoRemove all "used" static functions *after* we have performed all of
Douglas Gregor [Fri, 9 Apr 2010 17:41:13 +0000 (17:41 +0000)]
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

14 years agoInstantiate default argument expressions even if their associated parameter
John McCall [Fri, 9 Apr 2010 17:38:44 +0000 (17:38 +0000)]
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

14 years agoDon't warn about unused static functions if they are marked with
Chris Lattner [Fri, 9 Apr 2010 17:25:05 +0000 (17:25 +0000)]
Don't warn about unused static functions if they are marked with
attr constructor or destructor.  Patch by Jean-Daniel Dupas!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100870 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoOn Windows, disable the modification-time check for files used in
Douglas Gregor [Fri, 9 Apr 2010 15:54:22 +0000 (15:54 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100866 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFixes a regression caused by implementing cstyle methods
Fariborz Jahanian [Fri, 9 Apr 2010 15:40:42 +0000 (15:40 +0000)]
Fixes a regression caused by implementing cstyle methods
for objc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100865 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoForcibly disable test/PCH/pr4489.c, it is flaky on one of the buildbots.
Daniel Dunbar [Fri, 9 Apr 2010 15:30:57 +0000 (15:30 +0000)]
Forcibly disable test/PCH/pr4489.c, it is flaky on one of the buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100864 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd a note to the C++ compatibility page about templates with no
John McCall [Fri, 9 Apr 2010 01:07:07 +0000 (01:07 +0000)]
Add a note to the C++ compatibility page about templates with no
valid instantiations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100836 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImprove diagnostics when we fail to convert from a source type to a
Douglas Gregor [Fri, 9 Apr 2010 00:35:39 +0000 (00:35 +0000)]
Improve diagnostics when we fail to convert from a source type to a
destination type for initialization, assignment, parameter-passing,
etc. The main issue fixed here is that we used rather confusing
wording for diagnostics such as

t.c:2:9: warning: initializing 'char const [2]' discards qualifiers,
      expected 'char *' [-pedantic]
  char *name = __func__;
        ^      ~~~~~~~~

We're not initializing a 'char const [2]', we're initializing a 'char
*' with an expression of type 'char const [2]'. Similar problems
existed for other diagnostics in this area, so I've normalized them all
with more precise descriptive text to say what we're
initializing/converting/assigning/etc. from and to. The warning for
the code above is now:

t.c:2:9: warning: initializing 'char *' from an expression of type
      'char const [2]' discards qualifiers [-pedantic]
  char *name = __func__;
        ^      ~~~~~~~~

Fixes <rdar://problem/7447179>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100832 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUse '%clang_cc1' instead of '%clang' to make the warning output more consistent across
Ted Kremenek [Thu, 8 Apr 2010 23:17:16 +0000 (23:17 +0000)]
Use '%clang_cc1' instead of '%clang' to make the warning output more consistent across
platforms (for this test).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100827 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFor 'open' check in UnixAPIChecker, hard code value of 'O_CREAT' on Darwin.
Ted Kremenek [Thu, 8 Apr 2010 22:15:34 +0000 (22:15 +0000)]
For 'open' check in UnixAPIChecker, hard code value of 'O_CREAT' on Darwin.
This is still not an ideal solution, but should disable the check for other
targets where the value of O_CREAT is different.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100818 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoReorder diagnostics to separate the Sema::AssignmentAction diagnostics from other...
Douglas Gregor [Thu, 8 Apr 2010 22:07:57 +0000 (22:07 +0000)]
Reorder diagnostics to separate the Sema::AssignmentAction diagnostics from other diagnostics

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100817 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTemporarily only enable 'open' check on Mac OS X to unbreak Windows buildbot. I'm
Ted Kremenek [Thu, 8 Apr 2010 21:54:13 +0000 (21:54 +0000)]
Temporarily only enable 'open' check on Mac OS X to unbreak Windows buildbot.  I'm
looking into an alternate fix right now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100816 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDowngrade the "declaration does not declare anything" error to a
Douglas Gregor [Thu, 8 Apr 2010 21:33:23 +0000 (21:33 +0000)]
Downgrade the "declaration does not declare anything" error to a
warning. It's not harmful to have such pointless declarations, and GCC
does not diagnose this issue consistently.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100814 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImplement method type encoding in the presense
Fariborz Jahanian [Thu, 8 Apr 2010 21:29:11 +0000 (21:29 +0000)]
Implement method type encoding in the presense
of c-style arguments. Completes radar 7445205.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100813 91177308-0d34-0410-b5e6-96231b3b80d8